Skip to content

Commit 443388f

Browse files
committed
test(clients): add more snapshot clients
1 parent 76acdb5 commit 443388f

File tree

164 files changed

+3593
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+3593
-121
lines changed

clients/client-appconfigdata/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
1313
"extract:docs": "api-extractor run --local",
1414
"generate:client": "node ../../scripts/generate-clients/single-service --solo appconfigdata",
15-
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"
15+
"test": "yarn g:vitest run --passWithNoTests",
16+
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs",
17+
"test:integration": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
18+
"test:integration:watch": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
19+
"test:watch": "yarn g:vitest watch --passWithNoTests"
1620
},
1721
"main": "./dist-cjs/index.js",
1822
"types": "./dist-types/index.d.ts",
@@ -61,12 +65,14 @@
6165
"tslib": "^2.6.2"
6266
},
6367
"devDependencies": {
68+
"@smithy/snapshot-testing": "^1.0.7",
6469
"@tsconfig/node20": "20.1.8",
6570
"@types/node": "^20.14.8",
6671
"concurrently": "7.0.0",
6772
"downlevel-dts": "0.10.1",
6873
"premove": "4.0.0",
69-
"typescript": "~5.8.3"
74+
"typescript": "~5.8.3",
75+
"vitest": "^4.0.17"
7076
},
7177
"engines": {
7278
"node": ">=20.0.0"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// smithy-typescript generated code
2+
import { SnapshotRunner } from "@smithy/snapshot-testing";
3+
import { join } from "node:path";
4+
import { describe, expect, test as it, vi } from "vitest";
5+
6+
import {
7+
AppConfigDataClient,
8+
GetLatestConfiguration$,
9+
GetLatestConfigurationCommand,
10+
StartConfigurationSession$,
11+
StartConfigurationSessionCommand,
12+
} from "../src";
13+
14+
vi.setSystemTime(new Date(946702799999));
15+
const Client = AppConfigDataClient;
16+
17+
const mode = (process.env.SNAPSHOT_MODE as "write" | "compare") ?? "write";
18+
19+
describe(
20+
"AppConfigDataClient" + ` (${mode})`,
21+
() => {
22+
const runner = new SnapshotRunner({
23+
snapshotDirPath: join(__dirname, "snapshots"),
24+
Client,
25+
mode,
26+
testCase(caseName: string, run: () => Promise<void>) {
27+
it(caseName, run);
28+
},
29+
assertions(caseName: string, expected: string, actual: string): Promise<void> {
30+
expect(actual).toEqual(expected);
31+
return Promise.resolve();
32+
},
33+
schemas: new Map<any, any>([
34+
[GetLatestConfiguration$, GetLatestConfigurationCommand],
35+
[StartConfigurationSession$, StartConfigurationSessionCommand],
36+
]),
37+
});
38+
39+
runner.run();
40+
},
41+
30_000
42+
);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
GET https://appconfigdata.us-east-1.amazonaws.com
2+
/configuration?configuration_token=__ConfigurationToken__
3+
4+
x-amz-user-agent: aws-sdk-js/3.___._
5+
user-agent: aws-sdk-js/3.___._ ua/2.1 lang/js md/nodejs#_.__ api/appconfigdata#_.__ m/E,e
6+
host: appconfigdata.us-east-1.amazonaws.com
7+
amz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111
8+
amz-sdk-request: attempt=1; max=3
9+
x-amz-date: 19991231T235959Z
10+
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
11+
authorization: AWS4-HMAC-SHA256 Credential=***/19991231/us-east-1/appconfig/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=***
12+
13+
[no body]
14+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
POST https://appconfigdata.us-east-1.amazonaws.com
2+
/configurationsessions
3+
4+
content-type: application/json
5+
content-length: 216
6+
x-amz-user-agent: aws-sdk-js/3.___._
7+
user-agent: aws-sdk-js/3.___._ ua/2.1 lang/js md/nodejs#_.__ api/appconfigdata#_.__ m/E,e
8+
host: appconfigdata.us-east-1.amazonaws.com
9+
amz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111
10+
amz-sdk-request: attempt=1; max=3
11+
x-amz-date: 19991231T235959Z
12+
x-amz-content-sha256: 69cbe1ca2e7167c598a03db44f0ef0615d5fa57f7235bb15b8f1392a850b72d7
13+
authorization: AWS4-HMAC-SHA256 Credential=***/19991231/us-east-1/appconfig/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=***
14+
15+
[string (json)]
16+
{
17+
"ApplicationIdentifier": "__ApplicationIdentifier__",
18+
"EnvironmentIdentifier": "__EnvironmentIdentifier__",
19+
"ConfigurationProfileIdentifier": "__ConfigurationProfileIdentifier__",
20+
"RequiredMinimumPollIntervalInSeconds": 0
21+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
include: ["**/*.integ.spec.ts"],
6+
environment: "node",
7+
},
8+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
globals: true,
8+
},
9+
});

