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

Lines changed: 0 additions & 5 deletions
This file was deleted.

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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 0 additions & 5 deletions
This file was deleted.

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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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)
Lines changed: 10 additions & 0 deletions
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

Lines changed: 0 additions & 4 deletions
This file was deleted.

private/aws-echo-service/package.json

Lines changed: 1 addition & 2 deletions
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",

0 commit comments

Comments
 (0)