Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: convert some packages unit and e2e tests to vitest #6584

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one benefit shown here, it works around certain Jest problems

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
Loading