Skip to content

Commit 9ca9704

Browse files
committed
remove default credential
1 parent ff1d065 commit 9ca9704

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

packages/core/src/test/shared/credentials/userCredentialsUtils.test.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,20 @@ import {
1818
import { UserCredentialsUtils } from '../../../shared/credentials/userCredentialsUtils'
1919
import { EnvironmentVariables } from '../../../shared/environmentVariables'
2020
import { makeTemporaryToolkitFolder } from '../../../shared/filesystemUtilities'
21-
import { getConfigFilename, getCredentialsFilename } from '../../../auth/credentials/sharedCredentialsFile'
2221
import { fs } from '../../../shared'
2322

2423
describe('UserCredentialsUtils', function () {
2524
let tempFolder: string
26-
let defaultConfigFileName: string
27-
let defaultCredentialsFilename: string
28-
// preserve envs
29-
const credEnv = process.env['AWS_SHARED_CREDENTIALS_FILE']
30-
const configEnv = process.env['AWS_CONFIG_FILE']
3125

32-
before(async function () {
26+
beforeEach(async function () {
3327
// Make a temp folder for all these tests
3428
// Stick some temp credentials files in there to load from
3529
tempFolder = await makeTemporaryToolkitFolder()
36-
37-
// Set env to fake cred/config to avoid the actual aws config being deleted by test
38-
process.env.AWS_SHARED_CREDENTIALS_FILE = path.join(tempFolder, 'aws-credentials-tmp')
39-
process.env.AWS_CONFIG_FILE = path.join(tempFolder, 'aws-config-tmp')
40-
41-
defaultConfigFileName = getConfigFilename()
42-
defaultCredentialsFilename = getCredentialsFilename()
4330
})
4431

4532
afterEach(async function () {
46-
await fs.delete(defaultConfigFileName, { recursive: true })
47-
await fs.delete(defaultCredentialsFilename, { recursive: true })
48-
49-
sinon.restore()
50-
})
51-
52-
after(async function () {
5333
await fs.delete(tempFolder, { recursive: true })
54-
// restore envs
55-
process.env.AWS_SHARED_CREDENTIALS_FILE = credEnv
56-
process.env.AWS_CONFIG_FILE = configEnv
34+
sinon.restore()
5735
})
5836

5937
describe('findExistingCredentialsFilenames', function () {

0 commit comments

Comments
 (0)