refactor(server): app module (#13193)

This commit is contained in:
Jason Rasmussen
2024-10-04 16:57:34 -04:00
committed by GitHub
parent 7ee0221c8e
commit 5d0a4bb1a5
18 changed files with 126 additions and 134 deletions

View File

@@ -3,7 +3,7 @@ import { randomBytes } from 'node:crypto';
import { Stats } from 'node:fs';
import { constants } from 'node:fs/promises';
import { ExifEntity } from 'src/entities/exif.entity';
import { AssetType, SourceType } from 'src/enum';
import { AssetType, ImmichWorker, SourceType } from 'src/enum';
import { IAlbumRepository } from 'src/interfaces/album.interface';
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.interface';
import { ICryptoRepository } from 'src/interfaces/crypto.interface';
@@ -73,7 +73,7 @@ describe(MetadataService.name, () => {
describe('onBootstrapEvent', () => {
it('should pause and resume queue during init', async () => {
await sut.onBootstrap('microservices');
await sut.onBootstrap(ImmichWorker.MICROSERVICES);
expect(jobMock.pause).toHaveBeenCalledTimes(1);
expect(mapMock.init).toHaveBeenCalledTimes(1);
@@ -83,7 +83,7 @@ describe(MetadataService.name, () => {
it('should return if reverse geocoding is disabled', async () => {
systemMock.get.mockResolvedValue({ reverseGeocoding: { enabled: false } });
await sut.onBootstrap('microservices');
await sut.onBootstrap(ImmichWorker.MICROSERVICES);
expect(jobMock.pause).not.toHaveBeenCalled();
expect(mapMock.init).not.toHaveBeenCalled();