Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions private/aws-client-api-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
"module": "./dist-es/index.js",
"sideEffects": false,
"dependencies": {
"@aws-sdk/client-dynamodb": "*",
"@aws-sdk/client-ec2": "*",
"@aws-sdk/client-glacier": "*",
"@aws-sdk/client-rds": "*",
"@aws-sdk/client-route-53": "*",
"@aws-sdk/client-s3": "*",
"@aws-sdk/client-s3-control": "*",
"@aws-sdk/client-sqs": "*",
"@aws-sdk/client-sts": "*",
"@aws-sdk/client-transcribe-streaming": "*",
"@aws-sdk/credential-provider-node": "*",
"@aws-sdk/middleware-bucket-endpoint": "*",
"@aws-sdk/middleware-flexible-checksums": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { describe, test as it, expect } from "vitest";
Copy link
Contributor Author

@kuhe kuhe Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test is a unit test in the context of this package but it is run in the integration test group since it is in the private directory

import { S3 } from "@aws-sdk/client-s3";
import { S3Control } from "@aws-sdk/client-s3-control";
import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { EC2 } from "@aws-sdk/client-ec2";
import { SQS } from "@aws-sdk/client-sqs";
import { Glacier } from "@aws-sdk/client-glacier";
import { STS } from "@aws-sdk/client-sts";
import { TranscribeStreaming } from "@aws-sdk/client-transcribe-streaming";
import { Route53 } from "@aws-sdk/client-route-53";
import { RDS } from "@aws-sdk/client-rds";

describe("client config object custody", () => {
it("should maintain a consistent object reference throughout the client resolver stack lifecycle (the constructor)", () => {
const clients = [
new S3(),
new S3Control(),
new DynamoDB(),
new EC2(),
new Glacier(),
new RDS(),
new Route53(),
new SQS(),
new STS(),
new TranscribeStreaming(),
];
for (const client of clients) {
try {
expect(Object.keys(client.config)).toEqual(Object.keys(client.initConfig ?? {}));
} catch (e) {
throw new Error(`MismatchedObjectKeys - config object custody error for ${client.constructor.name}`);
}

// reference equality assertion
try {
expect(client.config).toBe(client.initConfig);
} catch (e) {
throw new Error(`ReferenceEqualityError - config object custody error for ${client.constructor.name}`);
}
}
});
});
21 changes: 15 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "@aws-sdk/aws-client-api-test@workspace:private/aws-client-api-test"
dependencies:
"@aws-sdk/client-dynamodb": "npm:*"
"@aws-sdk/client-ec2": "npm:*"
"@aws-sdk/client-glacier": "npm:*"
"@aws-sdk/client-rds": "npm:*"
"@aws-sdk/client-route-53": "npm:*"
"@aws-sdk/client-s3": "npm:*"
"@aws-sdk/client-s3-control": "npm:*"
"@aws-sdk/client-sqs": "npm:*"
"@aws-sdk/client-sts": "npm:*"
"@aws-sdk/client-transcribe-streaming": "npm:*"
"@aws-sdk/credential-provider-node": "npm:*"
"@aws-sdk/middleware-bucket-endpoint": "npm:*"
"@aws-sdk/middleware-flexible-checksums": "npm:*"
Expand Down Expand Up @@ -9462,7 +9471,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aws-sdk/client-glacier@workspace:clients/client-glacier":
"@aws-sdk/client-glacier@npm:*, @aws-sdk/client-glacier@workspace:clients/client-glacier":
version: 0.0.0-use.local
resolution: "@aws-sdk/client-glacier@workspace:clients/client-glacier"
dependencies:
Expand Down Expand Up @@ -17209,7 +17218,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aws-sdk/client-rds@workspace:clients/client-rds":
"@aws-sdk/client-rds@npm:*, @aws-sdk/client-rds@workspace:clients/client-rds":
version: 0.0.0-use.local
resolution: "@aws-sdk/client-rds@workspace:clients/client-rds"
dependencies:
Expand Down Expand Up @@ -17957,7 +17966,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aws-sdk/client-route-53@workspace:clients/client-route-53":
"@aws-sdk/client-route-53@npm:*, @aws-sdk/client-route-53@workspace:clients/client-route-53":
version: 0.0.0-use.local
resolution: "@aws-sdk/client-route-53@workspace:clients/client-route-53"
dependencies:
Expand Down Expand Up @@ -20164,7 +20173,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aws-sdk/client-sqs@workspace:clients/client-sqs":
"@aws-sdk/client-sqs@npm:*, @aws-sdk/client-sqs@workspace:clients/client-sqs":
version: 0.0.0-use.local
resolution: "@aws-sdk/client-sqs@workspace:clients/client-sqs"
dependencies:
Expand Down Expand Up @@ -20695,7 +20704,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aws-sdk/client-sts@workspace:clients/client-sts":
"@aws-sdk/client-sts@npm:*, @aws-sdk/client-sts@workspace:clients/client-sts":
version: 0.0.0-use.local
resolution: "@aws-sdk/client-sts@workspace:clients/client-sts"
dependencies:
Expand Down Expand Up @@ -21330,7 +21339,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aws-sdk/client-transcribe-streaming@workspace:clients/client-transcribe-streaming":
"@aws-sdk/client-transcribe-streaming@npm:*, @aws-sdk/client-transcribe-streaming@workspace:clients/client-transcribe-streaming":
version: 0.0.0-use.local
resolution: "@aws-sdk/client-transcribe-streaming@workspace:clients/client-transcribe-streaming"
dependencies:
Expand Down
Loading