Skip to content

Commit 9e3bde9

Browse files
authored
test(middleware-sdk-s3): use consistent timestamp in unit test (#5536)
1 parent 9052f98 commit 9e3bde9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/middleware-sdk-s3/src/s3-express/classes/S3ExpressIdentityProviderImpl.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import { S3ExpressIdentityProviderImpl } from "./S3ExpressIdentityProviderImpl";
22

33
describe(S3ExpressIdentityProviderImpl.name, () => {
4+
const timestamp = Date.now() + 90_000;
5+
46
const Credentials = {
57
AccessKeyId: "MOCK_S3_EXPRESS_ACCESS_KEY_ID",
68
SecretAccessKey: "MOCK_S3_EXPRESS_SECRET_ACCESS_KEY",
79
SessionToken: "MOCK_S3_EXPRESS_SESSION_TOKEN",
8-
Expiration: new Date(Date.now() + 90_000),
10+
Expiration: new Date(timestamp),
911
};
1012

1113
const s3ExpressCredentials = {
1214
accessKeyId: "MOCK_S3_EXPRESS_ACCESS_KEY_ID",
1315
secretAccessKey: "MOCK_S3_EXPRESS_SECRET_ACCESS_KEY",
1416
sessionToken: "MOCK_S3_EXPRESS_SESSION_TOKEN",
15-
expiration: new Date(Date.now() + 90_000),
17+
expiration: new Date(timestamp),
1618
};
1719

1820
describe(S3ExpressIdentityProviderImpl.prototype.getS3ExpressIdentity.name, () => {

0 commit comments

Comments
 (0)