@@ -142,8 +142,12 @@ const lambdaMockSettings = {
142142
143143/* global before, after, beforeEach, afterEach, describe, it */
144144describe ( 'lib/main' , function ( ) {
145- if ( [ 'win32' , 'darwin' ] . includes ( process . platform ) ) {
146- // It seems that it takes time for file operation in Windows and Mac.
145+ if ( process . platform === 'win32' ) {
146+ // It seems that it takes very long time for file operation in Windows.
147+ // So set `timeout(300000)` for the whole test.
148+ this . timeout ( 300000 )
149+ } else if ( process . platform === 'darwin' ) {
150+ // It seems that it takes time for file operation in Mac.
147151 // So set `timeout(120000)` for the whole test.
148152 this . timeout ( 120000 )
149153 }
@@ -154,8 +158,11 @@ describe('lib/main', function () {
154158 return
155159 }
156160 execFileSync ( 'npm' , [ 'ci' ] , { cwd : sourceDirectoryForTest } )
161+ } )
162+
163+ beforeEach ( ( ) => {
164+ program = Object . assign ( { } , originalProgram ) // clone
157165
158- // for sdk v3
159166 mockLambdaClient . reset ( )
160167 mockLambdaClient . on ( AddPermissionCommand ) . resolves ( lambdaMockSettings . addPermission )
161168 mockLambdaClient . on ( CreateEventSourceMappingCommand ) . resolves ( lambdaMockSettings . createEventSourceMapping )
@@ -184,10 +191,6 @@ describe('lib/main', function () {
184191 mockS3Client . on ( PutObjectCommand ) . resolves ( { } )
185192 } )
186193
187- beforeEach ( ( ) => {
188- program = Object . assign ( { } , originalProgram ) // clone
189- } )
190-
191194 it ( 'version should be set' , ( ) => {
192195 assert . equal ( lambda . version , '1.3.0' )
193196 } )
0 commit comments