Skip to content

Commit ff3804f

Browse files
test: fik flaky fs test (#4764)
Our mkdir() spy was sometimes catching an unexpected mkdir() call and causing the test to fail. So instead we are just checking that the first mkdir() call has the expected args Signed-off-by: Nikolas Komonen <[email protected]>
1 parent 71351d7 commit ff3804f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/test/srcShared/fs.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ describe('FileSystem', function () {
170170
paths.forEach(async function (p) {
171171
it(`creates folder but uses the "fs" module if in C9: '${p}'`, async function () {
172172
sandbox.stub(extensionUtilities, 'isCloud9').returns(true)
173-
const mkdirSpy = sandbox.spy(fsPromises, 'mkdir')
174173
const dirPath = createTestPath(p)
174+
const mkdirSpy = sandbox.spy(fsPromises, 'mkdir')
175175

176176
await fsCommon.mkdir(dirPath)
177177

178178
assert(existsSync(dirPath))
179-
assert.deepStrictEqual(mkdirSpy.args, [[dirPath, { recursive: true }]])
179+
assert.deepStrictEqual(mkdirSpy.args[0], [dirPath, { recursive: true }])
180180
})
181181
})
182182
})

0 commit comments

Comments
 (0)