Skip to content

Commit 29b31a2

Browse files
committed
remove loop on test
1 parent dc8a7de commit 29b31a2

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

packages/core/src/test/credentials/auth.test.ts

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -505,35 +505,34 @@ describe('Auth', function () {
505505
sinon.restore()
506506
await fs.delete(tmpDir, { recursive: true })
507507
})
508-
for (const _ of Array.from({ length: 1000 }, (i) => i)) {
509-
it('does not cache if the credentials file changes', async function () {
510-
const initialCreds = {
511-
profileName: 'default',
512-
accessKey: 'x',
513-
secretKey: 'x',
514-
}
515-
516-
await UserCredentialsUtils.generateCredentialsFile(initialCreds)
517-
518-
const conn = await auth.getConnection({ id: 'profile:default' })
519-
assert.ok(conn?.type === 'iam', 'Expected an IAM connection')
520-
assert.deepStrictEqual(await conn.getCredentials(), {
521-
accessKeyId: initialCreds.accessKey,
522-
secretAccessKey: initialCreds.secretKey,
523-
sessionToken: undefined,
524-
})
525508

526-
await fs.delete(getCredentialsFilename())
509+
it('does not cache if the credentials file changes', async function () {
510+
const initialCreds = {
511+
profileName: 'default',
512+
accessKey: 'x',
513+
secretKey: 'x',
514+
}
515+
516+
await UserCredentialsUtils.generateCredentialsFile(initialCreds)
517+
518+
const conn = await auth.getConnection({ id: 'profile:default' })
519+
assert.ok(conn?.type === 'iam', 'Expected an IAM connection')
520+
assert.deepStrictEqual(await conn.getCredentials(), {
521+
accessKeyId: initialCreds.accessKey,
522+
secretAccessKey: initialCreds.secretKey,
523+
sessionToken: undefined,
524+
})
527525

528-
const newCreds = { ...initialCreds, accessKey: 'y', secretKey: 'y' }
529-
await UserCredentialsUtils.generateCredentialsFile(newCreds)
530-
assert.deepStrictEqual(await conn.getCredentials(), {
531-
accessKeyId: newCreds.accessKey,
532-
secretAccessKey: newCreds.secretKey,
533-
sessionToken: undefined,
534-
})
526+
await fs.delete(getCredentialsFilename())
527+
528+
const newCreds = { ...initialCreds, accessKey: 'y', secretKey: 'y' }
529+
await UserCredentialsUtils.generateCredentialsFile(newCreds)
530+
assert.deepStrictEqual(await conn.getCredentials(), {
531+
accessKeyId: newCreds.accessKey,
532+
secretAccessKey: newCreds.secretKey,
533+
sessionToken: undefined,
535534
})
536-
}
535+
})
537536
})
538537

539538
describe('AuthNode', function () {

0 commit comments

Comments
 (0)