Skip to content

Commit c7c9de1

Browse files
committed
Update test folder util
1 parent 32d1de9 commit c7c9de1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/amazonq/test/unit/codewhisperer/util/authUtil.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import assert from 'assert'
77
import * as sinon from 'sinon'
88
import * as path from 'path'
99
import { AuthUtil, amazonQScopes } from 'aws-core-vscode/codewhisperer'
10-
import { createTestAuthUtil } from 'aws-core-vscode/test'
10+
import { createTestAuthUtil, TestFolder } from 'aws-core-vscode/test'
1111
import { constants, cache } from 'aws-core-vscode/auth'
1212
import { auth2 } from 'aws-core-vscode/auth'
13-
import { mementoUtils, makeTemporaryToolkitFolder, tryRemoveFolder, fs } from 'aws-core-vscode/shared'
13+
import { mementoUtils, fs } from 'aws-core-vscode/shared'
1414

1515
describe('AuthUtil', async function () {
1616
let auth: any
@@ -211,12 +211,13 @@ describe('AuthUtil', async function () {
211211
connectionState: 'valid',
212212
},
213213
}
214+
214215
beforeEach(async function () {
215216
memento = {
216217
get: sinon.stub(),
217218
update: sinon.stub().resolves(),
218219
}
219-
cacheDir = await makeTemporaryToolkitFolder()
220+
cacheDir = (await TestFolder.create()).path
220221

221222
sinon.stub(mementoUtils, 'getEnvironmentSpecificMemento').returns(memento)
222223
sinon.stub(cache, 'getCacheDir').returns(cacheDir)
@@ -237,7 +238,6 @@ describe('AuthUtil', async function () {
237238
})
238239

239240
afterEach(async function () {
240-
await Promise.all([tryRemoveFolder(cacheDir)])
241241
sinon.restore()
242242
})
243243

0 commit comments

Comments
 (0)