Skip to content

Commit

Permalink
test: convert unit tests to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 22, 2024
1 parent 1902196 commit 0798656
Show file tree
Hide file tree
Showing 135 changed files with 1,736 additions and 1,391 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"vitest.disableWorkspaceWarning": true
}
5 changes: 0 additions & 5 deletions clients/client-ec2/jest.config.js

This file was deleted.

6 changes: 1 addition & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@
* For tests that involve network requests to live services, see jest.config.e2e.js.
*/
module.exports = {
projects: [
"<rootDir>/lib/*/jest.config.js",
"<rootDir>/private/*/jest.config.js",
"<rootDir>/packages/*/jest.config.js",
],
projects: ["<rootDir>/private/*/jest.config.js", "<rootDir>/packages/*/jest.config.js"],
};
5 changes: 0 additions & 5 deletions lib/lib-dynamodb/jest.config.e2e.js

This file was deleted.

5 changes: 0 additions & 5 deletions lib/lib-dynamodb/jest.config.js

This file was deleted.

6 changes: 4 additions & 2 deletions lib/lib-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "jest",
"test:e2e": "jest --config jest.config.e2e.js"
"test": "vitest run",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:watch": "vitest watch",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
"engines": {
"node": ">=16.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Handler, MiddlewareStack } from "@smithy/types";
import { describe, expect, test as it } from "vitest";

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

describe("DynamoDBDocumentClientCommand", () => {
// ToDo: Investigate why Jest29 throws TypeError: Class constructor Command cannot be invoked without 'new'
it.skip("should not allow usage of the default middlewareStack", () => {
it("should not allow usage of the default middlewareStack", () => {
const command = new AnyCommand();
command.resolveMiddleware(null as any, null as any, null as any);
{
Expand Down
2 changes: 2 additions & 0 deletions lib/lib-dynamodb/src/commands/marshallInput.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, expect, test as it } from "vitest";

import { marshallInput } from "./utils";

describe("marshallInput and processObj", () => {
Expand Down
2 changes: 2 additions & 0 deletions lib/lib-dynamodb/src/commands/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, expect, test as it } from "vitest";

import { marshallInput, unmarshallOutput } from "./utils";

describe("utils", () => {
Expand Down
Loading

0 comments on commit 0798656

Please sign in to comment.