diff --git a/packages/core/src/test/shared/credentials/userCredentialsUtils.test.ts b/packages/core/src/test/shared/credentials/userCredentialsUtils.test.ts index ddbd250c2cd..eaeb9bc571d 100644 --- a/packages/core/src/test/shared/credentials/userCredentialsUtils.test.ts +++ b/packages/core/src/test/shared/credentials/userCredentialsUtils.test.ts @@ -18,31 +18,20 @@ import { import { UserCredentialsUtils } from '../../../shared/credentials/userCredentialsUtils' import { EnvironmentVariables } from '../../../shared/environmentVariables' import { makeTemporaryToolkitFolder } from '../../../shared/filesystemUtilities' -import { getConfigFilename, getCredentialsFilename } from '../../../auth/credentials/sharedCredentialsFile' import { fs } from '../../../shared' describe('UserCredentialsUtils', function () { let tempFolder: string - let defaultConfigFileName: string - let defaultCredentialsFilename: string - before(async function () { - defaultConfigFileName = getConfigFilename() - defaultCredentialsFilename = getCredentialsFilename() + beforeEach(async function () { // Make a temp folder for all these tests // Stick some temp credentials files in there to load from tempFolder = await makeTemporaryToolkitFolder() }) afterEach(async function () { - await fs.delete(defaultConfigFileName, { recursive: true }) - await fs.delete(defaultCredentialsFilename, { recursive: true }) - - sinon.restore() - }) - - after(async function () { await fs.delete(tempFolder, { recursive: true }) + sinon.restore() }) describe('findExistingCredentialsFilenames', function () { diff --git a/packages/toolkit/.changes/next-release/Bug Fix-a0acdaa1-7356-4f58-bc9b-fb7b708fe831.json b/packages/toolkit/.changes/next-release/Bug Fix-a0acdaa1-7356-4f58-bc9b-fb7b708fe831.json new file mode 100644 index 00000000000..ecefcc6e87b --- /dev/null +++ b/packages/toolkit/.changes/next-release/Bug Fix-a0acdaa1-7356-4f58-bc9b-fb7b708fe831.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "Fix userCredentialsUtils.test.ts so it won't remove the actual aws config" +}