Skip to content

Commit 38debde

Browse files
authored
test: convert private packages to vitest (#6587)
* test: conversions to vitest * fix: compilation fixes for clients * test: private tests to vitest * chore: update vitest script * test: private packages to vitest * test: there are no tests in echo service
1 parent 9a56eba commit 38debde

File tree

67 files changed

+260
-220
lines changed

Some content is hidden

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

67 files changed

+260
-220
lines changed

private/aws-client-api-test/jest.config.js

-5
This file was deleted.

private/aws-client-api-test/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",

private/aws-client-api-test/src/client-interface-tests/client-s3/ClientS3InterfaceTest.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { test as it, describe, expect } from "vitest";
2+
13
import { ClientS3InterfaceTest } from "./ClientS3InterfaceTest";
24
import { RESOLVED_FIELDS } from "./RESOLVED_FIELDS";
35

private/aws-middleware-test/vitest.config.ts renamed to private/aws-client-api-test/vitest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export default defineConfig({
55
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
66
include: ["**/*.spec.ts"],
77
environment: "node",
8+
globals: true,
89
},
910
});

private/aws-client-retry-test/jest.config.js

-5
This file was deleted.

private/aws-client-retry-test/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",

private/aws-client-retry-test/src/ClientRetryTest.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { HttpHandler, HttpResponse } from "@smithy/protocol-http";
33
import { AwsCredentialIdentity, RequestHandlerOutput } from "@smithy/types";
44
import { ConfiguredRetryStrategy, StandardRetryStrategy } from "@smithy/util-retry";
55
import { Readable } from "stream";
6+
import { describe, expect, test as it, vi } from "vitest";
67

78
const MOCK_REGION = "us-west-2";
89

@@ -64,7 +65,7 @@ describe("util-retry integration tests", () => {
6465
});
6566

6667
it("should retry until success", async () => {
67-
const mockHandle = jest
68+
const mockHandle = vi
6869
.fn()
6970
.mockResolvedValueOnce(mockThrottled)
7071
.mockResolvedValueOnce(mockThrottled)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-echo-service/jest.config.js

-4
This file was deleted.

private/aws-echo-service/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
12-
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
12+
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo"
1413
},
1514
"main": "./dist-cjs/index.js",
1615
"types": "./dist-types/index.d.ts",

private/aws-middleware-test/src/middleware-apply-body-checksum.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { test as it, describe, expect } from "vitest";
2+
13
import { S3Control } from "@aws-sdk/client-s3-control";
2-
import { describe, expect, test as it } from "vitest";
34

45
import { requireRequestsFrom } from "../../aws-util-test/src";
56

private/aws-middleware-test/src/middleware-content-length.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { test as it, describe, expect } from "vitest";
2+
13
import { AccessAnalyzer } from "@aws-sdk/client-accessanalyzer";
24
import { S3 } from "@aws-sdk/client-s3";
35
import { XRay } from "@aws-sdk/client-xray";
4-
import { describe, expect, test as it } from "vitest";
56

67
import { requireRequestsFrom } from "../../../private/aws-util-test/src";
78

private/aws-middleware-test/src/middleware-endpoint.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { test as it, describe, expect } from "vitest";
2+
13
import { S3 } from "@aws-sdk/client-s3";
24
import { S3Control } from "@aws-sdk/client-s3-control";
3-
import { describe, expect, test as it } from "vitest";
45

56
import { requireRequestsFrom } from "../../aws-util-test/src";
67

private/aws-middleware-test/src/middleware-retry.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { test as it, describe, expect } from "vitest";
2+
13
import { Lambda } from "@aws-sdk/client-lambda";
2-
import { describe, expect, test as it } from "vitest";
34

45
import { requireRequestsFrom } from "../../aws-util-test/src";
56

private/aws-middleware-test/src/middleware-serde.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { test as it, describe } from "vitest";
2+
13
import { EC2 } from "@aws-sdk/client-ec2";
24
import { S3 } from "@aws-sdk/client-s3";
35
import { SageMaker } from "@aws-sdk/client-sagemaker";
46
import { SageMakerRuntime } from "@aws-sdk/client-sagemaker-runtime";
5-
import { describe, test as it } from "vitest";
67

78
import { requireRequestsFrom } from "../../aws-util-test/src";
89

private/aws-middleware-test/src/util-stream.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { test as it, describe, expect } from "vitest";
2+
13
import { Lambda } from "@aws-sdk/client-lambda";
24
import { HttpHandler, HttpResponse } from "@smithy/protocol-http";
35
import { HttpRequest as IHttpRequest } from "@smithy/types";
46
import { Uint8ArrayBlobAdapter } from "@smithy/util-stream";
57
import { fromUtf8 } from "@smithy/util-utf8";
68
import { Readable } from "stream";
7-
import { describe, expect, test as it } from "vitest";
89

910
import { requireRequestsFrom } from "../../aws-util-test/src";
1011

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-ec2/README.md

+1-1

private/aws-protocoltests-ec2/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-ec2/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-json-10/README.md

+1-1

private/aws-protocoltests-json-10/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-json-10/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-json-machinelearning/README.md

+1-1

private/aws-protocoltests-json-machinelearning/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-json-machinelearning/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-json/README.md

+1-1

private/aws-protocoltests-json/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-json/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-query/README.md

+1-1

private/aws-protocoltests-query/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-query/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-restjson-apigateway/README.md

+1-1

private/aws-protocoltests-restjson-apigateway/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-restjson-apigateway/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
6+
include: ["**/*.spec.ts"],
7+
environment: "node",
8+
globals: true,
9+
},
10+
});

private/aws-protocoltests-restjson-glacier/README.md

+1-1

private/aws-protocoltests-restjson-glacier/jest.config.js

-5
This file was deleted.

private/aws-protocoltests-restjson-glacier/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build:types": "tsc -p tsconfig.types.json",
1111
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1212
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
13-
"test": "jest --coverage --passWithNoTests"
13+
"test": "vitest run",
14+
"test:watch": "vitest watch"
1415
},
1516
"main": "./dist-cjs/index.js",
1617
"types": "./dist-types/index.d.ts",

0 commit comments

Comments
 (0)