-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
2,859 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/rspack-test-tools/tests/NewCodeSplitting-config.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const path = require("path"); | ||
const { describeByWalk, createConfigNewCodeSplittingCase } = require(".."); | ||
|
||
function v(name) { | ||
return path.join(__dirname, `new-code-splitting ${name}`) | ||
} | ||
|
||
// Run tests rspack-test-tools/tests/configCases | ||
describeByWalk("new-code-splitting config cases", (name, src, dist) => { | ||
createConfigNewCodeSplittingCase(name, src, dist); | ||
}, { | ||
source: path.resolve(__dirname, "./configCases"), | ||
dist: path.resolve(__dirname, `./js/new-code-splitting-config`), | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/rspack-test-tools/tests/NewCodeSplitting-stats-api.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const path = require("path"); | ||
const { describeByWalk, createStatsAPINewCodeSplittingCase } = require(".."); | ||
|
||
describeByWalk(path.resolve(__dirname, 'statsAPI'), (name, testConfig, dist) => { | ||
createStatsAPINewCodeSplittingCase(name, __dirname, "none", testConfig); | ||
}, { | ||
absoluteDist: false, | ||
level: 1, | ||
type: "file", | ||
dist: path.resolve(__dirname, `./js/new-code-splitting-stats-api`), | ||
}); |
27 changes: 27 additions & 0 deletions
27
packages/rspack-test-tools/tests/NewCodeSplitting-stats-output.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const path = require("path"); | ||
const { describeByWalk, StatsProcessor, BasicCaseCreator, ECompilerType } = require(".."); | ||
|
||
const creator = new BasicCaseCreator({ | ||
clean: true, | ||
describe: false, | ||
steps: ({ name }) => [ | ||
new StatsProcessor({ | ||
name, | ||
compilerType: ECompilerType.Rspack, | ||
configFiles: ["rspack.config.js", "webpack.config.js"], | ||
overrideOptions(index, context, options) { | ||
options.experiments ??= {}; | ||
options.experiments.parallelCodeSplitting ??= true; | ||
return StatsProcessor.overrideOptions(index, context, options); | ||
} | ||
}) | ||
], | ||
description: () => "should print correct stats for" | ||
}); | ||
|
||
describeByWalk(path.resolve(__dirname, 'statsOutput'), (name, src, dist) => { | ||
creator.create(name, src, dist); | ||
}, { | ||
level: 1, | ||
dist: path.resolve(__dirname, `./js/new-code-splitting-stats-output`), | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.