Skip to content

Commit

Permalink
test(require): Use vitest in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Feb 11, 2024
1 parent 80f9681 commit d3c0c80
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/require/integration/extensions/__tests__/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import execa, { NodeOptions } from "execa";
import { dirname, join } from "node:path";
import { describe, test, expect } from "vitest";

const testDir = dirname(__dirname);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Node.js CJS > should import CJS file 1`] = `"{"default":{"ext":"mjs"},"ext":"mjs"}"`;

exports[`Node.js CJS > should import JS file in package whose type = commonjs 1`] = `"{"default":{"ext":"js"},"ext":"js"}"`;

exports[`Node.js CJS > should import JS file in package whose type = module 1`] = `"{"ext":"js"}"`;

exports[`Node.js CJS > should import JSON file 1`] = `"{"default":{"ext":"json"}}"`;

exports[`Node.js CJS > should import MJS file 1`] = `"{"ext":"mjs"}"`;

exports[`Node.js CJS > should import MTS file 1`] = `"{"ext":"mts"}"`;

exports[`Node.js CJS > should import TS file in package whose type = module 1`] = `"{"ext":"ts"}"`;

exports[`Node.js CJS should import CJS file 1`] = `"{"default":{"ext":"mjs"},"ext":"mjs"}"`;

Expand All @@ -14,6 +28,20 @@ exports[`Node.js CJS should import MTS file 1`] = `"{"ext":"mts"}"`;

exports[`Node.js CJS should import TS file in package whose type = module 1`] = `"{"ext":"ts"}"`;

exports[`Node.js ESM > should import CJS file 1`] = `"{"default":{"ext":"mjs"},"ext":"mjs"}"`;

exports[`Node.js ESM > should import JS file in package whose type = commonjs 1`] = `"{"default":{"ext":"js"},"ext":"js"}"`;

exports[`Node.js ESM > should import JS file in package whose type = module 1`] = `"{"ext":"js"}"`;

exports[`Node.js ESM > should import JSON file 1`] = `"{"default":{"ext":"json"}}"`;

exports[`Node.js ESM > should import MJS file 1`] = `"{"ext":"mjs"}"`;

exports[`Node.js ESM > should import MTS file 1`] = `"{"ext":"mts"}"`;

exports[`Node.js ESM > should import TS file in package whose type = module 1`] = `"{"ext":"ts"}"`;

exports[`Node.js ESM should import CJS file 1`] = `"{"default":{"ext":"mjs"},"ext":"mjs"}"`;

exports[`Node.js ESM should import JS file in package whose type = commonjs 1`] = `"{"default":{"ext":"js"},"ext":"js"}"`;
Expand Down
1 change: 1 addition & 0 deletions packages/require/integration/import/__tests__/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import execa, { NodeOptions } from "execa";
import { dirname, join } from "node:path";
import { describe, test, expect } from "vitest";

const testDir = dirname(__dirname);

Expand Down
3 changes: 0 additions & 3 deletions packages/require/integration/jest.config.js

This file was deleted.

4 changes: 3 additions & 1 deletion packages/require/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
"@kosko/build-scripts": "workspace:^",
"@kosko/jest-preset": "workspace:^",
"@kosko/test-utils": "workspace:^",
"@kosko/vitest-config": "workspace:^",
"@types/node": "^18.11.9",
"execa": "^5.1.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vitest": "^1.2.2"
},
"jest": {
"preset": "@kosko/jest-preset"
Expand Down
1 change: 1 addition & 0 deletions packages/require/vitest.config.integration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { integration as default } from "@kosko/vitest-config";
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3c0c80

Please sign in to comment.