Skip to content

Commit 8767872

Browse files
authored
Merge pull request #64 from DouglasNeuroInformatics/dev
fix tests
2 parents 0b4b442 + eb93aa2 commit 8767872

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/app/__tests__/app.factory.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ValidationException } from '@douglasneuroinformatics/libjs';
21
import { APP_FILTER, APP_GUARD, APP_PIPE } from '@nestjs/core';
32
import { Test, TestingModule } from '@nestjs/testing';
43
import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler';
@@ -188,7 +187,20 @@ describe('AppFactory', () => {
188187
vi.stubEnv('VERBOSE', '1');
189188
expect(() => createAppContainer()).toThrow(
190189
expect.objectContaining({
191-
cause: expect.any(ValidationException),
190+
// cause: {
191+
// details: {
192+
// issues: [expect.any(Object)]
193+
// }
194+
// },
195+
details: {
196+
issues: [
197+
expect.objectContaining({
198+
code: 'invalid_type',
199+
expected: 'boolean',
200+
path: ['VERBOSE']
201+
})
202+
]
203+
},
192204
message: 'Failed to parse environment config'
193205
})
194206
);

src/cli/__tests__/libnest.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ describe('libnest', () => {
4646
expect(hook).toHaveBeenCalledExactlyOnceWith('preSubcommand', expect.any(Function));
4747
const callback = hook.mock.lastCall![1];
4848
const getOptionValue = vi.fn();
49-
getOptionValue.mockReturnValueOnce('.env');
49+
getOptionValue.mockReturnValueOnce(['.env']);
5050
await callback({ getOptionValue } as any, null!);
5151
expect(getOptionValue).toHaveBeenCalled();
52-
expect(process.loadEnvFile).toHaveBeenCalledOnce();
52+
expect(process.loadEnvFile).toHaveBeenCalledExactlyOnceWith('.env');
5353
});
5454
it('should pass the resolved config file to the subcommand', async () => {
5555
const hook = vi.spyOn(Command.prototype, 'hook');

0 commit comments

Comments
 (0)