clients/client-bedrock-runtime/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
1313
"extract:docs": "api-extractor run --local",
1414
"generate:client": "node ../../scripts/generate-clients/single-service --solo bedrock-runtime",
15-
"test": "yarn dlx vitest run --passWithNoTests",
15+
"test": "yarn g:vitest run --passWithNoTests",
1616
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs",
17-
"test:integration": "yarn dlx vitest run --passWithNoTests -c vitest.config.integ.mts",
18-
"test:integration:watch": "yarn dlx vitest run --passWithNoTests -c vitest.config.integ.mts",
19-
"test:watch": "yarn dlx vitest watch --passWithNoTests"
17+
"test:integration": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
18+
"test:integration:watch": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
19+
"test:watch": "yarn g:vitest watch --passWithNoTests"
2020
},
2121
"main": "./dist-cjs/index.js",
2222
"types": "./dist-types/index.d.ts",
@@ -72,7 +72,7 @@
7272
"tslib": "^2.6.2"
7373
},
7474
"devDependencies": {
75-
"@smithy/snapshot-testing": "^1.0.6",
75+
"@smithy/snapshot-testing": "^1.0.7",
7676
"@tsconfig/node20": "20.1.8",
7777
"@types/node": "^20.14.8",
7878
"concurrently": "7.0.0",

clients/client-cloudwatch-logs/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
1313
"extract:docs": "api-extractor run --local",
1414
"generate:client": "node ../../scripts/generate-clients/single-service --solo cloudwatch-logs",
15-
"test": "yarn dlx vitest run --passWithNoTests",
15+
"test": "yarn g:vitest run --passWithNoTests",
1616
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts",
1717
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts",
1818
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs",
19-
"test:integration": "yarn dlx vitest run --passWithNoTests -c vitest.config.integ.mts",
20-
"test:integration:watch": "yarn dlx vitest run --passWithNoTests -c vitest.config.integ.mts",
21-
"test:watch": "yarn dlx vitest watch --passWithNoTests"
19+
"test:integration": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
20+
"test:integration:watch": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
21+
"test:watch": "yarn g:vitest watch --passWithNoTests"
2222
},
2323
"main": "./dist-cjs/index.js",
2424
"types": "./dist-types/index.d.ts",
@@ -69,7 +69,7 @@
6969
"tslib": "^2.6.2"
7070
},
7171
"devDependencies": {
72-
"@smithy/snapshot-testing": "^1.0.6",
72+
"@smithy/snapshot-testing": "^1.0.7",
7373
"@tsconfig/node20": "20.1.8",
7474
"@types/node": "^20.14.8",
7575
"concurrently": "7.0.0",

clients/client-cloudwatch/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
1313
"extract:docs": "api-extractor run --local",
1414
"generate:client": "node ../../scripts/generate-clients/single-service --solo cloudwatch",
15-
"test": "yarn dlx vitest run --passWithNoTests",
15+
"test": "yarn g:vitest run --passWithNoTests",
1616
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts",
1717
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts",
1818
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs",
19-
"test:integration": "yarn dlx vitest run --passWithNoTests -c vitest.config.integ.mts",
20-
"test:integration:watch": "yarn dlx vitest run --passWithNoTests -c vitest.config.integ.mts",
21-
"test:watch": "yarn dlx vitest watch --passWithNoTests"
19+
"test:integration": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
20+
"test:integration:watch": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
21+
"test:watch": "yarn g:vitest watch --passWithNoTests"
2222
},
2323
"main": "./dist-cjs/index.js",
2424
"types": "./dist-types/index.d.ts",
@@ -68,7 +68,7 @@
6868
"tslib": "^2.6.2"
6969
},
7070
"devDependencies": {
71-
"@smithy/snapshot-testing": "^1.0.6",
71+
"@smithy/snapshot-testing": "^1.0.7",
7272
"@tsconfig/node20": "20.1.8",
7373
"@types/node": "^20.14.8",
7474
"concurrently": "7.0.0",

clients/client-cognito-identity/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@
1212
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
1313
"extract:docs": "api-extractor run --local",
1414
"generate:client": "node ../../scripts/generate-clients/single-service --solo cognito-identity",
15+
"test": "yarn g:vitest run --passWithNoTests",
1516
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts --mode development",
1617
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts",
17-
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"
18+
"test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs",
19+
"test:integration": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
20+
"test:integration:watch": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts",
21+
"test:watch": "yarn g:vitest watch --passWithNoTests"
1822
},
1923
"main": "./dist-cjs/index.js",
2024
"types": "./dist-types/index.d.ts",
@@ -63,13 +67,15 @@
6367
},
6468
"devDependencies": {
6569
"@aws-sdk/client-iam": "workspace:3.998.0",
70+
"@smithy/snapshot-testing": "^1.0.7",
6671
"@tsconfig/node20": "20.1.8",
6772
"@types/chai": "^4.2.11",
6873
"@types/node": "^20.14.8",
6974
"concurrently": "7.0.0",
7075
"downlevel-dts": "0.10.1",
7176
"premove": "4.0.0",
72-
"typescript": "~5.8.3"
77+
"typescript": "~5.8.3",
78+
"vitest": "^4.0.17"
7379
},
7480
"engines": {
7581
"node": ">=20.0.0"

0 commit comments

Comments
 (0)