Skip to content

Commit b433000

Browse files
committed
wip
1 parent 60d9469 commit b433000

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/main.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ const lambdaMockSettings = {
142142

143143
/* global before, after, beforeEach, afterEach, describe, it */
144144
describe('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

Comments
 (0)