Skip to content

Commit c006963

Browse files
committed
refactor: use datetime constants
1 parent a6aa30a commit c006963

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/core/src/test/shared/awsClientBuilderV3.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { assertTelemetry } from '../testUtil'
1616
import { telemetry } from '../../shared/telemetry'
1717
import { CredentialsShim } from '../../auth/deprecated/loginManager'
1818
import { Credentials } from '@aws-sdk/types'
19+
import { oneDay } from '../../shared/datetime'
1920

2021
describe('AwsClientBuilderV3', function () {
2122
let builder: AWSClientBuilderV3
@@ -72,13 +73,13 @@ describe('AwsClientBuilderV3', function () {
7273
accessKeyId: 'old',
7374
secretAccessKey: 'old',
7475
sessionToken: 'old',
75-
expiration: new Date(Date.now() + 1000 * 60 * 60 * 24),
76+
expiration: new Date(Date.now() + oneDay),
7677
}
7778
newCreds = {
7879
accessKeyId: 'new',
7980
secretAccessKey: 'new',
8081
sessionToken: 'new',
81-
expiration: new Date(Date.now() + 1000 * 60 * 60 * 24 * 2),
82+
expiration: new Date(Date.now() + oneDay),
8283
}
8384
mockCredsShim = new MockCredentialsShim(oldCreds, newCreds)
8485
fakeContext.credentialsShim = mockCredsShim
@@ -99,7 +100,7 @@ describe('AwsClientBuilderV3', function () {
99100
accessKeyId: 'old2',
100101
secretAccessKey: 'old2',
101102
sessionToken: 'old2',
102-
expiration: new Date(Date.now() + 1000 * 60 * 60 * 24),
103+
expiration: new Date(Date.now() + oneDay),
103104
}
104105
mockCredsShim.update(newerCreds)
105106
assert.strictEqual(await service.config.credentials(), newerCreds)

0 commit comments

Comments
 (0)