From 37b39b51bcf06d4707f8623566587ebe121412df Mon Sep 17 00:00:00 2001 From: nkomonen Date: Tue, 13 Feb 2024 15:27:12 -0500 Subject: [PATCH] test: try fix flaky test 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 --- packages/toolkit/src/test/srcShared/fs.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/toolkit/src/test/srcShared/fs.test.ts b/packages/toolkit/src/test/srcShared/fs.test.ts index 217aa1a01ec..1345d36d8b9 100644 --- a/packages/toolkit/src/test/srcShared/fs.test.ts +++ b/packages/toolkit/src/test/srcShared/fs.test.ts @@ -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 () {