Skip to content

Commit

Permalink
test(cli): Node env has been injected, no need to simulate esm.
Browse files Browse the repository at this point in the history
  • Loading branch information
molvqingtai committed May 27, 2023
1 parent 13fd6e3 commit 001758e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/rspack-cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const config = {
preset: "ts-jest",
// testEnvironment: "../../scripts/test/patch-node-env.cjs",
testEnvironment: "../../scripts/test/patch-node-env.cjs",
testTimeout: process.env.CI ? 120000 : 30000,
testMatch: ["<rootDir>/tests/**/*.test.ts", "<rootDir>/tests/**/*.test.js"],
watchPathIgnorePatterns: ["<rootDir>/tests/.*/dist"],
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-cli/tests/build/basic/entry.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import url from "url";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
// import url from "url";
// const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
export default {
context: __dirname,
mode: "development",
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-cli/tests/build/config/esm/rspack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// import { fileURLToPath } from "node:url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
// const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
mode: "production",
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-cli/tests/build/config/esm/rspack.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// import { fileURLToPath } from "node:url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
// const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
mode: "production",
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-cli/tests/build/config/esm/rspack.config.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// import { fileURLToPath } from "node:url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
// const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
mode: "production",
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-cli/tests/build/config/esm/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// import { fileURLToPath } from "node:url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
// const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
mode: "production",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import packageA_deps from "./packageA/index";
import packageB_deps from "./packageB/index";

import path from "node:path";
import { fileURLToPath } from "node:url";
// import { fileURLToPath } from "node:url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
// const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
mode: "production",
Expand Down

0 comments on commit 001758e

Please sign in to comment.