From d97255efad1747ac0ffbed30dd6ca9a803ef693f Mon Sep 17 00:00:00 2001 From: jserfeng <1114550440@qq.com> Date: Mon, 16 Oct 2023 21:31:33 +0800 Subject: [PATCH] chore: align webpack tests --- webpack-test/ConfigTestCases.template.js | 3 ++- .../configCases/split-chunks/asnyc-entries/test.filter.js | 8 +------- .../chunk-filename-delimiter-default/test.filter.js | 2 +- .../split-chunks/chunk-filename-delimiter/test.filter.js | 2 +- .../split-chunks/custom-filename-function/test.filter.js | 2 +- .../custom-filename-many-custom/test.filter.js | 1 - .../split-chunks/custom-filename/test.filter.js | 1 - .../split-chunks/entry-point-error/test.filter.js | 2 +- .../split-chunks/incorrect-chunk-reuse/test.filter.js | 1 - .../configCases/split-chunks/issue-11337/test.filter.js | 1 - .../configCases/split-chunks/issue-11513/test.filter.js | 2 +- .../configCases/split-chunks/issue-12307/test.filter.js | 1 - .../configCases/split-chunks/issue-8908/test.filter.js | 1 - .../configCases/split-chunks/issue-9491/test.filter.js | 1 - .../split-chunks/max-size-casing/test.filter.js | 1 - .../split-chunks/module-type-filter/test.filter.js | 1 - .../split-chunks/move-to-entrypoint/test.filter.js | 2 +- .../configCases/split-chunks/no-options/test.filter.js | 2 +- .../split-chunks/reuse-chunk-name/test.filter.js | 1 - .../split-chunks/runtime-chunk-async-node/test.filter.js | 2 +- .../split-chunks/runtime-chunk-no-async/test.filter.js | 1 - .../split-chunks/runtime-chunk-node-13130/test.filter.js | 2 +- .../split-chunks/runtime-chunk-node/test.filter.js | 2 +- .../configCases/split-chunks/runtime-chunk/test.filter.js | 4 +++- .../vendor-only-entrypoint/node_modules/vendor.js | 3 +++ .../split-chunks/vendor-only-entrypoint/test.filter.js | 1 - 26 files changed, 19 insertions(+), 31 deletions(-) delete mode 100644 webpack-test/configCases/split-chunks/custom-filename-many-custom/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/custom-filename/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/incorrect-chunk-reuse/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/issue-11337/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/issue-12307/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/issue-8908/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/issue-9491/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/max-size-casing/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/module-type-filter/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/reuse-chunk-name/test.filter.js delete mode 100644 webpack-test/configCases/split-chunks/runtime-chunk-no-async/test.filter.js create mode 100644 webpack-test/configCases/split-chunks/vendor-only-entrypoint/node_modules/vendor.js delete mode 100644 webpack-test/configCases/split-chunks/vendor-only-entrypoint/test.filter.js diff --git a/webpack-test/ConfigTestCases.template.js b/webpack-test/ConfigTestCases.template.js index efb9ff817765..8704c16dbd94 100644 --- a/webpack-test/ConfigTestCases.template.js +++ b/webpack-test/ConfigTestCases.template.js @@ -21,7 +21,8 @@ const filterInfraStructureErrors = require("./helpers/infrastructureLogErrors"); const { normalizeFilteredTestName } = require('./lib/util/filterUtil') const casesPath = path.join(__dirname, "configCases"); -const categories = fs.readdirSync(casesPath).map(cat => { +const categories = fs.readdirSync(casesPath) + .map(cat => { return { name: cat, tests: fs diff --git a/webpack-test/configCases/split-chunks/asnyc-entries/test.filter.js b/webpack-test/configCases/split-chunks/asnyc-entries/test.filter.js index 3f6880967322..ea561e9f59ec 100644 --- a/webpack-test/configCases/split-chunks/asnyc-entries/test.filter.js +++ b/webpack-test/configCases/split-chunks/asnyc-entries/test.filter.js @@ -1,7 +1 @@ -// var supportsWorker = require("../../../helpers/supportsWorker"); - -// module.exports = function (config) { -// return supportsWorker(); -// }; - -module.exports = () => {return false} +module.exports = () => 'block by treeshaking issue https://github.com/web-infra-dev/rspack/issues/4336' diff --git a/webpack-test/configCases/split-chunks/chunk-filename-delimiter-default/test.filter.js b/webpack-test/configCases/split-chunks/chunk-filename-delimiter-default/test.filter.js index 3be456dcd23c..f4c052d5c9de 100644 --- a/webpack-test/configCases/split-chunks/chunk-filename-delimiter-default/test.filter.js +++ b/webpack-test/configCases/split-chunks/chunk-filename-delimiter-default/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'splitted chunk ids should be the same as webpack' diff --git a/webpack-test/configCases/split-chunks/chunk-filename-delimiter/test.filter.js b/webpack-test/configCases/split-chunks/chunk-filename-delimiter/test.filter.js index 3be456dcd23c..93e69f850bfc 100644 --- a/webpack-test/configCases/split-chunks/chunk-filename-delimiter/test.filter.js +++ b/webpack-test/configCases/split-chunks/chunk-filename-delimiter/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'not support automaticNameDelimiter' diff --git a/webpack-test/configCases/split-chunks/custom-filename-function/test.filter.js b/webpack-test/configCases/split-chunks/custom-filename-function/test.filter.js index 3be456dcd23c..4809879b8dc9 100644 --- a/webpack-test/configCases/split-chunks/custom-filename-function/test.filter.js +++ b/webpack-test/configCases/split-chunks/custom-filename-function/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'not support function type of splitChunks' diff --git a/webpack-test/configCases/split-chunks/custom-filename-many-custom/test.filter.js b/webpack-test/configCases/split-chunks/custom-filename-many-custom/test.filter.js deleted file mode 100644 index 3be456dcd23c..000000000000 --- a/webpack-test/configCases/split-chunks/custom-filename-many-custom/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => {return false} \ No newline at end of file diff --git a/webpack-test/configCases/split-chunks/custom-filename/test.filter.js b/webpack-test/configCases/split-chunks/custom-filename/test.filter.js deleted file mode 100644 index 3be456dcd23c..000000000000 --- a/webpack-test/configCases/split-chunks/custom-filename/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => {return false} \ No newline at end of file diff --git a/webpack-test/configCases/split-chunks/entry-point-error/test.filter.js b/webpack-test/configCases/split-chunks/entry-point-error/test.filter.js index 3be456dcd23c..caf6ba1ec5ac 100644 --- a/webpack-test/configCases/split-chunks/entry-point-error/test.filter.js +++ b/webpack-test/configCases/split-chunks/entry-point-error/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'should emit error if entry point and splitted chunk have the same name' diff --git a/webpack-test/configCases/split-chunks/incorrect-chunk-reuse/test.filter.js b/webpack-test/configCases/split-chunks/incorrect-chunk-reuse/test.filter.js deleted file mode 100644 index 3be456dcd23c..000000000000 --- a/webpack-test/configCases/split-chunks/incorrect-chunk-reuse/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => {return false} \ No newline at end of file diff --git a/webpack-test/configCases/split-chunks/issue-11337/test.filter.js b/webpack-test/configCases/split-chunks/issue-11337/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/issue-11337/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/issue-11513/test.filter.js b/webpack-test/configCases/split-chunks/issue-11513/test.filter.js index 3be456dcd23c..0c6c86ddb461 100644 --- a/webpack-test/configCases/split-chunks/issue-11513/test.filter.js +++ b/webpack-test/configCases/split-chunks/issue-11513/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'should support object type minSize' diff --git a/webpack-test/configCases/split-chunks/issue-12307/test.filter.js b/webpack-test/configCases/split-chunks/issue-12307/test.filter.js deleted file mode 100644 index 3be456dcd23c..000000000000 --- a/webpack-test/configCases/split-chunks/issue-12307/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => {return false} \ No newline at end of file diff --git a/webpack-test/configCases/split-chunks/issue-8908/test.filter.js b/webpack-test/configCases/split-chunks/issue-8908/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/issue-8908/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/issue-9491/test.filter.js b/webpack-test/configCases/split-chunks/issue-9491/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/issue-9491/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/max-size-casing/test.filter.js b/webpack-test/configCases/split-chunks/max-size-casing/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/max-size-casing/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/module-type-filter/test.filter.js b/webpack-test/configCases/split-chunks/module-type-filter/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/module-type-filter/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/move-to-entrypoint/test.filter.js b/webpack-test/configCases/split-chunks/move-to-entrypoint/test.filter.js index 98e4afe76084..cefa79839611 100644 --- a/webpack-test/configCases/split-chunks/move-to-entrypoint/test.filter.js +++ b/webpack-test/configCases/split-chunks/move-to-entrypoint/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} +module.exports = () => 'jest node env blocks' diff --git a/webpack-test/configCases/split-chunks/no-options/test.filter.js b/webpack-test/configCases/split-chunks/no-options/test.filter.js index 3be456dcd23c..80e1f75f7351 100644 --- a/webpack-test/configCases/split-chunks/no-options/test.filter.js +++ b/webpack-test/configCases/split-chunks/no-options/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'no js splitChunks plugin' diff --git a/webpack-test/configCases/split-chunks/reuse-chunk-name/test.filter.js b/webpack-test/configCases/split-chunks/reuse-chunk-name/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/reuse-chunk-name/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/runtime-chunk-async-node/test.filter.js b/webpack-test/configCases/split-chunks/runtime-chunk-async-node/test.filter.js index 3be456dcd23c..d0928319ddd4 100644 --- a/webpack-test/configCases/split-chunks/runtime-chunk-async-node/test.filter.js +++ b/webpack-test/configCases/split-chunks/runtime-chunk-async-node/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => "hang by unknown reasons" diff --git a/webpack-test/configCases/split-chunks/runtime-chunk-no-async/test.filter.js b/webpack-test/configCases/split-chunks/runtime-chunk-no-async/test.filter.js deleted file mode 100644 index 868b3d662338..000000000000 --- a/webpack-test/configCases/split-chunks/runtime-chunk-no-async/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks/runtime-chunk-node-13130/test.filter.js b/webpack-test/configCases/split-chunks/runtime-chunk-node-13130/test.filter.js index 3be456dcd23c..d0928319ddd4 100644 --- a/webpack-test/configCases/split-chunks/runtime-chunk-node-13130/test.filter.js +++ b/webpack-test/configCases/split-chunks/runtime-chunk-node-13130/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => "hang by unknown reasons" diff --git a/webpack-test/configCases/split-chunks/runtime-chunk-node/test.filter.js b/webpack-test/configCases/split-chunks/runtime-chunk-node/test.filter.js index 3be456dcd23c..d0928319ddd4 100644 --- a/webpack-test/configCases/split-chunks/runtime-chunk-node/test.filter.js +++ b/webpack-test/configCases/split-chunks/runtime-chunk-node/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => "hang by unknown reasons" diff --git a/webpack-test/configCases/split-chunks/runtime-chunk/test.filter.js b/webpack-test/configCases/split-chunks/runtime-chunk/test.filter.js index 3be456dcd23c..62a17ff7a221 100644 --- a/webpack-test/configCases/split-chunks/runtime-chunk/test.filter.js +++ b/webpack-test/configCases/split-chunks/runtime-chunk/test.filter.js @@ -1 +1,3 @@ -module.exports = () => {return false} \ No newline at end of file +const { FilteredStatus } = require("../../../lib/util/filterUtil") + +module.exports = () => [FilteredStatus.PARTIAL_PASS, 'not have the same name for splitted chunk with webpack'] diff --git a/webpack-test/configCases/split-chunks/vendor-only-entrypoint/node_modules/vendor.js b/webpack-test/configCases/split-chunks/vendor-only-entrypoint/node_modules/vendor.js new file mode 100644 index 000000000000..2c919ad5ce77 --- /dev/null +++ b/webpack-test/configCases/split-chunks/vendor-only-entrypoint/node_modules/vendor.js @@ -0,0 +1,3 @@ +it("should create only a single chunk", () => { + expect(__STATS__.chunks.length).toBe(2); +}) diff --git a/webpack-test/configCases/split-chunks/vendor-only-entrypoint/test.filter.js b/webpack-test/configCases/split-chunks/vendor-only-entrypoint/test.filter.js deleted file mode 100644 index 3be456dcd23c..000000000000 --- a/webpack-test/configCases/split-chunks/vendor-only-entrypoint/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => {return false} \ No newline at end of file