File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ const modules = getMethodNamesByModules(fakerEN);
81
81
describe ( 'BROKEN_LOCALE_METHODS test' , ( ) => {
82
82
it ( 'should not contain obsolete configuration (modules)' , ( ) => {
83
83
const existingModules = Object . keys ( modules ) ;
84
- const configuredModules = Object . keys ( BROKEN_LOCALE_METHODS ?? { } ) ;
84
+ const configuredModules = Object . keys ( BROKEN_LOCALE_METHODS ) ;
85
85
const obsoleteModules = configuredModules . filter (
86
86
( module ) => ! existingModules . includes ( module )
87
87
) ;
Original file line number Diff line number Diff line change @@ -142,8 +142,12 @@ class TestGenerator<
142
142
repetitions : number = 1
143
143
) : void {
144
144
this . setup ( ) ;
145
+ const callable = this . module [ method ] ;
146
+ if ( callable == null ) {
147
+ throw new Error ( `Method ${ method } not found in ${ this . moduleName } ` ) ;
148
+ }
149
+
145
150
for ( let i = 0 ; i < repetitions ; i ++ ) {
146
- const callable = this . module [ method ] ;
147
151
const value = callable ( ...args ) ;
148
152
expect ( value ) . toMatchSnapshot ( ) ;
149
153
}
You can’t perform that action at this time.
0 commit comments