File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ describe('ServerlessWebpack', () => {
8080 expect ( Module . _load ) . to . have . been . calledWith ( 'ts-node/register' ) ;
8181 } ) ;
8282
83+ it ( 'should not register ts-node if it has already been registered' , ( ) => {
84+ _ . set ( serverless , 'service.custom.webpack.webpackConfig' , 'webpack.config.ts' ) ;
85+ process [ Symbol . for ( 'ts-node.register.instance' ) ] = 'foo' ;
86+ new ServerlessWebpack ( serverless , { } ) ;
87+ delete process [ Symbol . for ( 'ts-node.register.instance' ) ] ;
88+ expect ( Module . _load ) . to . not . have . been . called ;
89+ expect ( Module . _load ) . to . not . have . been . calledWith ( 'ts-node/register' ) ;
90+ } ) ;
91+
8392 it ( 'should throw an error if config use TS but ts-node was not added as dependency' , ( ) => {
8493 moduleStub . throws ( ) ;
8594
You can’t perform that action at this time.
0 commit comments