@@ -16,6 +16,7 @@ import { assertTelemetry } from '../testUtil'
1616import { telemetry } from '../../shared/telemetry'
1717import { CredentialsShim } from '../../auth/deprecated/loginManager'
1818import { Credentials } from '@aws-sdk/types'
19+ import { oneDay } from '../../shared/datetime'
1920
2021describe ( '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 )
@@ -135,7 +136,7 @@ class MockCredentialsShim implements CredentialsShim {
135136 public expire ( ) : void {
136137 this . credentials = {
137138 ...this . credentials ,
138- expiration : new Date ( Date . now ( ) - 1000 * 60 * 60 * 24 ) ,
139+ expiration : new Date ( Date . now ( ) - oneDay ) ,
139140 }
140141 }
141142
0 commit comments