File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 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);
8181describe ( 'BROKEN_LOCALE_METHODS test' , ( ) => {
8282 it ( 'should not contain obsolete configuration (modules)' , ( ) => {
8383 const existingModules = Object . keys ( modules ) ;
84- const configuredModules = Object . keys ( BROKEN_LOCALE_METHODS ?? { } ) ;
84+ const configuredModules = Object . keys ( BROKEN_LOCALE_METHODS ) ;
8585 const obsoleteModules = configuredModules . filter (
8686 ( module ) => ! existingModules . includes ( module )
8787 ) ;
Original file line number Diff line number Diff line change @@ -142,8 +142,12 @@ class TestGenerator<
142142 repetitions : number = 1
143143 ) : void {
144144 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+
145150 for ( let i = 0 ; i < repetitions ; i ++ ) {
146- const callable = this . module [ method ] ;
147151 const value = callable ( ...args ) ;
148152 expect ( value ) . toMatchSnapshot ( ) ;
149153 }
You can’t perform that action at this time.
0 commit comments