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: 🤖 webpack test case #2544

Merged
merged 17 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: 🤖 remove test code
  • Loading branch information
IWANABETHATGUY committed Mar 30, 2023
commit 98e9a744a6495277c0e73d649d9a7989ff06b3ec
19 changes: 0 additions & 19 deletions packages/rspack/src/config/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,6 @@ function getRawResolve(resolve: Resolve): RawOptions["resolve"] {

function getRawOutput(output: OutputNormalized): RawOptions["output"] {
const wasmLoading = output.wasmLoading!;
assert(
!isNil(output.path) &&
!isNil(output.publicPath) &&
!isNil(output.assetModuleFilename) &&
!isNil(output.filename) &&
!isNil(output.chunkFilename) &&
!isNil(output.cssFilename) &&
!isNil(output.cssChunkFilename) &&
!isNil(output.uniqueName) &&
!isNil(output.enabledLibraryTypes) &&
!isNil(output.strictModuleErrorHandling) &&
!isNil(output.globalObject) &&
!isNil(output.importFunctionName) &&
!isNil(output.module) &&
!isNil(output.iife) &&
!isNil(output.importFunctionName) &&
!isNil(output.webassemblyModuleFilename),
"fields should not be nil after defaults"
);
return {
path: output.path!,
publicPath: output.publicPath!,
Expand Down
30 changes: 13 additions & 17 deletions webpack-test/ConfigTestCases.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const categories = fs.readdirSync(casesPath).map(cat => {
return {
name: cat,
tests: fs
.readdirSync(path.join(casesPath, cat)).filter(folder => !folder.startsWith("_"))
.readdirSync(path.join(casesPath, cat))
.filter(folder => !folder.startsWith("_"))
.sort()
};
});
Expand All @@ -37,14 +38,14 @@ const createLogger = appendTarget => {
info: l => appendTarget.push(l),
warn: console.warn.bind(console),
error: console.error.bind(console),
logTime: () => { },
group: () => { },
groupCollapsed: () => { },
groupEnd: () => { },
profile: () => { },
profileEnd: () => { },
clear: () => { },
status: () => { }
logTime: () => {},
group: () => {},
groupCollapsed: () => {},
groupEnd: () => {},
profile: () => {},
profileEnd: () => {},
clear: () => {},
status: () => {}
};
};

Expand All @@ -58,22 +59,18 @@ const describeCases = config => {
stderr.restore();
});
jest.setTimeout(20000);
let count = 0;

for (const category of categories) {
// eslint-disable-next-line no-loop-func
describe(category.name, () => {
for (const testName of category.tests) {
if (count > 0) {
continue;
}
count++;
// eslint-disable-next-line no-loop-func
describe(testName, function() {
describe(testName, function () {
const testDirectory = path.join(casesPath, category.name, testName);
const filterPath = path.join(testDirectory, "test.filter.js");
if (fs.existsSync(filterPath) && !require(filterPath)()) {
describe.skip(testName, () => {
it("filtered", () => { });
it("filtered", () => {});
});
return;
}
Expand Down Expand Up @@ -704,7 +701,6 @@ const describeCases = config => {
handleFatalError(e, done);
}
} else {
console.log(options)
let compiler = rspack(options, onCompiled);
}
}, 30000);
Expand Down