File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1- import { ValidationException } from '@douglasneuroinformatics/libjs' ;
21import { APP_FILTER , APP_GUARD , APP_PIPE } from '@nestjs/core' ;
32import { Test , TestingModule } from '@nestjs/testing' ;
43import { 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 ) ;
Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments