Skip to content

Commit

Permalink
focus on individual test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hweinstock committed Nov 15, 2024
1 parent 3cbf39a commit 87fbc01
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions packages/core/src/test/credentials/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,34 +505,35 @@ describe('Auth', function () {
sinon.restore()
await fs.delete(tmpDir, { recursive: true })
})
for (const _ of Array.from({ length: 1000 }, (i) => i)) {
it('does not cache if the credentials file changes', async function () {
const initialCreds = {
profileName: 'default',
accessKey: 'x',
secretKey: 'x',
}

await UserCredentialsUtils.generateCredentialsFile(initialCreds)

const conn = await auth.getConnection({ id: 'profile:default' })
assert.ok(conn?.type === 'iam', 'Expected an IAM connection')
assert.deepStrictEqual(await conn.getCredentials(), {
accessKeyId: initialCreds.accessKey,
secretAccessKey: initialCreds.secretKey,
sessionToken: undefined,
})

it('does not cache if the credentials file changes', async function () {
const initialCreds = {
profileName: 'default',
accessKey: 'x',
secretKey: 'x',
}

await UserCredentialsUtils.generateCredentialsFile(initialCreds)

const conn = await auth.getConnection({ id: 'profile:default' })
assert.ok(conn?.type === 'iam', 'Expected an IAM connection')
assert.deepStrictEqual(await conn.getCredentials(), {
accessKeyId: initialCreds.accessKey,
secretAccessKey: initialCreds.secretKey,
sessionToken: undefined,
})

await fs.delete(getCredentialsFilename())
await fs.delete(getCredentialsFilename())

const newCreds = { ...initialCreds, accessKey: 'y', secretKey: 'y' }
await UserCredentialsUtils.generateCredentialsFile(newCreds)
assert.deepStrictEqual(await conn.getCredentials(), {
accessKeyId: newCreds.accessKey,
secretAccessKey: newCreds.secretKey,
sessionToken: undefined,
const newCreds = { ...initialCreds, accessKey: 'y', secretKey: 'y' }
await UserCredentialsUtils.generateCredentialsFile(newCreds)
assert.deepStrictEqual(await conn.getCredentials(), {
accessKeyId: newCreds.accessKey,
secretAccessKey: newCreds.secretKey,
sessionToken: undefined,
})
})
})
}
})

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

0 comments on commit 87fbc01

Please sign in to comment.