diff --git a/.eslintignore b/.eslintignore index 7810041dfd8..f3afa1defd0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,26 +1,28 @@ -# Ignore node_modules -node_modules +# Ignore some test files +test/**/*.* +!test/*.js +!test/**/webpack.config.js +!test/**/test.config.js +!test/**/test.filter.js +test/cases/parsing/es2022/test.filter.js +!test/**/errors.js +!test/**/warnings.js +!test/**/deprecations.js +!test/helpers/*.* # Ignore some folders benchmark coverage +# Ignore generated files +*.check.js + # Ignore not supported files -!.*.js -.eslintrc.js *.d.ts # Ignore precompiled schemas schemas/**/*.check.js -# Ignore some test files -test/* -!test/*Cases -!test/helpers -!test/*.js -test/*Cases/**/*.js -!test/*Cases/**/webpack.config.js - # Ignore some examples files examples/**/*.js !examples/*/webpack.config.js diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index ba313faa478..b329d1c9d10 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -2,7 +2,7 @@ -**Do you want to request a *feature* or report a *bug*?** +**Do you want to request a _feature_ or report a _bug_?** diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 437637672bb..9a11068c50c 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -15,10 +15,8 @@ about: Create a report to help us improve **What is the current behavior?** - **If the current behavior is a bug, please provide the steps to reproduce.** - @@ -28,12 +26,11 @@ about: Create a report to help us improve **What is the expected behavior?** - **Other relevant information:** webpack version: -Node.js version: -Operating System: +Node.js version: +Operating System: Additional tools: diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index ff728e6db23..704020c0671 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -1,7 +1,6 @@ --- name: Feature request about: Suggest an idea for this project - --- @@ -16,12 +15,9 @@ about: Suggest an idea for this project **What is the expected behavior?** - **What is motivation or use case for adding/changing the behavior?** - **How should this be implemented in your opinion?** - **Are you willing to work on this yourself?** yes diff --git a/.github/ISSUE_TEMPLATE/Other.md b/.github/ISSUE_TEMPLATE/Other.md index 033e88fcad4..5bda12d71f4 100644 --- a/.github/ISSUE_TEMPLATE/Other.md +++ b/.github/ISSUE_TEMPLATE/Other.md @@ -1,7 +1,6 @@ --- name: Other about: Something else - --- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 65357e71dab..c6b24d47388 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,10 +4,14 @@ -## Summary +## Summary + + copilot:summary -## Details +## Details + + copilot:walkthrough diff --git a/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md b/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md index 8967c8f0169..89efe54b7d5 100644 --- a/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md +++ b/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md @@ -2,7 +2,6 @@ - **What kind of change does this PR introduce?** diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9faa3705099..901cd590ef5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,21 @@ version: 2 updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "04:00" - timezone: Europe/Berlin - open-pull-requests-limit: 20 - labels: - - dependencies - versioning-strategy: widen - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: daily - time: "04:00" - timezone: Europe/Berlin - open-pull-requests-limit: 20 - labels: - - dependencies - versioning-strategy: widen + - package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "04:00" + timezone: Europe/Berlin + open-pull-requests-limit: 20 + labels: + - dependencies + versioning-strategy: widen + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily + time: "04:00" + timezone: Europe/Berlin + open-pull-requests-limit: 20 + labels: + - dependencies diff --git a/.prettierignore b/.prettierignore index bf425289bd9..d4343e9f284 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,14 +1,30 @@ package.json -# Ignore test fixtures -test/*.* +# Ignore some test files +test/**/*.* !test/*.js !test/**/webpack.config.js +!test/**/test.config.js +!test/**/test.filter.js +!test/**/errors.js +!test/**/warnings.js !test/**/deprecations.js +!test/*.md +!test/helpers/*.* -# Ignore example fixtures -examples/*.* -!examples/**/webpack.config.js +# Ignore some folders +benchmark/ +coverage/ # Ignore generated files *.check.js + +# Ignore not supported files +*.d.ts + +# Ignore precompiled schemas +schemas/**/*.check.js + +# Ignore example fixtures +examples/ +!examples/**/webpack.config.js diff --git a/assembly/tsconfig.json b/assembly/tsconfig.json index 9cd498ea14e..ec198544982 100644 --- a/assembly/tsconfig.json +++ b/assembly/tsconfig.json @@ -1,6 +1,4 @@ { "extends": "assemblyscript/std/assembly.json", - "include": [ - "./**/*.asm.ts" - ] + "include": ["./**/*.asm.ts"] } diff --git a/package.json b/package.json index 91e38fd525e..7919859b1dc 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "pretest": "yarn lint", "prelint": "yarn setup", "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-test && yarn module-typings-test && yarn yarn-lint && yarn pretty-lint && yarn spellcheck", - "code-lint": "eslint . --ext '.js' --cache", + "code-lint": "eslint --cache .", "type-lint": "tsc", "typings-test": "tsc -p tsconfig.types.test.json", "module-typings-test": "tsc -p tsconfig.module.test.json", @@ -159,9 +159,8 @@ "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write", "fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix", "prepare": "husky install", - "pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"", - "pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"module.d.ts\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"", - "pretty-lint-fix": "yarn pretty-lint-base-all --loglevel warn --write", + "pretty-lint-base": "prettier --cache .", + "pretty-lint-fix": "yarn pretty-lint-base --loglevel warn --write", "pretty-lint": "yarn pretty-lint-base --check", "yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock", "yarn-lint-fix": "yarn-deduplicate -s highest yarn.lock", @@ -179,11 +178,11 @@ "cover:report": "nyc report -t coverage" }, "lint-staged": { - "*.js|{lib,setup,bin,hot,tooling,schemas}/**/*.js|test/*.js|{test,examples}/**/webpack.config.js}": [ - "eslint --cache" + "*.{js,cjs,mjs}": [ + "eslint --cache --fix" ], - "*.{ts,json,yml,yaml,md}|examples/*.md": [ - "prettier --check" + "*": [ + "prettier --cache --ignore-unknown" ], "*.md|{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}": [ "cspell" diff --git a/test/README.md b/test/README.md index 9f07e0b9fef..f460a490b71 100644 --- a/test/README.md +++ b/test/README.md @@ -1,20 +1,25 @@ # Welcome to the webpack test suite!!!! + Every pull request that you submit to webpack (besides README and spelling corrections in comments) requires tests that are created. But don't give up hope!!! Although our tests may appear complex and overwhelming, once you become familiar with the test suite and structure, adding and creating tests will be fun and beneficial as you work inside the codebase! ❤ ## tl;dr + Run all tests (this automatically runs the setup): + ```sh yarn test ``` Run an individual suite: + ```sh yarn jest ConfigTestCases ``` Watch mode: + ```sh yarn jest --watch ConfigTestCases ``` @@ -22,16 +27,20 @@ yarn jest --watch ConfigTestCases See also: [Jest CLI docs](https://jestjs.io/docs/cli) ## Test suite overview + We use Jest for our tests. For more information on Jest you can visit their [homepage](https://jestjs.io/)! ### Class Tests -All test files can be found in *.test.js. There are many tests that simply test APIs of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation). + +All test files can be found in \*.test.js. There are many tests that simply test APIs of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation). If the feature you are contributing involves one of those classes, then best to start there to understand the structure. ### xCases -In addition to Class specific tests, there are also directories that end in "Cases". The suites for these cases also have corresponding *.test.js files. + +In addition to Class specific tests, there are also directories that end in "Cases". The suites for these cases also have corresponding \*.test.js files. #### cases (`TestCases.test.js`) 1 + Cases are a set of general purpose tests that will run against a variety of permutations of webpack configurations. When you are making a general purpose change that doesn't require you to have a special configuration, you would likely add your tests here. Inside of the `./test/cases` directory you will find tests are broken into thematic sub directories. Take a moment to explore the different options. To add a new case, create a new directory inside of the top level test groups, and then add an `index.js` file (and any other supporting files). @@ -39,11 +48,13 @@ To add a new case, create a new directory inside of the top level test groups, a By default this file will be the entry point for the test suite and you can add your `it()`'s there. This will also become bundled so that node env support happens as well. #### configCases (`ConfigTestCases.basictest.js`) 1 + If you are trying to solve a bug which is reproducible when x and y properties are used together in a config, then configCases is the place to be!!!! In addition to an `index.js`, these configCases require a `webpack.config.js` is located inside of your test suite. This will run this specific config through `webpack` just as you were building individually. They will use the same loading/bundling technique of your `it()` tests, however you now have a more specific config use cases that you can write even before you start coding. #### statsCases (`StatsTestCases.basictest.js`) + Stats cases are similar to configCases except specifically focusing on the `expected` output of your stats. Instead of writing to the console, however the output of stats will be written to disk. By default, the "expected" outcome is a pain to write by hand so instead when statsCases are run, runner is checking output using jest's awesome snapshot functionality. @@ -52,21 +63,23 @@ Basically you don't need to write any expected behaviors yourself. The assumptio Please follow the approach described below: -* write your test code in `statsCases/` folder by creating a separate folder for it, for example `statsCases/some-file-import-stats/index.js` +- write your test code in `statsCases/` folder by creating a separate folder for it, for example `statsCases/some-file-import-stats/index.js` ```javascript import("./someModule"); ``` -* don't forget the `webpack.config.js` -* run the test -* jest will automatically add the output from your test code to `StatsTestCases.test.js.snap` and you can always check your results there -* Next time test will run -> runner will compare results against your output written to snapshot previously + +- don't forget the `webpack.config.js` +- run the test +- jest will automatically add the output from your test code to `StatsTestCases.test.js.snap` and you can always check your results there +- Next time test will run -> runner will compare results against your output written to snapshot previously You can read more about SnapShot testing [right here](https://jestjs.io/docs/snapshot-testing) ## Questions? Comments? -If you are still nervous or don't quite understand, please submit an issue and tag us in it, and provide a relevant PR while working on! +If you are still nervous or don't quite understand, please submit an issue and tag us in it, and provide a relevant PR while working on! ## Footnotes + 1 webpack's parser supports the use of ES2015 features like arrow functions, harmony exports, etc. However as a library we follow Node.js' timeline for dropping older versions of node. Because of this we expect your tests on GitHub Actions to pass all the way back to NodeJS v10; Therefore if you would like specific tests that use these features to be ignored if they are not supported, then you should add a `test.filter.js` file. This allows you to import the syntax needed for that test, meanwhile ignoring it on node versions (during CI) that don't support it. webpack has a variety of helpful examples you can refer to if you are just starting out. See the `./helpers` folder to find a list of the versions. diff --git a/test/cases/chunks/runtime/test.filter.js b/test/cases/chunks/runtime/test.filter.js index 3ed2e8ae961..7ba4ada1c94 100644 --- a/test/cases/chunks/runtime/test.filter.js +++ b/test/cases/chunks/runtime/test.filter.js @@ -1,4 +1,4 @@ -module.exports = function(config) { +module.exports = function (config) { // This test can't run in development mode as it depends on the flagIncludedChunks optimization return config.mode !== "development"; }; diff --git a/test/cases/chunks/weird-reference-to-entry/errors.js b/test/cases/chunks/weird-reference-to-entry/errors.js index 5cdd2850ba3..0eda0fbec8e 100644 --- a/test/cases/chunks/weird-reference-to-entry/errors.js +++ b/test/cases/chunks/weird-reference-to-entry/errors.js @@ -1,3 +1,5 @@ module.exports = [ - [/It's not allowed to load an initial chunk on demand\. The chunk name "main" is already used by an entrypoint\./], + [ + /It's not allowed to load an initial chunk on demand\. The chunk name "main" is already used by an entrypoint\./ + ] ]; diff --git a/test/cases/compile/error-hide-stack/errors.js b/test/cases/compile/error-hide-stack/errors.js index 4c65e31d637..6d8bf4df7a7 100644 --- a/test/cases/compile/error-hide-stack/errors.js +++ b/test/cases/compile/error-hide-stack/errors.js @@ -1,6 +1,3 @@ module.exports = [ - [ - /Module build failed( \(from [^)]+\))?:\nMessage/, - {details: /Stack/} - ] + [/Module build failed( \(from [^)]+\))?:\nMessage/, { details: /Stack/ }] ]; diff --git a/test/cases/context/issue-5750/warnings.js b/test/cases/context/issue-5750/warnings.js index 62587ab93e0..957d94c627f 100644 --- a/test/cases/context/issue-5750/warnings.js +++ b/test/cases/context/issue-5750/warnings.js @@ -1,3 +1,3 @@ module.exports = [ - [/Critical dependency: Contexts can't use RegExps with the 'g' or 'y' flags/], + [/Critical dependency: Contexts can't use RegExps with the 'g' or 'y' flags/] ]; diff --git a/test/cases/errors/case-sensitive/test.filter.js b/test/cases/errors/case-sensitive/test.filter.js index 9ae7a5027bc..c3e1f9382ec 100644 --- a/test/cases/errors/case-sensitive/test.filter.js +++ b/test/cases/errors/case-sensitive/test.filter.js @@ -1,6 +1,6 @@ var fs = require("fs"); var path = require("path"); -module.exports = function(config) { +module.exports = function (config) { return fs.existsSync(path.join(__dirname, "TEST.FILTER.JS")); }; diff --git a/test/cases/errors/case-sensitive/warnings.js b/test/cases/errors/case-sensitive/warnings.js index 99ac2e5cf9e..1a2c38230f1 100644 --- a/test/cases/errors/case-sensitive/warnings.js +++ b/test/cases/errors/case-sensitive/warnings.js @@ -1,4 +1,12 @@ module.exports = [ - [/There are multiple modules with names that only differ in casing/, /case-sensitive.A\.js/, /case-sensitive.a\.js/], - [/There are multiple modules with names that only differ in casing/, /case-sensitive.B.file\.js/, /case-sensitive.b.file\.js/] + [ + /There are multiple modules with names that only differ in casing/, + /case-sensitive.A\.js/, + /case-sensitive.a\.js/ + ], + [ + /There are multiple modules with names that only differ in casing/, + /case-sensitive.B.file\.js/, + /case-sensitive.b.file\.js/ + ] ]; diff --git a/test/cases/errors/crash-missing-import/errors.js b/test/cases/errors/crash-missing-import/errors.js index 4eefda428cf..d85236a2c74 100644 --- a/test/cases/errors/crash-missing-import/errors.js +++ b/test/cases/errors/crash-missing-import/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Module not found/], -]; +module.exports = [[/Module not found/]]; diff --git a/test/cases/errors/harmony-import-missing/errors.js b/test/cases/errors/harmony-import-missing/errors.js index 6084546bf7b..baab751255d 100644 --- a/test/cases/errors/harmony-import-missing/errors.js +++ b/test/cases/errors/harmony-import-missing/errors.js @@ -1,5 +1 @@ -module.exports = [ - [ - /Can't resolve '.\/missing'/ - ] -]; +module.exports = [[/Can't resolve '.\/missing'/]]; diff --git a/test/cases/errors/load-module-error/errors.js b/test/cases/errors/load-module-error/errors.js index d2c4b1da922..ce88c1bc32e 100644 --- a/test/cases/errors/load-module-error/errors.js +++ b/test/cases/errors/load-module-error/errors.js @@ -1,8 +1 @@ -module.exports = [ - [ - /err: abc/, - ], - [ - /The loaded module contains errors/, - ], -]; +module.exports = [[/err: abc/], [/The loaded module contains errors/]]; diff --git a/test/cases/errors/loader-error-warning/errors.js b/test/cases/errors/loader-error-warning/errors.js index c5801200e1c..16bfd86a57f 100644 --- a/test/cases/errors/loader-error-warning/errors.js +++ b/test/cases/errors/loader-error-warning/errors.js @@ -1,12 +1,4 @@ module.exports = [ - [ - /abc/, - /Emitted value instead of an instance of Error/, - /error-loader\.js/ - ], - [ - /def/, - /Emitted value instead of an instance of Error/, - /error-loader\.js/ - ] + [/abc/, /Emitted value instead of an instance of Error/, /error-loader\.js/], + [/def/, /Emitted value instead of an instance of Error/, /error-loader\.js/] ]; diff --git a/test/cases/errors/loader-error-warning/warnings.js b/test/cases/errors/loader-error-warning/warnings.js index 82ea0b1dd31..c776962fc05 100644 --- a/test/cases/errors/loader-error-warning/warnings.js +++ b/test/cases/errors/loader-error-warning/warnings.js @@ -1,7 +1,3 @@ module.exports = [ - [ - /xyz/, - /Emitted value instead of an instance of Error/, - /warning-loader\.js/ - ] + [/xyz/, /Emitted value instead of an instance of Error/, /warning-loader\.js/] ]; diff --git a/test/cases/loaders/no-string/errors.js b/test/cases/loaders/no-string/errors.js index 7a3a289d730..79aef6533f4 100644 --- a/test/cases/loaders/no-string/errors.js +++ b/test/cases/loaders/no-string/errors.js @@ -1,10 +1,16 @@ module.exports = [ [ - {moduleName: /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/file\.js/}, + { + moduleName: + /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/file\.js/ + }, /Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/ ], [ - {moduleName: /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/pitch-loader\.js!\.\/loaders\/no-string\/file\.js/}, + { + moduleName: + /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/pitch-loader\.js!\.\/loaders\/no-string\/file\.js/ + }, /Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/ ] ]; diff --git a/test/cases/mjs/namespace-object-lazy/test.filter.js b/test/cases/mjs/namespace-object-lazy/test.filter.js index 2602795eefb..ca08e60111d 100644 --- a/test/cases/mjs/namespace-object-lazy/test.filter.js +++ b/test/cases/mjs/namespace-object-lazy/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return !config.minimize; }; diff --git a/test/cases/mjs/non-mjs-namespace-object-lazy/test.filter.js b/test/cases/mjs/non-mjs-namespace-object-lazy/test.filter.js index 2602795eefb..ca08e60111d 100644 --- a/test/cases/mjs/non-mjs-namespace-object-lazy/test.filter.js +++ b/test/cases/mjs/non-mjs-namespace-object-lazy/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return !config.minimize; }; diff --git a/test/cases/optimize/side-effects-all-chain-unused/test.filter.js b/test/cases/optimize/side-effects-all-chain-unused/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-all-chain-unused/test.filter.js +++ b/test/cases/optimize/side-effects-all-chain-unused/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/optimize/side-effects-all-used/test.filter.js b/test/cases/optimize/side-effects-all-used/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-all-used/test.filter.js +++ b/test/cases/optimize/side-effects-all-used/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/optimize/side-effects-immediate-unused/test.filter.js b/test/cases/optimize/side-effects-immediate-unused/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-immediate-unused/test.filter.js +++ b/test/cases/optimize/side-effects-immediate-unused/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/optimize/side-effects-reexport-start-unknown/test.filter.js b/test/cases/optimize/side-effects-reexport-start-unknown/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-reexport-start-unknown/test.filter.js +++ b/test/cases/optimize/side-effects-reexport-start-unknown/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/optimize/side-effects-root-unused/test.filter.js b/test/cases/optimize/side-effects-root-unused/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-root-unused/test.filter.js +++ b/test/cases/optimize/side-effects-root-unused/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/optimize/side-effects-simple-unused/test.filter.js b/test/cases/optimize/side-effects-simple-unused/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-simple-unused/test.filter.js +++ b/test/cases/optimize/side-effects-simple-unused/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/optimize/side-effects-transitive-unused/test.filter.js b/test/cases/optimize/side-effects-transitive-unused/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/optimize/side-effects-transitive-unused/test.filter.js +++ b/test/cases/optimize/side-effects-transitive-unused/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/parsing/asi/warnings.js b/test/cases/parsing/asi/warnings.js index 79f938e1498..39b26d59cff 100644 --- a/test/cases/parsing/asi/warnings.js +++ b/test/cases/parsing/asi/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/Critical dependency: Accessing import\.meta/] -]; +module.exports = [[/Critical dependency: Accessing import\.meta/]]; diff --git a/test/cases/parsing/es2022/test.filter.js b/test/cases/parsing/es2022/test.filter.js index a26c3793c0b..38c3136db5a 100644 --- a/test/cases/parsing/es2022/test.filter.js +++ b/test/cases/parsing/es2022/test.filter.js @@ -1,4 +1,4 @@ -module.exports = function(config) { +module.exports = function (config) { // terser doesn't support static {} if (config.mode === "production") return false; diff --git a/test/cases/parsing/extract-amd/warnings.js b/test/cases/parsing/extract-amd/warnings.js index aa20932a1d3..418492a70f6 100644 --- a/test/cases/parsing/extract-amd/warnings.js +++ b/test/cases/parsing/extract-amd/warnings.js @@ -1,3 +1,3 @@ module.exports = [ - [/Module not found/, /Can't resolve '\.\/b' /, {details: /b\.js/}] + [/Module not found/, /Can't resolve '\.\/b' /, { details: /b\.js/ }] ]; diff --git a/test/cases/parsing/extract-require/errors.js b/test/cases/parsing/extract-require/errors.js index 576a4be9ecf..cb2596c1104 100644 --- a/test/cases/parsing/extract-require/errors.js +++ b/test/cases/parsing/extract-require/errors.js @@ -1,3 +1,7 @@ module.exports = [ - [/Module not found/, /Can't resolve '\.\/missingModule' /, {moduleName: /extract-require\/index.js/}] + [ + /Module not found/, + /Can't resolve '\.\/missingModule' /, + { moduleName: /extract-require\/index.js/ } + ] ]; diff --git a/test/cases/parsing/harmony-destructuring-assignment/test.filter.js b/test/cases/parsing/harmony-destructuring-assignment/test.filter.js index 181167c763e..f176154b261 100644 --- a/test/cases/parsing/harmony-destructuring-assignment/test.filter.js +++ b/test/cases/parsing/harmony-destructuring-assignment/test.filter.js @@ -1,4 +1,4 @@ -module.exports = function(config) { +module.exports = function (config) { // This test can't run in development mode return config.mode !== "development"; }; diff --git a/test/cases/parsing/harmony-export-precedence/warnings.js b/test/cases/parsing/harmony-export-precedence/warnings.js index c57b3a2cce4..af730a435fd 100644 --- a/test/cases/parsing/harmony-export-precedence/warnings.js +++ b/test/cases/parsing/harmony-export-precedence/warnings.js @@ -1,3 +1,5 @@ module.exports = [ - [/export 'default' \(imported as 'defaultImport'\) was not found in '.\/a' \(possible exports: a, b, c, d, e, f\)/] + [ + /export 'default' \(imported as 'defaultImport'\) was not found in '.\/a' \(possible exports: a, b, c, d, e, f\)/ + ] ]; diff --git a/test/cases/parsing/issue-2006/errors.js b/test/cases/parsing/issue-2006/errors.js index 7936b2e9d73..2b82b710bf3 100644 --- a/test/cases/parsing/issue-2006/errors.js +++ b/test/cases/parsing/issue-2006/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Empty dependency/] -]; \ No newline at end of file +module.exports = [[/Empty dependency/]]; diff --git a/test/cases/parsing/issue-2600/errors.js b/test/cases/parsing/issue-2600/errors.js index 8894d7a69d5..9cd234c7331 100644 --- a/test/cases/parsing/issue-2600/errors.js +++ b/test/cases/parsing/issue-2600/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Can't resolve 'missing'/] -]; \ No newline at end of file +module.exports = [[/Can't resolve 'missing'/]]; diff --git a/test/cases/parsing/issue-2641/errors.js b/test/cases/parsing/issue-2641/errors.js index 01d80f2952d..4c8eabefcdb 100644 --- a/test/cases/parsing/issue-2641/errors.js +++ b/test/cases/parsing/issue-2641/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Module not found/, /Can't resolve '\.\/missingModule' /] -]; +module.exports = [[/Module not found/, /Can't resolve '\.\/missingModule' /]]; diff --git a/test/cases/parsing/issue-627/warnings.js b/test/cases/parsing/issue-627/warnings.js index ea6102af436..f1a4bb46d11 100644 --- a/test/cases/parsing/issue-627/warnings.js +++ b/test/cases/parsing/issue-627/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/Critical dependency/] -]; +module.exports = [[/Critical dependency/]]; diff --git a/test/cases/parsing/issue-7519/test.filter.js b/test/cases/parsing/issue-7519/test.filter.js index 9022ab6415f..49ac5066bb8 100644 --- a/test/cases/parsing/issue-7519/test.filter.js +++ b/test/cases/parsing/issue-7519/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return config.mode !== "development"; }; diff --git a/test/cases/parsing/issue-758/errors.js b/test/cases/parsing/issue-758/errors.js index 01d80f2952d..4c8eabefcdb 100644 --- a/test/cases/parsing/issue-758/errors.js +++ b/test/cases/parsing/issue-758/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Module not found/, /Can't resolve '\.\/missingModule' /] -]; +module.exports = [[/Module not found/, /Can't resolve '\.\/missingModule' /]]; diff --git a/test/cases/parsing/logical-assignment/test.filter.js b/test/cases/parsing/logical-assignment/test.filter.js index cecf771eddb..52cd61a8efe 100644 --- a/test/cases/parsing/logical-assignment/test.filter.js +++ b/test/cases/parsing/logical-assignment/test.filter.js @@ -1,5 +1,5 @@ var supportsLogicalAssignment = require("../../../helpers/supportsLogicalAssignment"); -module.exports = function(config) { +module.exports = function (config) { return supportsLogicalAssignment(); }; diff --git a/test/cases/parsing/optional-catch-binding/test.filter.js b/test/cases/parsing/optional-catch-binding/test.filter.js index a09b8642687..5e7d911be6e 100644 --- a/test/cases/parsing/optional-catch-binding/test.filter.js +++ b/test/cases/parsing/optional-catch-binding/test.filter.js @@ -1,6 +1,6 @@ const supportsOptionalCatchBinding = require("../../../helpers/supportsOptionalCatchBinding"); -module.exports = function(config) { +module.exports = function (config) { // XXX: Disable this test if Terser is used because it does not support ES 2019 if (config.mode === "production") { return false; diff --git a/test/cases/parsing/spread/test.filter.js b/test/cases/parsing/spread/test.filter.js index 741b76b8c15..dff5bad7782 100644 --- a/test/cases/parsing/spread/test.filter.js +++ b/test/cases/parsing/spread/test.filter.js @@ -1,5 +1,5 @@ var supportsSpread = require("../../../helpers/supportsSpread"); -module.exports = function(config) { +module.exports = function (config) { return supportsSpread(); }; diff --git a/test/cases/resolving/browser-field/errors.js b/test/cases/resolving/browser-field/errors.js index 4b56bd34420..43f6c3086fc 100644 --- a/test/cases/resolving/browser-field/errors.js +++ b/test/cases/resolving/browser-field/errors.js @@ -3,4 +3,4 @@ module.exports = [ [/Module not found/, /recursive-file\/b/, /Recursion in resolving/], [/Module not found/, /recursive-file\/c/, /Recursion in resolving/], [/Module not found/, /recursive-file\/d/, /Recursion in resolving/] -]; \ No newline at end of file +]; diff --git a/test/cases/runtime/error-handling/errors.js b/test/cases/runtime/error-handling/errors.js index d3f6fa22daf..0332131095e 100644 --- a/test/cases/runtime/error-handling/errors.js +++ b/test/cases/runtime/error-handling/errors.js @@ -1,3 +1,7 @@ module.exports = [ - [/Module not found/, /Can't resolve '\.\/missingModule' /, {moduleName: /error-handling\/index.js/}] + [ + /Module not found/, + /Can't resolve '\.\/missingModule' /, + { moduleName: /error-handling\/index.js/ } + ] ]; diff --git a/test/cases/runtime/error-handling/warnings.js b/test/cases/runtime/error-handling/warnings.js index c9f21009797..c005d4830f8 100644 --- a/test/cases/runtime/error-handling/warnings.js +++ b/test/cases/runtime/error-handling/warnings.js @@ -1,3 +1,7 @@ module.exports = [ - [/Module not found/, /Can't resolve '\.\/missingModule2' /, {moduleName: /error-handling\/index.js/}] + [ + /Module not found/, + /Can't resolve '\.\/missingModule2' /, + { moduleName: /error-handling\/index.js/ } + ] ]; diff --git a/test/cases/runtime/missing-module-syntax-error/errors.js b/test/cases/runtime/missing-module-syntax-error/errors.js index 4ce4a4dd952..ced71bb9976 100644 --- a/test/cases/runtime/missing-module-syntax-error/errors.js +++ b/test/cases/runtime/missing-module-syntax-error/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Module not found/, /Can't resolve '\.\/someModule' /], -]; +module.exports = [[/Module not found/, /Can't resolve '\.\/someModule' /]]; diff --git a/test/cases/scope-hoisting/renaming-shorthand-5027/test.filter.js b/test/cases/scope-hoisting/renaming-shorthand-5027/test.filter.js index ccd1717d158..810114c1d73 100644 --- a/test/cases/scope-hoisting/renaming-shorthand-5027/test.filter.js +++ b/test/cases/scope-hoisting/renaming-shorthand-5027/test.filter.js @@ -3,10 +3,12 @@ var supportDefaultAssignment = require("../../../helpers/supportDefaultAssignmen var supportsObjectDestructuring = require("../../../helpers/supportsObjectDestructuring"); var supportsIteratorDestructuring = require("../../../helpers/supportsIteratorDestructuring"); -module.exports = function(config) { - return !config.minimize && +module.exports = function (config) { + return ( + !config.minimize && supportsES6() && supportDefaultAssignment() && supportsObjectDestructuring() && - supportsIteratorDestructuring(); + supportsIteratorDestructuring() + ); }; diff --git a/test/cases/wasm/decoding/test.filter.js b/test/cases/wasm/decoding/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/decoding/test.filter.js +++ b/test/cases/wasm/decoding/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/export-imported-global/test.filter.js b/test/cases/wasm/export-imported-global/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/export-imported-global/test.filter.js +++ b/test/cases/wasm/export-imported-global/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/finalize-exports-issue-8261/test.filter.js b/test/cases/wasm/finalize-exports-issue-8261/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/finalize-exports-issue-8261/test.filter.js +++ b/test/cases/wasm/finalize-exports-issue-8261/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/global-refs-imported-global/test.filter.js b/test/cases/wasm/global-refs-imported-global/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/global-refs-imported-global/test.filter.js +++ b/test/cases/wasm/global-refs-imported-global/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/import-wasm-wasm/test.filter.js b/test/cases/wasm/import-wasm-wasm/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/import-wasm-wasm/test.filter.js +++ b/test/cases/wasm/import-wasm-wasm/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/imported-global-preserve-ordering/test.filter.js b/test/cases/wasm/imported-global-preserve-ordering/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/imported-global-preserve-ordering/test.filter.js +++ b/test/cases/wasm/imported-global-preserve-ordering/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/imported-global-preserve-type/test.filter.js b/test/cases/wasm/imported-global-preserve-type/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/imported-global-preserve-type/test.filter.js +++ b/test/cases/wasm/imported-global-preserve-type/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/imports-circular/test.filter.js b/test/cases/wasm/imports-circular/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/imports-circular/test.filter.js +++ b/test/cases/wasm/imports-circular/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/imports-complex-types/test.filter.js b/test/cases/wasm/imports-complex-types/test.filter.js index 390fa4a4dfc..2bc44bbd962 100644 --- a/test/cases/wasm/imports-complex-types/test.filter.js +++ b/test/cases/wasm/imports-complex-types/test.filter.js @@ -1,5 +1,5 @@ const supports = require("webassembly-feature"); -module.exports = function(config) { +module.exports = function (config) { return supports["simd"](); }; diff --git a/test/cases/wasm/imports-many-direct/test.filter.js b/test/cases/wasm/imports-many-direct/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/imports-many-direct/test.filter.js +++ b/test/cases/wasm/imports-many-direct/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/imports-multiple/test.filter.js b/test/cases/wasm/imports-multiple/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/imports-multiple/test.filter.js +++ b/test/cases/wasm/imports-multiple/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/imports/test.filter.js b/test/cases/wasm/imports/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/imports/test.filter.js +++ b/test/cases/wasm/imports/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/memory/test.filter.js b/test/cases/wasm/memory/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/memory/test.filter.js +++ b/test/cases/wasm/memory/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/order/test.filter.js b/test/cases/wasm/order/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/order/test.filter.js +++ b/test/cases/wasm/order/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/simple/test.filter.js b/test/cases/wasm/simple/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/simple/test.filter.js +++ b/test/cases/wasm/simple/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/table/test.filter.js b/test/cases/wasm/table/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/table/test.filter.js +++ b/test/cases/wasm/table/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/two-files-loader/test.filter.js b/test/cases/wasm/two-files-loader/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/two-files-loader/test.filter.js +++ b/test/cases/wasm/two-files-loader/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/unused-export/test.filter.js b/test/cases/wasm/unused-export/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/unused-export/test.filter.js +++ b/test/cases/wasm/unused-export/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/v128/test.filter.js b/test/cases/wasm/v128/test.filter.js index 4a11b482645..a4c4664b2ea 100644 --- a/test/cases/wasm/v128/test.filter.js +++ b/test/cases/wasm/v128/test.filter.js @@ -1,8 +1,8 @@ -const supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -const supportsFeature = require("webassembly-feature"); +// const supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); +// const supportsFeature = require("webassembly-feature"); module.exports = function (config) { // TODO fails with CompileError: WebAssembly.instantiate(): Compiling function #0 failed: memory instruction with no memory @+24 return false; - return supportsWebAssembly() && supportsFeature.simd(); + // return supportsWebAssembly() && supportsFeature.simd(); }; diff --git a/test/cases/wasm/wasm-explorer-examples-async/test.filter.js b/test/cases/wasm/wasm-explorer-examples-async/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/wasm-explorer-examples-async/test.filter.js +++ b/test/cases/wasm/wasm-explorer-examples-async/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js b/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js +++ b/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/configCases/asset-modules/http-url/test.config.js b/test/configCases/asset-modules/http-url/test.config.js index b515d7d0e9f..5de02baa821 100644 --- a/test/configCases/asset-modules/http-url/test.config.js +++ b/test/configCases/asset-modules/http-url/test.config.js @@ -5,11 +5,15 @@ module.exports = { beforeExecute() { try { fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock")); - } catch (e) {} + } catch (e) { + // Empty + } }, afterExecute() { try { fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock")); - } catch (e) {} + } catch (e) { + // Empty + } } }; diff --git a/test/configCases/chunk-graph/issue-9634/test.config.js b/test/configCases/chunk-graph/issue-9634/test.config.js index 4f87cbec712..3fe44b616c5 100644 --- a/test/configCases/chunk-graph/issue-9634/test.config.js +++ b/test/configCases/chunk-graph/issue-9634/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["a.js", "b.js"]; } }; diff --git a/test/configCases/chunk-index/order-multiple-entries/test.config.js b/test/configCases/chunk-index/order-multiple-entries/test.config.js index 65c1791bce3..7c714985915 100644 --- a/test/configCases/chunk-index/order-multiple-entries/test.config.js +++ b/test/configCases/chunk-index/order-multiple-entries/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["entry1.js", "entry2.js"]; } }; diff --git a/test/configCases/code-generation/require-context-id/warnings.js b/test/configCases/code-generation/require-context-id/warnings.js index 5d0640d1c37..70fefa270fb 100644 --- a/test/configCases/code-generation/require-context-id/warnings.js +++ b/test/configCases/code-generation/require-context-id/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/hashed/, /deprecated/] -]; +module.exports = [[/hashed/, /deprecated/]]; diff --git a/test/configCases/compiletime/error-not-found/errors.js b/test/configCases/compiletime/error-not-found/errors.js index e36b112fde3..59aab9d5ba7 100644 --- a/test/configCases/compiletime/error-not-found/errors.js +++ b/test/configCases/compiletime/error-not-found/errors.js @@ -1,3 +1 @@ -module.exports = [ - /not found/ -]; +module.exports = [/not found/]; diff --git a/test/configCases/compiletime/warn-not-found/warnings.js b/test/configCases/compiletime/warn-not-found/warnings.js index e36b112fde3..59aab9d5ba7 100644 --- a/test/configCases/compiletime/warn-not-found/warnings.js +++ b/test/configCases/compiletime/warn-not-found/warnings.js @@ -1,3 +1 @@ -module.exports = [ - /not found/ -]; +module.exports = [/not found/]; diff --git a/test/configCases/concatenate-modules/load-chunk-function/test.config.js b/test/configCases/concatenate-modules/load-chunk-function/test.config.js index 65c1791bce3..7c714985915 100644 --- a/test/configCases/concatenate-modules/load-chunk-function/test.config.js +++ b/test/configCases/concatenate-modules/load-chunk-function/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["entry1.js", "entry2.js"]; } }; diff --git a/test/configCases/concatenate-modules/split-chunk-entry-module/test.config.js b/test/configCases/concatenate-modules/split-chunk-entry-module/test.config.js index b2809a12398..d2cb4260cff 100644 --- a/test/configCases/concatenate-modules/split-chunk-entry-module/test.config.js +++ b/test/configCases/concatenate-modules/split-chunk-entry-module/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["runtime.js", "common-index_js.js", "main.js"]; } }; diff --git a/test/configCases/contenthash/assets/test.config.js b/test/configCases/contenthash/assets/test.config.js index bcd4af2cea8..0a8a1250095 100644 --- a/test/configCases/contenthash/assets/test.config.js +++ b/test/configCases/contenthash/assets/test.config.js @@ -4,7 +4,7 @@ const allAssets = new Set(); const allBundles = new Set(); module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0]; allBundles.add(/\.([^.]+)\./.exec(bundle)[1]); @@ -12,11 +12,11 @@ module.exports = { switch (i) { case 0: - asset = findOutputFiles(options, /^1\.[^\.]*\.jpg$/, 'img')[0]; + asset = findOutputFiles(options, /^1\.[^.]*\.jpg$/, "img")[0]; break; case 1: case 5: - asset = findOutputFiles(options, /^1\.[^\.]*\.jpg$/, 'asset')[0]; + asset = findOutputFiles(options, /^1\.[^.]*\.jpg$/, "asset")[0]; break; } diff --git a/test/configCases/contenthash/include-chunk-id/test.config.js b/test/configCases/contenthash/include-chunk-id/test.config.js index 36168a94791..c65a91f04bd 100644 --- a/test/configCases/contenthash/include-chunk-id/test.config.js +++ b/test/configCases/contenthash/include-chunk-id/test.config.js @@ -4,7 +4,7 @@ const allFilenameHashes = new Set(); const allChunkHashes = new Set(); module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { const filename = findOutputFiles(options, new RegExp(`^bundle${i}`))[0]; const filenameHash = /\.([a-f0-9]+)\.js$/.exec(filename)[1]; allFilenameHashes.add(filenameHash); diff --git a/test/configCases/contenthash/salt/test.config.js b/test/configCases/contenthash/salt/test.config.js index 530c9147c05..ce9494812e9 100644 --- a/test/configCases/contenthash/salt/test.config.js +++ b/test/configCases/contenthash/salt/test.config.js @@ -4,7 +4,7 @@ const allAssets = new Set(); const allBundles = new Set(); module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0]; allBundles.add(/\.([^.]+)\./.exec(bundle)[1]); diff --git a/test/configCases/delegated-hash/simple/warnings.js b/test/configCases/delegated-hash/simple/warnings.js index 5d0640d1c37..70fefa270fb 100644 --- a/test/configCases/delegated-hash/simple/warnings.js +++ b/test/configCases/delegated-hash/simple/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/hashed/, /deprecated/] -]; +module.exports = [[/hashed/, /deprecated/]]; diff --git a/test/configCases/dll-plugin/3-use-dll-with-hashid/warnings.js b/test/configCases/dll-plugin/3-use-dll-with-hashid/warnings.js index 5d0640d1c37..70fefa270fb 100644 --- a/test/configCases/dll-plugin/3-use-dll-with-hashid/warnings.js +++ b/test/configCases/dll-plugin/3-use-dll-with-hashid/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/hashed/, /deprecated/] -]; +module.exports = [[/hashed/, /deprecated/]]; diff --git a/test/configCases/entry/adding-multiple-entry-points/test.config.js b/test/configCases/entry/adding-multiple-entry-points/test.config.js index 7dc1c935450..b8ab195d3ea 100644 --- a/test/configCases/entry/adding-multiple-entry-points/test.config.js +++ b/test/configCases/entry/adding-multiple-entry-points/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./runtime~main.js", - "./main.js" - ] + findBundle: function () { + return ["./runtime~main.js", "./main.js"]; } }; diff --git a/test/configCases/entry/depend-on-simple/test.config.js b/test/configCases/entry/depend-on-simple/test.config.js index 2685941d7ce..d8f78e1e848 100644 --- a/test/configCases/entry/depend-on-simple/test.config.js +++ b/test/configCases/entry/depend-on-simple/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function() { + findBundle: function () { return ["./app.js", "./react-vendors.js"]; } }; diff --git a/test/configCases/entry/descriptor/test.config.js b/test/configCases/entry/descriptor/test.config.js index 8a5b96a8434..e4c1c3811ca 100644 --- a/test/configCases/entry/descriptor/test.config.js +++ b/test/configCases/entry/descriptor/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js" - ] + findBundle: function () { + return ["./a.js", "./b.js"]; } }; diff --git a/test/configCases/entry/function-promise/test.config.js b/test/configCases/entry/function-promise/test.config.js index 8a5b96a8434..e4c1c3811ca 100644 --- a/test/configCases/entry/function-promise/test.config.js +++ b/test/configCases/entry/function-promise/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js" - ] + findBundle: function () { + return ["./a.js", "./b.js"]; } }; diff --git a/test/configCases/entry/function/test.config.js b/test/configCases/entry/function/test.config.js index 8a5b96a8434..e4c1c3811ca 100644 --- a/test/configCases/entry/function/test.config.js +++ b/test/configCases/entry/function/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js" - ] + findBundle: function () { + return ["./a.js", "./b.js"]; } }; diff --git a/test/configCases/errors/entry-not-found/errors.js b/test/configCases/errors/entry-not-found/errors.js index fedff0a83c2..648b41f3f03 100644 --- a/test/configCases/errors/entry-not-found/errors.js +++ b/test/configCases/errors/entry-not-found/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/^Module not found/, /.\/index\.js/] -]; +module.exports = [[/^Module not found/, /.\/index\.js/]]; diff --git a/test/configCases/errors/import-missing/errors.js b/test/configCases/errors/import-missing/errors.js index d4f7cb2e8cd..d85236a2c74 100644 --- a/test/configCases/errors/import-missing/errors.js +++ b/test/configCases/errors/import-missing/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Module not found/] -]; +module.exports = [[/Module not found/]]; diff --git a/test/configCases/errors/multi-entry-missing-module/test.config.js b/test/configCases/errors/multi-entry-missing-module/test.config.js index 50494000b36..0bf2100df18 100644 --- a/test/configCases/errors/multi-entry-missing-module/test.config.js +++ b/test/configCases/errors/multi-entry-missing-module/test.config.js @@ -1,9 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js", - "./bundle0.js" - ] + findBundle: function () { + return ["./a.js", "./b.js", "./bundle0.js"]; } }; diff --git a/test/configCases/externals/externals-in-commons-chunk/test.config.js b/test/configCases/externals/externals-in-commons-chunk/test.config.js index 51faf2424ad..345b63543bc 100644 --- a/test/configCases/externals/externals-in-commons-chunk/test.config.js +++ b/test/configCases/externals/externals-in-commons-chunk/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./common.js", - "./main.js" - ] + findBundle: function (i, options) { + return ["./common.js", "./main.js"]; } }; diff --git a/test/configCases/externals/externals-system-custom/test.config.js b/test/configCases/externals/externals-system-custom/test.config.js index 5a50c9e0593..bbe84a3313d 100644 --- a/test/configCases/externals/externals-system-custom/test.config.js +++ b/test/configCases/externals/externals-system-custom/test.config.js @@ -1,14 +1,14 @@ const System = require("../../../helpers/fakeSystem"); module.exports = { - target: 'web', + target: "web", beforeExecute: () => { System.init(); }, moduleScope(scope) { - scope.window.windowExt = 'works'; - scope.rootExt = 'works'; - scope.varExt = 'works'; + scope.window.windowExt = "works"; + scope.rootExt = "works"; + scope.varExt = "works"; scope.System = System; }, afterExecute: () => { diff --git a/test/configCases/issues/issue-14974/test.filter.js b/test/configCases/issues/issue-14974/test.filter.js index 18265449d45..c223174f266 100644 --- a/test/configCases/issues/issue-14974/test.filter.js +++ b/test/configCases/issues/issue-14974/test.filter.js @@ -1,3 +1,3 @@ module.exports = function () { - return process.version.slice(0, 4) !== "v10." + return process.version.slice(0, 4) !== "v10."; }; diff --git a/test/configCases/issues/issue-7563/test.config.js b/test/configCases/issues/issue-7563/test.config.js index dee26555271..9eb43c9bfee 100644 --- a/test/configCases/issues/issue-7563/test.config.js +++ b/test/configCases/issues/issue-7563/test.config.js @@ -1,9 +1,9 @@ -var fs = require('fs'); +var fs = require("fs"); module.exports = { noTests: true, - findBundle: function(i, options) { - var regex = new RegExp("^bundle\." + options.name, "i"); + findBundle: function (i, options) { + var regex = new RegExp("^bundle." + options.name, "i"); var files = fs.readdirSync(options.output.path); var bundle = files.find(function (file) { return regex.test(file); diff --git a/test/configCases/loaders/issue-3320/deprecations.js b/test/configCases/loaders/issue-3320/deprecations.js index aac17455119..f05114b9382 100644 --- a/test/configCases/loaders/issue-3320/deprecations.js +++ b/test/configCases/loaders/issue-3320/deprecations.js @@ -1,10 +1,12 @@ module.exports = [ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/, - message: /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[2\]\.options\)/ + message: + /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[2\]\.options\)/ }, { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/, - message: /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[3\]\.use\[0\]\.options\)/ + message: + /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[3\]\.use\[0\]\.options\)/ } ]; diff --git a/test/configCases/optimization/hashed-module-ids/warnings.js b/test/configCases/optimization/hashed-module-ids/warnings.js index 5d0640d1c37..70fefa270fb 100644 --- a/test/configCases/optimization/hashed-module-ids/warnings.js +++ b/test/configCases/optimization/hashed-module-ids/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/hashed/, /deprecated/] -]; +module.exports = [[/hashed/, /deprecated/]]; diff --git a/test/configCases/optimization/runtime-specific-used-exports/test.config.js b/test/configCases/optimization/runtime-specific-used-exports/test.config.js index 4754b6482e8..e4c1c3811ca 100644 --- a/test/configCases/optimization/runtime-specific-used-exports/test.config.js +++ b/test/configCases/optimization/runtime-specific-used-exports/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js" - ]; + findBundle: function () { + return ["./a.js", "./b.js"]; } }; diff --git a/test/configCases/optimization/runtime-specific-used-exports2/test.config.js b/test/configCases/optimization/runtime-specific-used-exports2/test.config.js index c5938acd51c..6229990acc2 100644 --- a/test/configCases/optimization/runtime-specific-used-exports2/test.config.js +++ b/test/configCases/optimization/runtime-specific-used-exports2/test.config.js @@ -1,9 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js", - "./c.js" - ]; + findBundle: function () { + return ["./a.js", "./b.js", "./c.js"]; } }; diff --git a/test/configCases/output/function/test.config.js b/test/configCases/output/function/test.config.js index 4754b6482e8..e4c1c3811ca 100644 --- a/test/configCases/output/function/test.config.js +++ b/test/configCases/output/function/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js", - "./b.js" - ]; + findBundle: function () { + return ["./a.js", "./b.js"]; } }; diff --git a/test/configCases/output/inner-dirs-entries/test.config.js b/test/configCases/output/inner-dirs-entries/test.config.js index 6824904224c..59e45ecc267 100644 --- a/test/configCases/output/inner-dirs-entries/test.config.js +++ b/test/configCases/output/inner-dirs-entries/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function() { + findBundle: function () { return ["./a.js", "./inner-dir/b.js", "./inner-dir/deep/deep/c.js"]; } }; diff --git a/test/configCases/output/publicPath-scriptType-module/test.config.js b/test/configCases/output/publicPath-scriptType-module/test.config.js index 1a9ba98e443..c57155f16d0 100644 --- a/test/configCases/output/publicPath-scriptType-module/test.config.js +++ b/test/configCases/output/publicPath-scriptType-module/test.config.js @@ -1,8 +1,6 @@ module.exports = { - findBundle: function() { - return [ - "./index.mjs" - ]; + findBundle: function () { + return ["./index.mjs"]; }, moduleScope(scope) { scope.pseudoImport = { meta: { url: "http://test.co/path/index.js" } }; diff --git a/test/configCases/output/publicPath-web/test.config.js b/test/configCases/output/publicPath-web/test.config.js index 53ecdb9cc9b..a5024d58671 100644 --- a/test/configCases/output/publicPath-web/test.config.js +++ b/test/configCases/output/publicPath-web/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./inner1/inner2/a.js", - "./b.js" - ]; + findBundle: function () { + return ["./inner1/inner2/a.js", "./b.js"]; } }; diff --git a/test/configCases/output/string/test.config.js b/test/configCases/output/string/test.config.js index 9af369705a3..30495784d0b 100644 --- a/test/configCases/output/string/test.config.js +++ b/test/configCases/output/string/test.config.js @@ -1,7 +1,5 @@ module.exports = { - findBundle: function() { - return [ - "./a.js" - ]; + findBundle: function () { + return ["./a.js"]; } }; diff --git a/test/configCases/parsing/issue-2942/warnings.js b/test/configCases/parsing/issue-2942/warnings.js index 217c81ed03a..b9d04875279 100644 --- a/test/configCases/parsing/issue-2942/warnings.js +++ b/test/configCases/parsing/issue-2942/warnings.js @@ -1,5 +1,5 @@ module.exports = [ [/System.register is not supported by webpack/], [/System.get is not supported by webpack/], - [/System.set is not supported by webpack/], + [/System.set is not supported by webpack/] ]; diff --git a/test/configCases/parsing/issue-9042/test.config.js b/test/configCases/parsing/issue-9042/test.config.js index 1266625deb9..59765f30dfd 100644 --- a/test/configCases/parsing/issue-9042/test.config.js +++ b/test/configCases/parsing/issue-9042/test.config.js @@ -1,5 +1,5 @@ module.exports = { - moduleScope: function(scope) { + moduleScope: function (scope) { delete scope.__dirname; delete scope.__filename; } diff --git a/test/configCases/parsing/node-stuff-plugin-off/test.config.js b/test/configCases/parsing/node-stuff-plugin-off/test.config.js index 1266625deb9..59765f30dfd 100644 --- a/test/configCases/parsing/node-stuff-plugin-off/test.config.js +++ b/test/configCases/parsing/node-stuff-plugin-off/test.config.js @@ -1,5 +1,5 @@ module.exports = { - moduleScope: function(scope) { + moduleScope: function (scope) { delete scope.__dirname; delete scope.__filename; } diff --git a/test/configCases/performance/many-async-imports/test.filter.js b/test/configCases/performance/many-async-imports/test.filter.js index 8b7e505b1bf..a93cad202cd 100644 --- a/test/configCases/performance/many-async-imports/test.filter.js +++ b/test/configCases/performance/many-async-imports/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return !/^v(4|6)/.test(process.version); }; diff --git a/test/configCases/performance/many-exports/test.filter.js b/test/configCases/performance/many-exports/test.filter.js index 8b7e505b1bf..a93cad202cd 100644 --- a/test/configCases/performance/many-exports/test.filter.js +++ b/test/configCases/performance/many-exports/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return !/^v(4|6)/.test(process.version); }; diff --git a/test/configCases/plugins/banner-plugin-hashing/test.config.js b/test/configCases/plugins/banner-plugin-hashing/test.config.js index 2d283508eea..19476fadffb 100644 --- a/test/configCases/plugins/banner-plugin-hashing/test.config.js +++ b/test/configCases/plugins/banner-plugin-hashing/test.config.js @@ -1,7 +1,5 @@ -var fs = require("fs"); - module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return "./dist/banner.js"; } }; diff --git a/test/configCases/plugins/environment-plugin/errors.js b/test/configCases/plugins/environment-plugin/errors.js index b670159cab1..866fee9dbf7 100644 --- a/test/configCases/plugins/environment-plugin/errors.js +++ b/test/configCases/plugins/environment-plugin/errors.js @@ -1,26 +1,43 @@ -const variables = ['aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff', 'ggg', 'hhh', 'iii']; -const modules = [{ - name: 'aaa', - variables: ['aaa'] -}, { - name: 'bbbccc', - variables: ['bbb', 'ccc'] -}, { - name: 'ddd', - variables: [], - allowedErrors: [ - [{compilerPath: /ddd/}, /DDD environment variable is undefined./] - ] -}, { - name: 'eeefff', - variables: ['eee', 'fff'] -}, { - name: 'ggghhh', - variables: ['ggg', 'hhh'] -}, { - name: 'iii', - variables: ['iii'] -}]; +const variables = [ + "aaa", + "bbb", + "ccc", + "ddd", + "eee", + "fff", + "ggg", + "hhh", + "iii" +]; +const modules = [ + { + name: "aaa", + variables: ["aaa"] + }, + { + name: "bbbccc", + variables: ["bbb", "ccc"] + }, + { + name: "ddd", + variables: [], + allowedErrors: [ + [{ compilerPath: /ddd/ }, /DDD environment variable is undefined./] + ] + }, + { + name: "eeefff", + variables: ["eee", "fff"] + }, + { + name: "ggghhh", + variables: ["ggg", "hhh"] + }, + { + name: "iii", + variables: ["iii"] + } +]; // build an array of regular expressions of expected errors const regex = []; @@ -29,14 +46,14 @@ modules.forEach(module => { if (module.variables.indexOf(variable) === -1) { // the module doesn't include the env variable, an error is expected when requiring the variable regex.push([ - {compilerPath: new RegExp(`${module.name}`)}, - new RegExp(`Can't resolve '${variable}'`), + { compilerPath: new RegExp(`${module.name}`) }, + new RegExp(`Can't resolve '${variable}'`) ]); } }); - + if (module.allowedErrors) { - regex.push(...module.allowedErrors) + regex.push(...module.allowedErrors); } }); diff --git a/test/configCases/plugins/profiling-plugin/test.filter.js b/test/configCases/plugins/profiling-plugin/test.filter.js index b36fb8fa768..71a71e594ff 100644 --- a/test/configCases/plugins/profiling-plugin/test.filter.js +++ b/test/configCases/plugins/profiling-plugin/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return !process.env.CI; }; diff --git a/test/configCases/source-map/source-map-with-profiling-plugin/test.filter.js b/test/configCases/source-map/source-map-with-profiling-plugin/test.filter.js index b36fb8fa768..71a71e594ff 100644 --- a/test/configCases/source-map/source-map-with-profiling-plugin/test.filter.js +++ b/test/configCases/source-map/source-map-with-profiling-plugin/test.filter.js @@ -1,3 +1,3 @@ -module.exports = function(config) { +module.exports = function (config) { return !process.env.CI; }; diff --git a/test/configCases/split-chunks-common/correct-order/test.config.js b/test/configCases/split-chunks-common/correct-order/test.config.js index 4b70a8281d9..587e3116dfb 100644 --- a/test/configCases/split-chunks-common/correct-order/test.config.js +++ b/test/configCases/split-chunks-common/correct-order/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./vendor.js", - "./main.js" - ] + findBundle: function (i, options) { + return ["./vendor.js", "./main.js"]; } }; diff --git a/test/configCases/split-chunks-common/extract-async-from-entry/test.config.js b/test/configCases/split-chunks-common/extract-async-from-entry/test.config.js index a1fa7e16f53..ad8eec8ce98 100644 --- a/test/configCases/split-chunks-common/extract-async-from-entry/test.config.js +++ b/test/configCases/split-chunks-common/extract-async-from-entry/test.config.js @@ -1,7 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./main.js" - ]; + findBundle: function (i, options) { + return ["./main.js"]; } }; diff --git a/test/configCases/split-chunks-common/hot-multi/test.config.js b/test/configCases/split-chunks-common/hot-multi/test.config.js index 221de612c0b..f5f6453fc1e 100644 --- a/test/configCases/split-chunks-common/hot-multi/test.config.js +++ b/test/configCases/split-chunks-common/hot-multi/test.config.js @@ -1,9 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./vendor.js", - "./first.js", - "./second.js" - ] + findBundle: function (i, options) { + return ["./vendor.js", "./first.js", "./second.js"]; } }; diff --git a/test/configCases/split-chunks-common/hot/test.config.js b/test/configCases/split-chunks-common/hot/test.config.js index 4b70a8281d9..587e3116dfb 100644 --- a/test/configCases/split-chunks-common/hot/test.config.js +++ b/test/configCases/split-chunks-common/hot/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./vendor.js", - "./main.js" - ] + findBundle: function (i, options) { + return ["./vendor.js", "./main.js"]; } }; diff --git a/test/configCases/split-chunks-common/inverted-order/test.config.js b/test/configCases/split-chunks-common/inverted-order/test.config.js index 9f3aeae9a92..a7742bb4241 100644 --- a/test/configCases/split-chunks-common/inverted-order/test.config.js +++ b/test/configCases/split-chunks-common/inverted-order/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./main.js", - "./vendor.js" - ] + findBundle: function (i, options) { + return ["./main.js", "./vendor.js"]; } }; diff --git a/test/configCases/split-chunks-common/issue-12128/test.config.js b/test/configCases/split-chunks-common/issue-12128/test.config.js index 0a3abd03336..0c980cac863 100644 --- a/test/configCases/split-chunks-common/issue-12128/test.config.js +++ b/test/configCases/split-chunks-common/issue-12128/test.config.js @@ -1,9 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./common.js", - "./main.js", - "./main2.js" - ] + findBundle: function (i, options) { + return ["./common.js", "./main.js", "./main2.js"]; } }; diff --git a/test/configCases/split-chunks-common/library/test.config.js b/test/configCases/split-chunks-common/library/test.config.js index c50c7988582..86896181453 100644 --- a/test/configCases/split-chunks-common/library/test.config.js +++ b/test/configCases/split-chunks-common/library/test.config.js @@ -1,13 +1,10 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./vendor.js", - "./main.js" - ] + findBundle: function (i, options) { + return ["./vendor.js", "./main.js"]; }, modules: { - "external0": "module 0", - "external1": "module 1", - "external2": "module 2" + external0: "module 0", + external1: "module 1", + external2: "module 2" } }; diff --git a/test/configCases/split-chunks-common/move-entry/test.config.js b/test/configCases/split-chunks-common/move-entry/test.config.js index e62df37d337..6bd99e35fd3 100644 --- a/test/configCases/split-chunks-common/move-entry/test.config.js +++ b/test/configCases/split-chunks-common/move-entry/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./commons.js", - "./main.js" - ] + findBundle: function (i, options) { + return ["./commons.js", "./main.js"]; } }; diff --git a/test/configCases/split-chunks-common/move-to-grandparent/test.config.js b/test/configCases/split-chunks-common/move-to-grandparent/test.config.js index 4c2a87b6f4c..ae33dd600b1 100644 --- a/test/configCases/split-chunks-common/move-to-grandparent/test.config.js +++ b/test/configCases/split-chunks-common/move-to-grandparent/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./main.js", - "./misc.js", - ]; + findBundle: function (i, options) { + return ["./main.js", "./misc.js"]; } }; diff --git a/test/configCases/split-chunks-common/simple/test.config.js b/test/configCases/split-chunks-common/simple/test.config.js index 4b70a8281d9..587e3116dfb 100644 --- a/test/configCases/split-chunks-common/simple/test.config.js +++ b/test/configCases/split-chunks-common/simple/test.config.js @@ -1,8 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - "./vendor.js", - "./main.js" - ] + findBundle: function (i, options) { + return ["./vendor.js", "./main.js"]; } }; diff --git a/test/configCases/split-chunks-common/target-node/test.config.js b/test/configCases/split-chunks-common/target-node/test.config.js index 62bb0c541bc..a7ab2451188 100644 --- a/test/configCases/split-chunks-common/target-node/test.config.js +++ b/test/configCases/split-chunks-common/target-node/test.config.js @@ -1,7 +1,5 @@ module.exports = { - findBundle: function(i, options) { - return [ - `./${options.name}-main.js` - ] + findBundle: function (i, options) { + return [`./${options.name}-main.js`]; } }; diff --git a/test/configCases/split-chunks/asnyc-entries/test.config.js b/test/configCases/split-chunks/asnyc-entries/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/split-chunks/asnyc-entries/test.config.js +++ b/test/configCases/split-chunks/asnyc-entries/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/split-chunks/asnyc-entries/test.filter.js b/test/configCases/split-chunks/asnyc-entries/test.filter.js index 7039623344e..467432597cb 100644 --- a/test/configCases/split-chunks/asnyc-entries/test.filter.js +++ b/test/configCases/split-chunks/asnyc-entries/test.filter.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line node/no-unpublished-require var supportsWorker = require("../../../helpers/supportsWorker"); module.exports = function (config) { diff --git a/test/configCases/split-chunks/chunk-filename-delimiter-default/test.config.js b/test/configCases/split-chunks/chunk-filename-delimiter-default/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter-default/test.config.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter-default/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/split-chunks/chunk-filename-delimiter/test.config.js b/test/configCases/split-chunks/chunk-filename-delimiter/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter/test.config.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/split-chunks/custom-filename-function/test.config.js b/test/configCases/split-chunks/custom-filename-function/test.config.js index e5bdec5f838..b927b2e1120 100644 --- a/test/configCases/split-chunks/custom-filename-function/test.config.js +++ b/test/configCases/split-chunks/custom-filename-function/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["a.js"]; } }; diff --git a/test/configCases/split-chunks/custom-filename-many-custom/test.config.js b/test/configCases/split-chunks/custom-filename-many-custom/test.config.js index e5bdec5f838..b927b2e1120 100644 --- a/test/configCases/split-chunks/custom-filename-many-custom/test.config.js +++ b/test/configCases/split-chunks/custom-filename-many-custom/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["a.js"]; } }; diff --git a/test/configCases/split-chunks/custom-filename/test.config.js b/test/configCases/split-chunks/custom-filename/test.config.js index e5bdec5f838..b927b2e1120 100644 --- a/test/configCases/split-chunks/custom-filename/test.config.js +++ b/test/configCases/split-chunks/custom-filename/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["a.js"]; } }; diff --git a/test/configCases/split-chunks/entry-point-error/errors.js b/test/configCases/split-chunks/entry-point-error/errors.js index 389c2d3aa50..f8d7dc2e33b 100644 --- a/test/configCases/split-chunks/entry-point-error/errors.js +++ b/test/configCases/split-chunks/entry-point-error/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/SplitChunksPlugin/, /Both have the same name "vendors"/] -]; +module.exports = [[/SplitChunksPlugin/, /Both have the same name "vendors"/]]; diff --git a/test/configCases/split-chunks/entry-point-error/test.config.js b/test/configCases/split-chunks/entry-point-error/test.config.js index 5fce65555c0..ba62ee282e9 100644 --- a/test/configCases/split-chunks/entry-point-error/test.config.js +++ b/test/configCases/split-chunks/entry-point-error/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["vendors.js", "main.js"]; } }; diff --git a/test/configCases/split-chunks/issue-8908/test.config.js b/test/configCases/split-chunks/issue-8908/test.config.js index 7dd8a9b0ba1..47cca9d6649 100644 --- a/test/configCases/split-chunks/issue-8908/test.config.js +++ b/test/configCases/split-chunks/issue-8908/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["runtime.js", "vendor-a.js", "a.js"]; } }; diff --git a/test/configCases/split-chunks/issue-9491/test.config.js b/test/configCases/split-chunks/issue-9491/test.config.js index e030e6722dc..e436a9a7938 100644 --- a/test/configCases/split-chunks/issue-9491/test.config.js +++ b/test/configCases/split-chunks/issue-9491/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["runtime.js", "constructor.js"]; } }; diff --git a/test/configCases/split-chunks/module-type-filter/test.config.js b/test/configCases/split-chunks/module-type-filter/test.config.js index 229e6463bc8..d4a2ddffb32 100644 --- a/test/configCases/split-chunks/module-type-filter/test.config.js +++ b/test/configCases/split-chunks/module-type-filter/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["json.js", "main.js"]; } }; diff --git a/test/configCases/split-chunks/no-options/test.config.js b/test/configCases/split-chunks/no-options/test.config.js index 6f3aaf93f4f..8ad8dda44b7 100644 --- a/test/configCases/split-chunks/no-options/test.config.js +++ b/test/configCases/split-chunks/no-options/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["vendor.js", "main.js"]; } }; diff --git a/test/configCases/split-chunks/reuse-chunk-name/test.config.js b/test/configCases/split-chunks/reuse-chunk-name/test.config.js index 480f5e08d95..d7289ef96e1 100644 --- a/test/configCases/split-chunks/reuse-chunk-name/test.config.js +++ b/test/configCases/split-chunks/reuse-chunk-name/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["common.js", "main.js"]; } }; diff --git a/test/configCases/split-chunks/runtime-chunk-no-async/test.config.js b/test/configCases/split-chunks/runtime-chunk-no-async/test.config.js index 7eafe4ed79c..c63e389cb34 100644 --- a/test/configCases/split-chunks/runtime-chunk-no-async/test.config.js +++ b/test/configCases/split-chunks/runtime-chunk-no-async/test.config.js @@ -1,6 +1,6 @@ const fs = require("fs"); module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { var files = fs.readdirSync(options.output.path); return ["runtime.js", files.filter(f => /^main/.test(f))[0]]; } diff --git a/test/configCases/split-chunks/runtime-chunk/test.config.js b/test/configCases/split-chunks/runtime-chunk/test.config.js index dad54da8f4a..359b15a5c91 100644 --- a/test/configCases/split-chunks/runtime-chunk/test.config.js +++ b/test/configCases/split-chunks/runtime-chunk/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["runtime.js", "a.js"]; } }; diff --git a/test/configCases/target/node-dynamic-import/test.filter.js b/test/configCases/target/node-dynamic-import/test.filter.js index 863e9be6558..6a32a7d0ddd 100644 --- a/test/configCases/target/node-dynamic-import/test.filter.js +++ b/test/configCases/target/node-dynamic-import/test.filter.js @@ -1,5 +1,5 @@ var supportsArrowFn = require("../../../helpers/supportsArrowFunctionExpression"); -module.exports = function(config) { +module.exports = function (config) { return supportsArrowFn(); }; diff --git a/test/configCases/wasm/bigints/test.filter.js b/test/configCases/wasm/bigints/test.filter.js index fedc9379c36..3a0ae925e37 100644 --- a/test/configCases/wasm/bigints/test.filter.js +++ b/test/configCases/wasm/bigints/test.filter.js @@ -1,5 +1,5 @@ const supports = require("webassembly-feature"); -module.exports = function(config) { +module.exports = function (config) { return supports["JS-BigInt-integration"](); }; diff --git a/test/configCases/wasm/export-imported-global/test.filter.js b/test/configCases/wasm/export-imported-global/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/configCases/wasm/export-imported-global/test.filter.js +++ b/test/configCases/wasm/export-imported-global/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/configCases/wasm/identical/test.filter.js b/test/configCases/wasm/identical/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/configCases/wasm/identical/test.filter.js +++ b/test/configCases/wasm/identical/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/configCases/wasm/import-wasm-wasm/test.filter.js b/test/configCases/wasm/import-wasm-wasm/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/configCases/wasm/import-wasm-wasm/test.filter.js +++ b/test/configCases/wasm/import-wasm-wasm/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/configCases/wasm/wasm-in-initial-chunk-error/test.filter.js b/test/configCases/wasm/wasm-in-initial-chunk-error/test.filter.js index 0e71c44cb38..8c50698267c 100644 --- a/test/configCases/wasm/wasm-in-initial-chunk-error/test.filter.js +++ b/test/configCases/wasm/wasm-in-initial-chunk-error/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function() { +module.exports = function () { return supportsWebAssembly(); }; diff --git a/test/configCases/web/node-source-future-defaults/warnings.js b/test/configCases/web/node-source-future-defaults/warnings.js index d87e919f419..9c0b7c899f6 100644 --- a/test/configCases/web/node-source-future-defaults/warnings.js +++ b/test/configCases/web/node-source-future-defaults/warnings.js @@ -6,5 +6,5 @@ module.exports = [ [/"global" has been used, it will be undefined in next major version/], [/"__filename" has been used, it will be undefined in next major version/], - [/"__dirname" has been used, it will be undefined in next major version/], + [/"__dirname" has been used, it will be undefined in next major version/] ]; diff --git a/test/configCases/web/prefetch-split-chunks/test.config.js b/test/configCases/web/prefetch-split-chunks/test.config.js index 76c89801eeb..a381a070fa7 100644 --- a/test/configCases/web/prefetch-split-chunks/test.config.js +++ b/test/configCases/web/prefetch-split-chunks/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js", "runtime~main.js", "separate-public-path_js.js"]; } }; diff --git a/test/configCases/web/unique-jsonp/test.config.js b/test/configCases/web/unique-jsonp/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/web/unique-jsonp/test.config.js +++ b/test/configCases/web/unique-jsonp/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/worker/custom-worker/test.config.js b/test/configCases/worker/custom-worker/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/worker/custom-worker/test.config.js +++ b/test/configCases/worker/custom-worker/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/worker/node-worker-named/test.config.js b/test/configCases/worker/node-worker-named/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/worker/node-worker-named/test.config.js +++ b/test/configCases/worker/node-worker-named/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/worker/web-worker/test.config.js b/test/configCases/worker/web-worker/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/worker/web-worker/test.config.js +++ b/test/configCases/worker/web-worker/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/configCases/worker/worker-contenthash/test.config.js b/test/configCases/worker/worker-contenthash/test.config.js index 65ddf7b1d77..2e3be0636e9 100644 --- a/test/configCases/worker/worker-contenthash/test.config.js +++ b/test/configCases/worker/worker-contenthash/test.config.js @@ -1,5 +1,5 @@ module.exports = { - findBundle: function(i, options) { + findBundle: function (i, options) { return ["main.js"]; } }; diff --git a/test/statsCases/wasm-explorer-examples-sync/test.filter.js b/test/statsCases/wasm-explorer-examples-sync/test.filter.js index c54f54981cb..d73f4d75841 100644 --- a/test/statsCases/wasm-explorer-examples-sync/test.filter.js +++ b/test/statsCases/wasm-explorer-examples-sync/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); }; diff --git a/test/watchCases/recover-from-error/missing-module/0/errors.js b/test/watchCases/recover-from-error/missing-module/0/errors.js index 08c3cac4eed..8a65e54f089 100644 --- a/test/watchCases/recover-from-error/missing-module/0/errors.js +++ b/test/watchCases/recover-from-error/missing-module/0/errors.js @@ -1,3 +1 @@ -module.exports = [ - [/Module not found/, /Can't resolve 'some-module' /] -]; +module.exports = [[/Module not found/, /Can't resolve 'some-module' /]]; diff --git a/test/watchCases/runtime/static-import/test.config.js b/test/watchCases/runtime/static-import/test.config.js index 3d9533c7394..3080b9d1ebf 100644 --- a/test/watchCases/runtime/static-import/test.config.js +++ b/test/watchCases/runtime/static-import/test.config.js @@ -1,6 +1,3 @@ module.exports = { - bundlePath: [ - "./runtime~main.js", - "./main.js" - ] + bundlePath: ["./runtime~main.js", "./main.js"] }; diff --git a/test/watchCases/warnings/warnings-contribute-to-hash/0/warnings.js b/test/watchCases/warnings/warnings-contribute-to-hash/0/warnings.js index 968e3ec0117..77561d2bebb 100644 --- a/test/watchCases/warnings/warnings-contribute-to-hash/0/warnings.js +++ b/test/watchCases/warnings/warnings-contribute-to-hash/0/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/Warning1/] -]; +module.exports = [[/Warning1/]]; diff --git a/test/watchCases/warnings/warnings-contribute-to-hash/1/warnings.js b/test/watchCases/warnings/warnings-contribute-to-hash/1/warnings.js index 842179a3371..cf7a02b47ff 100644 --- a/test/watchCases/warnings/warnings-contribute-to-hash/1/warnings.js +++ b/test/watchCases/warnings/warnings-contribute-to-hash/1/warnings.js @@ -1,3 +1 @@ -module.exports = [ - [/New Warning/] -]; +module.exports = [[/New Warning/]]; diff --git a/test/watchCases/wasm/caching/test.filter.js b/test/watchCases/wasm/caching/test.filter.js index 23177349638..bd7f4573a77 100644 --- a/test/watchCases/wasm/caching/test.filter.js +++ b/test/watchCases/wasm/caching/test.filter.js @@ -1,5 +1,5 @@ var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); -module.exports = function(config) { +module.exports = function (config) { return supportsWebAssembly(); };