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

chore: migrate normal cases #6336

Merged
merged 3 commits into from
Apr 24, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion packages/rspack-test-tools/jest.config.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
"<rootDir>/tests/Defaults.unittest.js",
"<rootDir>/tests/Stats.unittest.js",
"<rootDir>/tests/TreeShaking.test.js",
"<rootDir>/tests/ConfigTestCases.basictest.js"
"<rootDir>/tests/ConfigTestCases.basictest.js",
"<rootDir>/tests/TestCasesNormal.basictest.js"
]
};
1 change: 1 addition & 0 deletions packages/rspack-test-tools/jest.config.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
"Builtin.test.js",
"HotTestStepWeb.test.js",
"ConfigTestCases.basictest.js",
"TestCasesNormal.basictest.js",
".difftest.js"
]
};
2 changes: 1 addition & 1 deletion packages/rspack-test-tools/src/case/normal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const creator = new BasicCaseCreator({
steps: ({ name }) => [
new RspackNormalProcessor({
name,
root: path.resolve(__dirname, "../../../rspack/tests/cases"),
root: path.resolve(__dirname, "../../tests/cases"),
compilerOptions: {}, // do not used in rspack
runable: true
})
Expand Down
11 changes: 0 additions & 11 deletions packages/rspack-test-tools/src/processor/normal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { BasicTaskProcessor } from "./basic";
import path from "path";
import fs from "fs";

const CWD = process.cwd();

export interface IRspackNormalProcessorOptions {
name: string;
root: string;
Expand All @@ -33,15 +31,6 @@ export class RspackNormalProcessor extends BasicTaskProcessor<ECompilerType.Rspa
});
}

async before(context: ITestContext) {
//TODO: remove this
process.chdir(path.resolve(__dirname, "../../../rspack"));
}

async after(context: ITestContext) {
process.chdir(CWD);
}

static defaultOptions({
compilerOptions,
root
Expand Down
6 changes: 3 additions & 3 deletions packages/rspack-test-tools/tests/TestCasesNormal.basictest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const path = require("path");
const { describeByWalk, createNormalCase } = require("..");

const NAME = "TestCases";
const caseDir = path.resolve(__dirname, "../../rspack/tests/cases");
const distDir = path.resolve(__dirname, `../../rspack/tests/js/normal`);
const caseDir = path.resolve(__dirname, "./cases");
const distDir = path.resolve(__dirname, `./js/normal`);

describeByWalk(NAME, caseDir, distDir, (name, src, dist) => {
createNormalCase(name, src, dist, path.resolve(__dirname, "../../rspack"));
createNormalCase(name, src, dist);
});
Loading
Loading