🛠️ fix: Ensure imageOutputType is Always Defined (#2438)

* avatar fix

* chore: ensure `imageOutputType` is always defined

* ci(AppService): extra test for default value

* chore: replace default value for `desiredFormat` with `EImageOutputType` enum
This commit is contained in:
Danny Avila 2024-04-16 16:34:19 -04:00 committed by GitHub
parent bf4e64ce63
commit 3c184e9410
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View file

@ -139,7 +139,6 @@ describe('AppService', () => {
);
await AppService(app);
expect(app.locals.imageOutputType).toEqual(EImageOutputType.WEBP);
});
@ -151,7 +150,15 @@ describe('AppService', () => {
);
await AppService(app);
expect(app.locals.imageOutputType).toEqual(EImageOutputType.PNG);
});
it('should default to `PNG` `imageOutputType` with no provided config', async () => {
require('./Config/loadCustomConfig').mockImplementationOnce(() =>
Promise.resolve(undefined),
);
await AppService(app);
expect(app.locals.imageOutputType).toEqual(EImageOutputType.PNG);
});