Skip to content

Commit 3435c99

Browse files
authored
test: convert some packages unit and e2e tests to vitest (#6584)
1 parent 1902196 commit 3435c99

File tree

135 files changed

+1736
-1391
lines changed

Some content is hidden

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

135 files changed

+1736
-1391
lines changed

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"editor.codeActionsOnSave": {
1111
"source.fixAll.eslint": "explicit"
1212
},
13-
"typescript.tsdk": "node_modules/typescript/lib"
13+
"typescript.tsdk": "node_modules/typescript/lib",
14+
"vitest.disableWorkspaceWarning": true
1415
}

clients/client-ec2/jest.config.js

-5
This file was deleted.

jest.config.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44
* For tests that involve network requests to live services, see jest.config.e2e.js.
55
*/
66
module.exports = {
7-
projects: [
8-
"<rootDir>/lib/*/jest.config.js",
9-
"<rootDir>/private/*/jest.config.js",
10-
"<rootDir>/packages/*/jest.config.js",
11-
],
7+
projects: ["<rootDir>/private/*/jest.config.js", "<rootDir>/packages/*/jest.config.js"],
128
};

lib/lib-dynamodb/jest.config.e2e.js

-5
This file was deleted.

lib/lib-dynamodb/jest.config.js

-5
This file was deleted.

lib/lib-dynamodb/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1515
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
1616
"extract:docs": "api-extractor run --local",
17-
"test": "jest",
18-
"test:e2e": "jest --config jest.config.e2e.js"
17+
"test": "vitest run",
18+
"test:e2e": "vitest run -c vitest.config.e2e.ts",
19+
"test:watch": "vitest watch",
20+
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
1921
},
2022
"engines": {
2123
"node": ">=16.0.0"

lib/lib-dynamodb/src/baseCommand/DynamoDBDocumentClientCommand.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Handler, MiddlewareStack } from "@smithy/types";
2+
import { describe, expect, test as it } from "vitest";
23

34
import { KeyNodeChildren } from "../commands/utils";
45
import { DynamoDBDocumentClientCommand } from "./DynamoDBDocumentClientCommand";
@@ -34,8 +35,7 @@ class AnyCommand extends DynamoDBDocumentClientCommand<{}, {}, {}, {}, {}> {
3435
}
3536

3637
describe("DynamoDBDocumentClientCommand", () => {
37-
// ToDo: Investigate why Jest29 throws TypeError: Class constructor Command cannot be invoked without 'new'
38-
it.skip("should not allow usage of the default middlewareStack", () => {
38+
it("should not allow usage of the default middlewareStack", () => {
3939
const command = new AnyCommand();
4040
command.resolveMiddleware(null as any, null as any, null as any);
4141
{

lib/lib-dynamodb/src/commands/marshallInput.spec.ts

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

35
describe("marshallInput and processObj", () => {

lib/lib-dynamodb/src/commands/utils.spec.ts

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

35
describe("utils", () => {

0 commit comments

Comments
 (0)