Skip to content

Commit

Permalink
test: try fix flaky test
Browse files Browse the repository at this point in the history
Not sure if this fixes #4390, but we now
reuse the same sandbox instead of recreating it
each time. We were failing a test where a spied method
was being called more than expected.

Signed-off-by: nkomonen <[email protected]>
  • Loading branch information
nkomonen-amazon committed Feb 13, 2024
1 parent a8a6d6b commit 37b39b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/toolkit/src/test/srcShared/fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ describe('FileSystem', function () {

before(async function () {
fakeContext = await FakeExtensionContext.create()
sandbox = Sinon.createSandbox()
await deleteTestRoot() // incase a previous test run failed to clean
})

beforeEach(async function () {
await makeTestRoot()
sandbox = Sinon.createSandbox()
sandbox.restore()
})

afterEach(async function () {
await deleteTestRoot()
sandbox.restore()
})

describe('readFileAsString()', function () {
Expand Down

0 comments on commit 37b39b5

Please sign in to comment.