Skip to content

Commit

Permalink
test: fik flaky fs test (#4764)
Browse files Browse the repository at this point in the history
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 <nkomonen@amazon.com>
  • Loading branch information
nkomonen-amazon committed Apr 22, 2024
1 parent 71351d7 commit ff3804f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/test/srcShared/fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ describe('FileSystem', function () {
paths.forEach(async function (p) {
it(`creates folder but uses the "fs" module if in C9: '${p}'`, async function () {
sandbox.stub(extensionUtilities, 'isCloud9').returns(true)
const mkdirSpy = sandbox.spy(fsPromises, 'mkdir')
const dirPath = createTestPath(p)
const mkdirSpy = sandbox.spy(fsPromises, 'mkdir')

await fsCommon.mkdir(dirPath)

assert(existsSync(dirPath))
assert.deepStrictEqual(mkdirSpy.args, [[dirPath, { recursive: true }]])
assert.deepStrictEqual(mkdirSpy.args[0], [dirPath, { recursive: true }])
})
})
})
Expand Down

0 comments on commit ff3804f

Please sign in to comment.