diff --git a/.eslintrc.js b/.eslintrc.js index 63413ea48..a70d08eb0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { root: true, - plugins: ["prettier", "node"], + plugins: ["prettier", "node", "jest"], extends: ["eslint:recommended", "plugin:node/recommended", "plugin:prettier/recommended"], env: { node: true, @@ -13,7 +13,6 @@ module.exports = { "prettier/prettier": "error", "no-undef": "error", "no-extra-semi": "error", - "semi": "error", "no-template-curly-in-string": "error", "no-caller": "error", "no-control-regex": "off", @@ -30,7 +29,20 @@ module.exports = { "no-loop-func": "warn", "indent": "off", "no-console": "off", - "valid-jsdoc": "error", + "valid-jsdoc": ["error", { + "prefer": { + "return": "returns", + "memberof": "DONTUSE", + "class": "DONTUSE", + "inheritdoc": "DONTUSE", + "description": "DONTUSE", + "readonly": "DONTUSE" + }, + "preferType": { + "*": "any" + }, + "requireReturnType": true + }], "node/no-unsupported-features": "error", "node/no-deprecated-api": "error", "node/no-missing-import": "error", @@ -56,7 +68,7 @@ module.exports = { { files: ["test/**/*.js"], env: { - mocha: true, + "jest/globals": true } } ] diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 000000000..0404afc28 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,40 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + + + + +# Bug report + + + + + + +**What is the current behavior?** + + +**If the current behavior is a bug, please provide the steps to reproduce.** + + + + + + + + + +**What is the expected behavior?** + + + + + +**Other relevant information:** +webpack version: +Node.js version: +Operating System: +Additional tools: diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 000000000..e23f20d97 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,27 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + + + +## Feature request + + + + + + + +**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 new file mode 100644 index 000000000..5e5b62bd6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Other.md @@ -0,0 +1,9 @@ +--- +name: Other +about: Something else + +--- + + + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7af602ab9..8967c8f01 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,9 @@ + + + + + **What kind of change does this PR introduce?** @@ -8,17 +13,11 @@ -**If relevant, link to documentation update:** - - - -**Summary** - - - - **Does this PR introduce a breaking change?** -**Other information** +**What needs to be documented once your changes are merged?** + + + diff --git a/.gitignore b/.gitignore index f7a05a2b8..32814bb49 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ *.log .idea .vscode +.eslintcache package-lock.json diff --git a/.travis.yml b/.travis.yml index a1f10e144..88f661c3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,25 +10,41 @@ branches: cache: yarn: true +stages: + - basic + - advanced + - versions + matrix: include: - os: linux - node_js: "8" + node_js: "10" + env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=basic + stage: basic + - os: linux + node_js: "10" env: NO_WATCH_TESTS=1 JOB_PART=lint + stage: advanced - os: linux - node_js: "8" - env: NO_WATCH_TESTS=1 JOB_PART=integration + node_js: "10" + env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration + stage: advanced - os: linux - node_js: "8" + node_js: "10" env: NO_WATCH_TESTS=1 JOB_PART=unit + stage: advanced + - os: osx + node_js: "10" + env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration + stage: versions + - os: linux + node_js: "8" + env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration + stage: versions - os: linux node_js: "6" - env: NO_WATCH_TESTS=1 JOB_PART=integration - - os: osx - node_js: "8" - env: NO_WATCH_TESTS=1 JOB_PART=integration - allow_failures: - - os: osx + env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration + stage: versions fast_finish: true install: @@ -40,7 +56,7 @@ script: npm run travis:$JOB_PART after_success: - cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose - - bash <(curl -s https://codecov.io/bash) -F $JOB_PART + - bash <(curl -s https://codecov.io/bash) -F $JOB_PART -X gcov - rm -rf ./coverage notifications: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47b8a2ced..3364e3808 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,17 +11,23 @@ Most of the time, if webpack is not working correctly for you it is a simple con If you are still having difficulty after looking over your configuration carefully, please post a question to [StackOverflow with the webpack tag](http://stackoverflow.com/tags/webpack). Questions -that include your webpack.config.js and relevant files are more likely to receive responses. +that include your webpack.config.js, relevant files, and the full error message are more likely to receive responses. **If you have discovered a bug or have a feature suggestion, please [create an issue on GitHub](https://github.com/webpack/webpack/issues/new).** +Do you want to fix an issue? Look at the issues with a tag of [X5: work required (PR / Help Wanted)](https://github.com/webpack/webpack/labels/X5%3A%20work%20required%20%28PR%20%2F%20Help%20Wanted%29). Each issue should be tagged with a difficulty tag - + +- D0: My First Commit (Contribution Difficulty) +- D1: Easy (Contribution Difficulty) +- D2: Medium (Contribution Difficulty) +- D3: Hard (Contribution Difficulty) + ## Contributing to the webpack ecosystem -If you have created your own loader/plugin please include it on the relevant -documentation pages: +If you have created your own loader/plugin please include it on the relevant documentation pages: -[List of loaders](https://webpack.js.org/loaders/) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#loaders) -[List of plugins](https://webpack.js.org/plugins) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins) +- [List of loaders](https://webpack.js.org/loaders/) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#loaders) +- [List of plugins](https://webpack.js.org/plugins) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins) ## Setup @@ -43,7 +49,7 @@ Some things that will increase the chance that your pull request is accepted: webpack is insanely feature rich and documentation is a huge time sink. We greatly appreciate any time spent fixing typos or clarifying sections in the -documentation. +documentation. [See a list of issues with the documentation tag.](https://github.com/webpack/webpack/labels/documentation) ## Discussions diff --git a/README.md b/README.md index 9a8c423f8..ef71f20eb 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,8 @@ We consider webpack to be a low-level tool used not only individually but also l If you're just getting started, take a look at [our new docs and concepts page](https://webpack.js.org/concepts/). This has a high level overview that is great for beginners!! +Looking for webpack 1 docs? Please check out the old [wiki](https://github.com/webpack/docs/wiki/contents), but note that this deprecated version is no longer supported. + If you want to discuss something or just need help, [here is our Gitter room](https://gitter.im/webpack/webpack) where there are always individuals looking to help out! If you are still having difficulty, we would love for you to post diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..0551ac700 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +# Reporting Security Issues + +If you discover a security issue in webpack, please report it by sending an +email to [webpack@opencollective.com](mailto:webpack@opencollective.com). + +This will allow us to assess the risk, and make a fix available before we add a +bug report to the GitHub repository. + +Thanks for helping make webpack safe for everyone. diff --git a/_SETUP.md b/_SETUP.md index a663b37ef..8c080252e 100644 --- a/_SETUP.md +++ b/_SETUP.md @@ -10,19 +10,73 @@ That's all. ## Setup manually -Setup your local webpack repository +### Setup your local webpack repository ```bash git clone https://github.com/webpack/webpack.git cd webpack npm install -g yarn -yarn install +yarn yarn link yarn link webpack ``` -To run the entire test suite use: +### To run the entire test suite use ```bash yarn test ``` + +### To run only intergration tests use + +```bash +yarn test:integration +``` + +or in watch mode + +```bash +yarn test:integration --watch +``` + +### To run only unit tests use + +```bash +yarn test:unit +``` + +or in watch mode + +```bash +yarn test:unit --watch +``` + +### To run code formatter (prettier) run + +```bash +yarn pretty +``` + +### To run all linters use + +This performs linting on: + +* eslint (code-lint script) +* schema (schema-lint script) +* types (type-lint script) + +```bash +yarn lint +``` + +### To run only the typechecker use + +```bash +yarn type-lint +``` + +or incremental (in watch mode) + +```bash +yarn type-lint --watch +``` diff --git a/appveyor.yml b/appveyor.yml index eb4b7f0ec..0e9fc6f4f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,8 +16,10 @@ environment: job_part: unit - nodejs_version: 8 job_part: integration + jest: --maxWorkers=2 - nodejs_version: 6 job_part: integration + jest: --maxWorkers=2 install: - ps: Install-Product node $env:nodejs_version x64 @@ -33,7 +35,8 @@ matrix: test_script: - node --version - - npm --version - yarn --version - - cmd: npm run appveyor:%job_part% - - cmd: npm install -g codecov && codecov -F %job_part% + - cmd: set JEST=%jest% + - cmd: yarn appveyor:%job_part% + - cmd: yarn unlink webpack + - cmd: yarn global add codecov && codecov -F %job_part% --disable=gcov diff --git a/bin/webpack.js b/bin/webpack.js index 9d83f9bef..389bc9527 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -1,8 +1,16 @@ #!/usr/bin/env node -function runCommand(command, options) { + +process.exitCode = 0; + +/** + * @param {string} command process to run + * @param {string[]} args commandline arguments + * @returns {Promise} promise + */ +const runCommand = (command, args) => { const cp = require("child_process"); return new Promise((resolve, reject) => { - const executedCommand = cp.spawn(command, options, { + const executedCommand = cp.spawn(command, args, { stdio: "inherit", shell: true }); @@ -13,69 +21,146 @@ function runCommand(command, options) { executedCommand.on("exit", code => { if (code === 0) { - resolve(true); + resolve(); } else { reject(); } }); }); -} +}; -let webpackCliInstalled = false; -try { - require.resolve("webpack-cli"); - webpackCliInstalled = true; -} catch (err) { - webpackCliInstalled = false; -} +/** + * @param {string} packageName name of the package + * @returns {boolean} is the package installed? + */ +const isInstalled = packageName => { + try { + require.resolve(packageName); -if (!webpackCliInstalled) { + return true; + } catch (err) { + return false; + } +}; + +/** + * @typedef {Object} CliOption + * @property {string} name display name + * @property {string} package npm package name + * @property {string} alias shortcut for choice + * @property {boolean} installed currently installed? + * @property {string} url homepage + * @property {string} description description + */ + +/** @type {CliOption[]} */ +const CLIs = [ + { + name: "webpack-cli", + package: "webpack-cli", + alias: "cli", + installed: isInstalled("webpack-cli"), + url: "https://github.com/webpack/webpack-cli", + description: "The original webpack full-featured CLI." + }, + { + name: "webpack-command", + package: "webpack-command", + alias: "command", + installed: isInstalled("webpack-command"), + url: "https://github.com/webpack-contrib/webpack-command", + description: "A lightweight, opinionated webpack CLI." + } +]; + +const installedClis = CLIs.filter(cli => cli.installed); + +if (installedClis.length === 0) { const path = require("path"); const fs = require("fs"); const readLine = require("readline"); + + let notify = + "One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:"; + + for (const item of CLIs) { + notify += `\n - ${item.name} (${item.url})\n ${item.description}`; + } + + console.error(notify); + const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock")); const packageManager = isYarn ? "yarn" : "npm"; - const options = ["install", "-D", "webpack-cli"]; + const installOptions = [isYarn ? "add" : "install", "-D"]; - if (isYarn) { - options[0] = "add"; - } + console.error( + `We will use "${packageManager}" to install the CLI via "${packageManager} ${installOptions.join( + " " + )}".` + ); - const commandToBeRun = `${packageManager} ${options.join(" ")}`; + let question = `Which one do you like to install (${CLIs.map( + item => item.name + ).join("/")}):\n`; - const question = `Would you like to install webpack-cli? (That will run ${commandToBeRun}) (yes/NO)`; - - console.error("The CLI moved into a separate package: webpack-cli"); const questionInterface = readLine.createInterface({ input: process.stdin, - output: process.stdout + output: process.stderr }); questionInterface.question(question, answer => { questionInterface.close(); - switch (answer.toLowerCase()) { - case "y": - case "yes": - case "1": { - runCommand(packageManager, options) - .then(result => { - return require("webpack-cli"); //eslint-disable-line - }) - .catch(error => { - console.error(error); - process.exitCode = 1; - }); - break; - } - default: { - console.error( - "It needs to be installed alongside webpack to use the CLI" - ); - process.exitCode = 1; - break; - } + + const normalizedAnswer = answer.toLowerCase(); + const selectedPackage = CLIs.find(item => { + return item.name === normalizedAnswer || item.alias === normalizedAnswer; + }); + + if (!normalizedAnswer) { + console.error( + "One CLI needs to be installed alongside webpack to use the CLI." + ); + process.exitCode = 1; + + return; + } else if (!selectedPackage) { + console.error( + "No matching choice.\n" + + "One CLI needs to be installed alongside webpack to use the CLI.\n" + + "Try to installing your CLI of choice manually." + ); + process.exitCode = 1; + + return; } + + const packageName = selectedPackage.package; + + console.log( + `Installing '${ + selectedPackage.name + }' (running '${packageManager} ${installOptions.join( + " " + )} ${packageName}')...` + ); + + runCommand(packageManager, installOptions.concat(packageName)) + .then(() => { + require(packageName); //eslint-disable-line + }) + .catch(error => { + console.error(error); + process.exitCode = 1; + }); }); +} else if (installedClis.length === 1) { + require(installedClis[0].package); // eslint-disable-line } else { - require("webpack-cli"); // eslint-disable-line + console.warn( + `You have installed ${installedClis + .map(item => item.name) + .join( + " and " + )} together. To work with the "webpack" command you need only one CLI package, please remove one of them or use them directly via their binary.` + ); } diff --git a/codecov.yml b/codecov.yml index 9359b370b..0ce74197d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -7,6 +7,9 @@ coverage: status: project: default: off + basic: + flags: basic + target: auto integration: flags: integration target: auto @@ -15,6 +18,10 @@ coverage: target: 0% patch: default: off + integration: + flags: integration + target: 90% + base: pr integration: flags: integration target: 90% @@ -25,6 +32,9 @@ coverage: base: pr changes: default: off + basic: + flags: basic + target: 0% integration: flags: integration target: 0% @@ -32,3 +42,8 @@ coverage: flags: unit target: 0% comment: off +flags: + basic: + joined: false + unit: + joined: false diff --git a/declarations.d.ts b/declarations.d.ts index ea092bdb3..472222ea0 100644 --- a/declarations.d.ts +++ b/declarations.d.ts @@ -1,5 +1,4 @@ declare module "*.json"; -declare module "webpack-cli"; // Deprecated NodeJS API usages in Webpack declare namespace NodeJS { @@ -9,28 +8,98 @@ declare namespace NodeJS { } // There are no typings for chrome-trace-event -declare module 'chrome-trace-event' { +declare module "chrome-trace-event" { interface Event { - name: string - id?: number - cat: string[] - args?: Object + name: string; + id?: number; + cat: string[]; + args?: Object; } export class Tracer { - constructor(options: { - noStream: boolean - }) - pipe(stream: NodeJS.WritableStream) : void - instantEvent(event: Event) : void - counter: number + constructor(options: { noStream: boolean }); + pipe(stream: NodeJS.WritableStream): void; + instantEvent(event: Event): void; + counter: number; trace: { - begin(event: Event) : void - end(event: Event) : void - } + begin(event: Event): void; + end(event: Event): void; + }; } } +// There are no typings for @webassemblyjs/ast +declare module "@webassemblyjs/ast" { + export function traverse( + ast: any, + visitor: { + ModuleImport?: (p: NodePath) => void; + ModuleExport?: (p: NodePath) => void; + Start?: (p: NodePath) => void; + } + ); + export class NodePath { + node: T; + } + export class Node {} + export class Identifier extends Node { + value: string; + } + export class Start extends Node { + index: Identifier; + } + export class ModuleImport extends Node { + module: string; + descr: { + type: string; + valtype: string; + id: string; + }; + name: string; + } + export class ModuleExport extends Node { + name: string; + } + export class IndexLiteral extends Node {} + export class NumberLiteral extends Node {} + export class Global extends Node {} + export class FuncParam extends Node {} + export class Instruction extends Node {} + export class CallInstruction extends Instruction {} + export class ObjectInstruction extends Instruction {} + export class Func extends Node { + signature: Signature; + } + export class Signature { + params: any; + result: any; + } + export class TypeInstructionFunc extends Node {} + export class IndexInFuncSection extends Node {} + export function indexLiteral(index: number): IndexLiteral; + export function numberLiteral(num: number): NumberLiteral; + export function global(globalType: string, nodes: Node[]): Global; + export function identifier(indentifier: string): Identifier; + export function funcParam(valType: string, id: Identifier): FuncParam; + export function instruction(inst: string, args: Node[]): Instruction; + export function callInstruction(funcIndex: IndexLiteral): CallInstruction; + export function objectInstruction( + kind: string, + type: string, + init: Node[] + ): ObjectInstruction; + export function func(initFuncId, funcParams, funcResults, funcBody): Func; + export function typeInstructionFunc(params, result): TypeInstructionFunc; + export function indexInFuncSection(index: IndexLiteral): IndexInFuncSection; + export function moduleExport( + identifier: string, + type: string, + index: IndexLiteral + ): ModuleExport; + + export function getSectionMetadata(ast: any, section: string); +} + /** * Global variable declarations * @todo Once this issue is resolved, remove these globals and add JSDoc onsite instead @@ -53,3 +122,5 @@ declare const WebAssembly; declare const importScripts; declare const $crossOriginLoading$; declare const chunkId; + +type TODO = any; diff --git a/examples/aggressive-merging/README.md b/examples/aggressive-merging/README.md index ff31b46d9..02c4c1422 100644 --- a/examples/aggressive-merging/README.md +++ b/examples/aggressive-merging/README.md @@ -60,94 +60,94 @@ module.exports = { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.chunk.js 5.98 KiB 0 [emitted] 1.chunk.js 405 bytes 1 [emitted] -pageC.bundle.js 7.05 KiB 2 [emitted] pageC -pageB.bundle.js 7.05 KiB 3 [emitted] pageB -pageA.bundle.js 7.05 KiB 4 [emitted] pageA +pageC.bundle.js 7.32 KiB 2 [emitted] pageC +pageB.bundle.js 7.32 KiB 3 [emitted] pageB +pageA.bundle.js 7.32 KiB 4 [emitted] pageA Entrypoint pageA = pageA.bundle.js Entrypoint pageB = pageB.bundle.js Entrypoint pageC = pageC.bundle.js chunk {0} 0.chunk.js 5.46 KiB <{3}> <{4}> [rendered] > ./common [4] ./pageB.js 1:0-3:2 > ./common [5] ./pageA.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 - [2] ./common.js 5.42 KiB {0} [built] - amd require ./common [4] ./pageB.js 1:0-3:2 - amd require ./common [5] ./pageA.js 1:0-3:2 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 + [2] ./common.js 5.42 KiB {0} [built] + amd require ./common [4] ./pageB.js 1:0-3:2 + amd require ./common [5] ./pageA.js 1:0-3:2 chunk {1} 1.chunk.js 42 bytes <{2}> [rendered] > ./a [3] ./pageC.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 chunk {2} pageC.bundle.js (pageC) 70 bytes >{1}< [entry] [rendered] > ./pageC pageC - [3] ./pageC.js 70 bytes {2} [built] - single entry ./pageC pageC + [3] ./pageC.js 70 bytes {2} [built] + single entry ./pageC pageC chunk {3} pageB.bundle.js (pageB) 71 bytes >{0}< [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 71 bytes {3} [built] - single entry ./pageB pageB + [4] ./pageB.js 71 bytes {3} [built] + single entry ./pageB pageB chunk {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered] > ./pageA pageA - [5] ./pageA.js 71 bytes {4} [built] - single entry ./pageA pageA + [5] ./pageA.js 71 bytes {4} [built] + single entry ./pageA pageA ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.chunk.js 173 bytes 0, 1 [emitted] 1.chunk.js 118 bytes 1 [emitted] -pageC.bundle.js 1.67 KiB 2 [emitted] pageC -pageB.bundle.js 1.66 KiB 3 [emitted] pageB -pageA.bundle.js 1.66 KiB 4 [emitted] pageA +pageC.bundle.js 1.7 KiB 2 [emitted] pageC +pageB.bundle.js 1.69 KiB 3 [emitted] pageB +pageA.bundle.js 1.69 KiB 4 [emitted] pageA Entrypoint pageA = pageA.bundle.js Entrypoint pageB = pageB.bundle.js Entrypoint pageC = pageC.bundle.js chunk {0} 0.chunk.js 5.46 KiB <{3}> <{4}> [rendered] > ./common [4] ./pageB.js 1:0-3:2 > ./common [5] ./pageA.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 - [2] ./common.js 5.42 KiB {0} [built] - amd require ./common [4] ./pageB.js 1:0-3:2 - amd require ./common [5] ./pageA.js 1:0-3:2 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 + [2] ./common.js 5.42 KiB {0} [built] + amd require ./common [4] ./pageB.js 1:0-3:2 + amd require ./common [5] ./pageA.js 1:0-3:2 chunk {1} 1.chunk.js 42 bytes <{2}> [rendered] > ./a [3] ./pageC.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 chunk {2} pageC.bundle.js (pageC) 70 bytes >{1}< [entry] [rendered] > ./pageC pageC - [3] ./pageC.js 70 bytes {2} [built] - single entry ./pageC pageC + [3] ./pageC.js 70 bytes {2} [built] + single entry ./pageC pageC chunk {3} pageB.bundle.js (pageB) 71 bytes >{0}< [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 71 bytes {3} [built] - single entry ./pageB pageB + [4] ./pageB.js 71 bytes {3} [built] + single entry ./pageB pageB chunk {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered] > ./pageA pageA - [5] ./pageA.js 71 bytes {4} [built] - single entry ./pageA pageA + [5] ./pageA.js 71 bytes {4} [built] + single entry ./pageA pageA ``` diff --git a/examples/chunkhash/README.md b/examples/chunkhash/README.md index 68bf052d0..e02b81676 100644 --- a/examples/chunkhash/README.md +++ b/examples/chunkhash/README.md @@ -45,7 +45,7 @@ module.exports = { @@ -112,12 +112,19 @@ module.exports = { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ var deferredModules = []; /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".[chunkhash].js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -173,7 +180,7 @@ module.exports = { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".[chunkhash].js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -287,25 +294,25 @@ __webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpac ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names main.[chunkhash].js 877 bytes 0 [emitted] main 1.[chunkhash].js 270 bytes 1 [emitted] 2.[chunkhash].js 264 bytes 2 [emitted] -runtime~main.[chunkhash].js 7.48 KiB 3 [emitted] runtime~main +runtime~main.[chunkhash].js 7.75 KiB 3 [emitted] runtime~main Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js chunk {0} main.[chunkhash].js (main) 55 bytes ={3}= >{1}< >{2}< [initial] [rendered] > ./example main - [0] ./example.js 55 bytes {0} [built] - single entry ./example main + [0] ./example.js 55 bytes {0} [built] + single entry ./example main chunk {1} 1.[chunkhash].js 29 bytes <{0}> <{3}> [rendered] > ./async1 [0] ./example.js 2:0-18 - [1] ./async1.js 29 bytes {1} [built] - import() ./async1 [0] ./example.js 2:0-18 + [1] ./async1.js 29 bytes {1} [built] + import() ./async1 [0] ./example.js 2:0-18 chunk {2} 2.[chunkhash].js 29 bytes <{0}> <{3}> [rendered] > ./async2 [0] ./example.js 3:0-18 - [2] ./async2.js 29 bytes {2} [built] - import() ./async2 [0] ./example.js 3:0-18 + [2] ./async2.js 29 bytes {2} [built] + import() ./async2 [0] ./example.js 3:0-18 chunk {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2}< [entry] [rendered] > ./example main ``` @@ -314,25 +321,25 @@ chunk {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2} ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.[chunkhash].js 77 bytes 0 [emitted] 1.[chunkhash].js 78 bytes 1 [emitted] -runtime~main.[chunkhash].js 1.76 KiB 2 [emitted] runtime~main +runtime~main.[chunkhash].js 1.79 KiB 2 [emitted] runtime~main main.[chunkhash].js 349 bytes 3 [emitted] main Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js chunk {0} 0.[chunkhash].js 29 bytes <{2}> <{3}> [rendered] > ./async2 [0] ./example.js 3:0-18 - [1] ./async2.js 29 bytes {0} [built] - import() ./async2 [0] ./example.js 3:0-18 + [1] ./async2.js 29 bytes {0} [built] + import() ./async2 [0] ./example.js 3:0-18 chunk {1} 1.[chunkhash].js 29 bytes <{2}> <{3}> [rendered] > ./async1 [0] ./example.js 2:0-18 - [2] ./async1.js 29 bytes {1} [built] - import() ./async1 [0] ./example.js 2:0-18 + [2] ./async1.js 29 bytes {1} [built] + import() ./async1 [0] ./example.js 2:0-18 chunk {2} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={3}= >{0}< >{1}< [entry] [rendered] > ./example main chunk {3} main.[chunkhash].js (main) 55 bytes ={2}= >{0}< >{1}< [initial] [rendered] > ./example main - [0] ./example.js 55 bytes {3} [built] - single entry ./example main + [0] ./example.js 55 bytes {3} [built] + single entry ./example main ``` diff --git a/examples/code-splitted-require.context-amd/README.md b/examples/code-splitted-require.context-amd/README.md index 062bba8bb..07a7855e2 100644 --- a/examples/code-splitted-require.context-amd/README.md +++ b/examples/code-splitted-require.context-amd/README.md @@ -52,12 +52,19 @@ getTemplate("b", function(b) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -113,7 +120,7 @@ getTemplate("b", function(b) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -252,7 +259,7 @@ function webpackContext(req) { function webpackContextResolve(req) { var id = map[req]; if(!(id + 1)) { // check for number or string - var e = new Error('Cannot find module "' + req + '".'); + var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } @@ -311,54 +318,54 @@ module.exports = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 1.86 KiB 0 [emitted] - output.js 7.19 KiB 1 [emitted] main + output.js 7.46 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - amd require context ../require.context/templates [0] ./example.js 2:1-4:3 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + amd require context ../require.context/templates [0] ./example.js 2:1-4:3 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 261 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 261 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 261 bytes {1} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 627 bytes 0 [emitted] - output.js 1.75 KiB 1 [emitted] main + output.js 1.78 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - amd require context ../require.context/templates [0] ./example.js 2:1-4:3 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + amd require context ../require.context/templates [0] ./example.js 2:1-4:3 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 261 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 261 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 261 bytes {1} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitted-require.context/README.md b/examples/code-splitted-require.context/README.md index 08db4e513..c1251d653 100644 --- a/examples/code-splitted-require.context/README.md +++ b/examples/code-splitted-require.context/README.md @@ -52,12 +52,19 @@ getTemplate("b", function(b) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -113,7 +120,7 @@ getTemplate("b", function(b) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -252,7 +259,7 @@ function webpackContext(req) { function webpackContextResolve(req) { var id = map[req]; if(!(id + 1)) { // check for number or string - var e = new Error('Cannot find module "' + req + '".'); + var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } @@ -311,54 +318,54 @@ module.exports = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 1.86 KiB 0 [emitted] - output.js 7.13 KiB 1 [emitted] main + output.js 7.4 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - cjs require context ../require.context/templates [0] ./example.js 3:11-64 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + cjs require context ../require.context/templates [0] ./example.js 3:11-64 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 276 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 276 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 276 bytes {1} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 627 bytes 0 [emitted] - output.js 1.73 KiB 1 [emitted] main + output.js 1.75 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - cjs require context ../require.context/templates [0] ./example.js 3:11-64 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + cjs require context ../require.context/templates [0] ./example.js 3:11-64 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 276 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 276 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 276 bytes {1} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-bundle-loader/README.md b/examples/code-splitting-bundle-loader/README.md index 320f01a27..a59a581ea 100644 --- a/examples/code-splitting-bundle-loader/README.md +++ b/examples/code-splitting-bundle-loader/README.md @@ -55,12 +55,19 @@ module.exports = "It works"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -116,7 +123,7 @@ module.exports = "It works"; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -266,40 +273,40 @@ module.exports = "It works"; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 257 bytes 0 [emitted] - output.js 7.56 KiB 1 [emitted] main + output.js 7.82 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 28 bytes <{1}> [rendered] > [0] (webpack)/node_modules/bundle-loader!./file.js 7:0-14:2 - [2] ./file.js 28 bytes {0} [built] - cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 + [2] ./file.js 28 bytes {0} [built] + cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 chunk {1} output.js (main) 378 bytes >{0}< [entry] [rendered] > .\example.js main - [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] - cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 - [1] ./example.js 97 bytes {1} [built] - single entry .\example.js main + [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] + cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 + [1] ./example.js 97 bytes {1} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 98 bytes 0 [emitted] - output.js 1.79 KiB 1 [emitted] main + output.js 1.81 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 28 bytes <{1}> [rendered] > [0] (webpack)/node_modules/bundle-loader!./file.js 7:0-14:2 - [2] ./file.js 28 bytes {0} [built] - cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 + [2] ./file.js 28 bytes {0} [built] + cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 chunk {1} output.js (main) 378 bytes >{0}< [entry] [rendered] > .\example.js main - [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] - cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 - [1] ./example.js 97 bytes {1} [built] - single entry .\example.js main + [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] + cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 + [1] ./example.js 97 bytes {1} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-harmony/README.md b/examples/code-splitting-harmony/README.md index 275722283..c3e9e9d4c 100644 --- a/examples/code-splitting-harmony/README.md +++ b/examples/code-splitting-harmony/README.md @@ -63,12 +63,19 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -124,7 +131,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -241,7 +248,7 @@ function webpackAsyncContext(req) { var ids = map[req]; if(!ids) { return Promise.resolve().then(function() { - var e = new Error('Cannot find module "' + req + '".'); + var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; }); @@ -305,12 +312,12 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 275 bytes 0 [emitted] 1.output.js 284 bytes 1 [emitted] 2.output.js 270 bytes 2 [emitted] - output.js 8.84 KiB 3 [emitted] main + output.js 9.11 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 13 bytes <{3}> [rendered] > ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2 @@ -325,11 +332,11 @@ chunk {2} 2.output.js 11 bytes <{3}> [rendered] 1 module chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] - import() context lazy c [4] ./example.js 8:8-27 - [4] ./example.js 256 bytes {3} [built] - [no exports] - single entry .\example.js main + [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] + import() context lazy c [4] ./example.js 8:8-27 + [4] ./example.js 256 bytes {3} [built] + [no exports] + single entry .\example.js main + 1 hidden module ``` @@ -337,12 +344,12 @@ chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 76 bytes 0 [emitted] 1.output.js 77 bytes 1 [emitted] 2.output.js 78 bytes 2 [emitted] - output.js 2.33 KiB 3 [emitted] main + output.js 2.35 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 13 bytes <{3}> [rendered] > ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2 @@ -357,10 +364,10 @@ chunk {2} 2.output.js 11 bytes <{3}> [rendered] 1 module chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] - import() context lazy c [4] ./example.js 8:8-27 - [4] ./example.js 256 bytes {3} [built] - [no exports] - single entry .\example.js main + [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] + import() context lazy c [4] ./example.js 8:8-27 + [4] ./example.js 256 bytes {3} [built] + [no exports] + single entry .\example.js main + 1 hidden module ``` diff --git a/examples/code-splitting-native-import-context-filter/README.md b/examples/code-splitting-native-import-context-filter/README.md index cd137dac0..86f2a9e91 100644 --- a/examples/code-splitting-native-import-context-filter/README.md +++ b/examples/code-splitting-native-import-context-filter/README.md @@ -81,12 +81,19 @@ export default foo; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -142,7 +149,7 @@ export default foo; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -268,7 +275,7 @@ function webpackAsyncContext(req) { var ids = map[req]; if(!ids) { return Promise.resolve().then(function() { - var e = new Error('Cannot find module "' + req + '".'); + var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; }); @@ -321,78 +328,78 @@ getTemplate("baz.noimport"); ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 433 bytes 0 [emitted] 1.output.js 442 bytes 1 [emitted] 2.output.js 436 bytes 2 [emitted] - output.js 8.21 KiB 3 [emitted] main + output.js 8.47 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 38 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - [0] ./templates/foo.js 38 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + [0] ./templates/foo.js 38 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo chunk {1} 1.output.js 38 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - [1] ./templates/baz.js 38 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + [1] ./templates/baz.js 38 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz chunk {2} 2.output.js 38 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - [2] ./templates/bar.js 38 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + [2] ./templates/bar.js 38 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar chunk {3} output.js (main) 597 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-7:3 - [4] ./example.js 437 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-7:3 + [4] ./example.js 437 bytes {3} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 113 bytes 0 [emitted] 1.output.js 114 bytes 1 [emitted] 2.output.js 115 bytes 2 [emitted] - output.js 2.13 KiB 3 [emitted] main + output.js 2.16 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 38 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - [0] ./templates/foo.js 38 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + [0] ./templates/foo.js 38 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo chunk {1} 1.output.js 38 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - [1] ./templates/baz.js 38 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + [1] ./templates/baz.js 38 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz chunk {2} 2.output.js 38 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - [2] ./templates/bar.js 38 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + [2] ./templates/bar.js 38 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar chunk {3} output.js (main) 597 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-7:3 - [4] ./example.js 437 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-7:3 + [4] ./example.js 437 bytes {3} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-native-import-context/README.md b/examples/code-splitting-native-import-context/README.md index 0bd870532..f751eb9b2 100644 --- a/examples/code-splitting-native-import-context/README.md +++ b/examples/code-splitting-native-import-context/README.md @@ -70,12 +70,19 @@ export default foo; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -131,7 +138,7 @@ export default foo; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -257,7 +264,7 @@ function webpackAsyncContext(req) { var ids = map[req]; if(!ids) { return Promise.resolve().then(function() { - var e = new Error('Cannot find module "' + req + '".'); + var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; }); @@ -308,78 +315,78 @@ getTemplate("baz"); ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 436 bytes 0 [emitted] 1.output.js 445 bytes 1 [emitted] 2.output.js 439 bytes 2 [emitted] - output.js 8.03 KiB 3 [emitted] main + output.js 8.3 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 41 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - [0] ./templates/foo.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo + [0] ./templates/foo.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo chunk {1} 1.output.js 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz chunk {2} 2.output.js 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar chunk {3} output.js (main) 456 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-60 - [4] ./example.js 296 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-60 + [4] ./example.js 296 bytes {3} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 113 bytes 0 [emitted] 1.output.js 114 bytes 1 [emitted] 2.output.js 115 bytes 2 [emitted] - output.js 2.09 KiB 3 [emitted] main + output.js 2.12 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 41 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - [0] ./templates/foo.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo + [0] ./templates/foo.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo chunk {1} 1.output.js 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz chunk {2} 2.output.js 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar chunk {3} output.js (main) 456 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-60 - [4] ./example.js 296 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-60 + [4] ./example.js 296 bytes {3} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-specify-chunk-name/README.md b/examples/code-splitting-specify-chunk-name/README.md index c97dced35..16638fad9 100644 --- a/examples/code-splitting-specify-chunk-name/README.md +++ b/examples/code-splitting-specify-chunk-name/README.md @@ -70,12 +70,19 @@ export default foo; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -131,7 +138,7 @@ export default foo; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -249,7 +256,7 @@ function webpackAsyncContext(req) { var ids = map[req]; if(!ids) { return Promise.resolve().then(function() { - var e = new Error('Cannot find module "' + req + '".'); + var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; }); @@ -300,78 +307,78 @@ __webpack_require__(3)("./ba" + createContextVar).then(function(bar) { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 445 bytes 0 [emitted] chunk-bar-baz2 1.output.js 439 bytes 1 [emitted] chunk-bar-baz0 2.output.js 436 bytes 2 [emitted] chunk-foo - output.js 8.23 KiB 3 [emitted] main + output.js 8.5 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js (chunk-bar-baz2) 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz chunk {1} 1.output.js (chunk-bar-baz0) 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar chunk {2} 2.output.js (chunk-foo) 41 bytes <{3}> [rendered] > ./templates/foo [4] ./example.js 1:0-62 > [4] ./example.js 5:0-8:16 - [0] ./templates/foo.js 41 bytes {2} [built] - [exports: default] - import() ./templates/foo [4] ./example.js 1:0-62 - cjs require ./templates/foo [4] ./example.js 6:11-37 + [0] ./templates/foo.js 41 bytes {2} [built] + [exports: default] + import() ./templates/foo [4] ./example.js 1:0-62 + cjs require ./templates/foo [4] ./example.js 6:11-37 chunk {3} output.js (main) 580 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] - import() context lazy ./templates [4] ./example.js 11:0-84 - [4] ./example.js 420 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] + import() context lazy ./templates [4] ./example.js 11:0-84 + [4] ./example.js 420 bytes {3} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 114 bytes 0 [emitted] chunk-bar-baz2 1.output.js 115 bytes 1 [emitted] chunk-bar-baz0 2.output.js 113 bytes 2 [emitted] chunk-foo - output.js 2.12 KiB 3 [emitted] main + output.js 2.14 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js (chunk-bar-baz2) 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz chunk {1} 1.output.js (chunk-bar-baz0) 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar chunk {2} 2.output.js (chunk-foo) 41 bytes <{3}> [rendered] > ./templates/foo [4] ./example.js 1:0-62 > [4] ./example.js 5:0-8:16 - [0] ./templates/foo.js 41 bytes {2} [built] - [exports: default] - import() ./templates/foo [4] ./example.js 1:0-62 - cjs require ./templates/foo [4] ./example.js 6:11-37 + [0] ./templates/foo.js 41 bytes {2} [built] + [exports: default] + import() ./templates/foo [4] ./example.js 1:0-62 + cjs require ./templates/foo [4] ./example.js 6:11-37 chunk {3} output.js (main) 580 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] - import() context lazy ./templates [4] ./example.js 11:0-84 - [4] ./example.js 420 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] + import() context lazy ./templates [4] ./example.js 11:0-84 + [4] ./example.js 420 bytes {3} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting/README.md b/examples/code-splitting/README.md index 409dc05ba..c6dd19640 100644 --- a/examples/code-splitting/README.md +++ b/examples/code-splitting/README.md @@ -74,12 +74,19 @@ require.ensure(["c"], function(require) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -135,7 +142,7 @@ require.ensure(["c"], function(require) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -301,18 +308,18 @@ Minimized ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 490 bytes 0 [emitted] - output.js 7.47 KiB 1 [emitted] main + output.js 7.73 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 22 bytes <{1}> [rendered] > [2] ./example.js 3:0-6:2 2 modules chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered] > .\example.js main - [2] ./example.js 144 bytes {1} [built] - single entry .\example.js main + [2] ./example.js 144 bytes {1} [built] + single entry .\example.js main + 2 hidden modules ``` @@ -320,17 +327,17 @@ chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered] ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 95 bytes 0 [emitted] - output.js 1.68 KiB 1 [emitted] main + output.js 1.71 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 22 bytes <{1}> [rendered] > [2] ./example.js 3:0-6:2 2 modules chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered] > .\example.js main - [2] ./example.js 144 bytes {1} [built] - single entry .\example.js main + [2] ./example.js 144 bytes {1} [built] + single entry .\example.js main + 2 hidden modules ``` diff --git a/examples/coffee-script/README.md b/examples/coffee-script/README.md index f857255c0..3f9c31fa5 100644 --- a/examples/coffee-script/README.md +++ b/examples/coffee-script/README.md @@ -153,36 +153,36 @@ module.exports = 42; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 3.35 KiB 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 206 bytes [entry] [rendered] > .\example.js main - [0] ./example.js 31 bytes {0} [built] - single entry .\example.js main - [1] ./cup1.coffee 118 bytes {0} [built] - cjs require ./cup1 [0] ./example.js 1:12-29 - [2] ./cup2.coffee 57 bytes {0} [built] - cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 - cjs require ./cup2 [1] ./cup1.coffee 5:9-26 + [0] ./example.js 31 bytes {0} [built] + single entry .\example.js main + [1] ./cup1.coffee 118 bytes {0} [built] + cjs require ./cup1 [0] ./example.js 1:12-29 + [2] ./cup2.coffee 57 bytes {0} [built] + cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 + cjs require ./cup2 [1] ./cup1.coffee 5:9-26 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 708 bytes 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 206 bytes [entry] [rendered] > .\example.js main - [0] ./cup2.coffee 57 bytes {0} [built] - cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 - cjs require ./cup2 [1] ./cup1.coffee 5:9-26 - [1] ./cup1.coffee 118 bytes {0} [built] - cjs require ./cup1 [2] ./example.js 1:12-29 - [2] ./example.js 31 bytes {0} [built] - single entry .\example.js main + [0] ./cup2.coffee 57 bytes {0} [built] + cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 + cjs require ./cup2 [1] ./cup1.coffee 5:9-26 + [1] ./cup1.coffee 118 bytes {0} [built] + cjs require ./cup1 [2] ./example.js 1:12-29 + [2] ./example.js 31 bytes {0} [built] + single entry .\example.js main ``` \ No newline at end of file diff --git a/examples/common-chunk-and-vendor-chunk/README.md b/examples/common-chunk-and-vendor-chunk/README.md index 89d27e640..f6d5e46aa 100644 --- a/examples/common-chunk-and-vendor-chunk/README.md +++ b/examples/common-chunk-and-vendor-chunk/README.md @@ -195,6 +195,8 @@ module.exports = "utility3"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 0: 0 /******/ }; @@ -368,6 +370,8 @@ module.exports = "utility1"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; @@ -527,6 +531,8 @@ module.exports = "pageB"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 2: 0 /******/ }; @@ -634,11 +640,11 @@ module.exports = "pageC"; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names - pageA.js 5.59 KiB 0 [emitted] pageA - pageB.js 5.39 KiB 1 [emitted] pageB - pageC.js 5.34 KiB 2 [emitted] pageC + pageA.js 5.72 KiB 0 [emitted] pageA + pageB.js 5.52 KiB 1 [emitted] pageB + pageC.js 5.47 KiB 2 [emitted] pageC vendor.js 536 bytes 3 [emitted] vendor commons~pageA~pageB~pageC.js 269 bytes 4 [emitted] commons~pageA~pageB~pageC commons~pageB~pageC.js 269 bytes 5 [emitted] commons~pageB~pageC @@ -647,18 +653,18 @@ Entrypoint pageB = vendor.js commons~pageA~pageB~pageC.js commons~pageB~pageC.js Entrypoint pageC = commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageC.js chunk {0} pageA.js (pageA) 165 bytes ={3}= ={4}= [entry] [rendered] > ./pageA pageA - [0] ./pageA.js 137 bytes {0} [built] - single entry ./pageA pageA - [2] ./utility1.js 28 bytes {0} [built] - cjs require ./utility1 [0] ./pageA.js 2:15-36 + [0] ./pageA.js 137 bytes {0} [built] + single entry ./pageA pageA + [2] ./utility1.js 28 bytes {0} [built] + cjs require ./utility1 [0] ./pageA.js 2:15-36 chunk {1} pageB.js (pageB) 137 bytes ={3}= ={4}= ={5}= [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 137 bytes {1} [built] - single entry ./pageB pageB + [4] ./pageB.js 137 bytes {1} [built] + single entry ./pageB pageB chunk {2} pageC.js (pageC) 105 bytes ={4}= ={5}= [entry] [rendered] > ./pageC pageC - [7] ./pageC.js 105 bytes {2} [built] - single entry ./pageC pageC + [7] ./pageC.js 105 bytes {2} [built] + single entry ./pageC pageC chunk {3} vendor.js (vendor) 54 bytes ={0}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor) > ./pageA pageA > ./pageB pageB @@ -667,23 +673,23 @@ chunk {4} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes = > ./pageA pageA > ./pageB pageB > ./pageC pageC - [3] ./utility2.js 28 bytes {4} [built] - cjs require ./utility2 [0] ./pageA.js 3:15-36 - cjs require ./utility2 [4] ./pageB.js 2:15-36 - cjs require ./utility2 [7] ./pageC.js 1:15-36 + [3] ./utility2.js 28 bytes {4} [built] + cjs require ./utility2 [0] ./pageA.js 3:15-36 + cjs require ./utility2 [4] ./pageB.js 2:15-36 + cjs require ./utility2 [7] ./pageC.js 1:15-36 chunk {5} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={1}= ={2}= ={3}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC) > ./pageB pageB > ./pageC pageC - [6] ./utility3.js 28 bytes {5} [built] - cjs require ./utility3 [4] ./pageB.js 3:15-36 - cjs require ./utility3 [7] ./pageC.js 2:15-36 + [6] ./utility3.js 28 bytes {5} [built] + cjs require ./utility3 [4] ./pageB.js 3:15-36 + cjs require ./utility3 [7] ./pageC.js 2:15-36 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names commons~pageA~pageB~pageC.js 96 bytes 0 [emitted] commons~pageA~pageB~pageC commons~pageB~pageC.js 97 bytes 1 [emitted] commons~pageB~pageC @@ -698,32 +704,32 @@ chunk {0} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes = > ./pageA pageA > ./pageB pageB > ./pageC pageC - [0] ./utility2.js 28 bytes {0} [built] - cjs require ./utility2 [2] ./pageC.js 1:15-36 - cjs require ./utility2 [4] ./pageB.js 2:15-36 - cjs require ./utility2 [7] ./pageA.js 3:15-36 + [0] ./utility2.js 28 bytes {0} [built] + cjs require ./utility2 [2] ./pageC.js 1:15-36 + cjs require ./utility2 [4] ./pageB.js 2:15-36 + cjs require ./utility2 [7] ./pageA.js 3:15-36 chunk {1} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={0}= ={2}= ={3}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC) > ./pageB pageB > ./pageC pageC - [1] ./utility3.js 28 bytes {1} [built] - cjs require ./utility3 [2] ./pageC.js 2:15-36 - cjs require ./utility3 [4] ./pageB.js 3:15-36 + [1] ./utility3.js 28 bytes {1} [built] + cjs require ./utility3 [2] ./pageC.js 2:15-36 + cjs require ./utility3 [4] ./pageB.js 3:15-36 chunk {2} vendor.js (vendor) 54 bytes ={0}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor) > ./pageA pageA > ./pageB pageB 2 modules chunk {3} pageC.js (pageC) 105 bytes ={0}= ={1}= [entry] [rendered] > ./pageC pageC - [2] ./pageC.js 105 bytes {3} [built] - single entry ./pageC pageC + [2] ./pageC.js 105 bytes {3} [built] + single entry ./pageC pageC chunk {4} pageB.js (pageB) 137 bytes ={0}= ={1}= ={2}= [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 137 bytes {4} [built] - single entry ./pageB pageB + [4] ./pageB.js 137 bytes {4} [built] + single entry ./pageB pageB chunk {5} pageA.js (pageA) 165 bytes ={0}= ={2}= [entry] [rendered] > ./pageA pageA - [5] ./utility1.js 28 bytes {5} [built] - cjs require ./utility1 [7] ./pageA.js 2:15-36 - [7] ./pageA.js 137 bytes {5} [built] - single entry ./pageA pageA + [5] ./utility1.js 28 bytes {5} [built] + cjs require ./utility1 [7] ./pageA.js 2:15-36 + [7] ./pageA.js 137 bytes {5} [built] + single entry ./pageA pageA ``` diff --git a/examples/common-chunk-grandchildren/README.md b/examples/common-chunk-grandchildren/README.md index 3a833d7a1..9ce9e748d 100644 --- a/examples/common-chunk-grandchildren/README.md +++ b/examples/common-chunk-grandchildren/README.md @@ -142,12 +142,19 @@ module.exports = { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 4: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -203,7 +210,7 @@ module.exports = { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -430,74 +437,74 @@ module.exports = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 340 bytes 0 [emitted] 1.output.js 549 bytes 1 [emitted] 2.output.js 414 bytes 2 [emitted] 3.output.js 414 bytes 3 [emitted] - output.js 7.53 KiB 4 [emitted] main + output.js 7.79 KiB 4 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) > [0] ./example.js 3:1-6:3 > [2] ./pageB.js 3:1-6:3 - [4] ./reusableComponent.js 72 bytes {0} [built] - cjs require ./reusableComponent [3] ./pageA.js 1:24-54 - cjs require ./reusableComponent [5] ./pageC.js 1:24-54 + [4] ./reusableComponent.js 72 bytes {0} [built] + cjs require ./reusableComponent [3] ./pageA.js 1:24-54 + cjs require ./reusableComponent [5] ./pageC.js 1:24-54 chunk {1} 1.output.js 140 bytes <{4}> >{0}< >{3}< [rendered] > [0] ./example.js 7:1-10:3 - [2] ./pageB.js 140 bytes {1} [built] - cjs require ./pageB [0] ./example.js 8:15-33 + [2] ./pageB.js 140 bytes {1} [built] + cjs require ./pageB [0] ./example.js 8:15-33 chunk {2} 2.output.js 142 bytes <{4}> ={0}= [rendered] > [0] ./example.js 3:1-6:3 - [3] ./pageA.js 142 bytes {2} [built] - cjs require ./pageA [0] ./example.js 4:15-33 + [3] ./pageA.js 142 bytes {2} [built] + cjs require ./pageA [0] ./example.js 4:15-33 chunk {3} 3.output.js 142 bytes <{1}> ={0}= [rendered] > [2] ./pageB.js 3:1-6:3 - [5] ./pageC.js 142 bytes {3} [built] - cjs require ./pageC [2] ./pageB.js 4:15-33 + [5] ./pageC.js 142 bytes {3} [built] + cjs require ./pageC [2] ./pageB.js 4:15-33 chunk {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered] > main - [0] ./example.js 233 bytes {4} [built] - single entry ./example.js [1] multi ./example.js main:100000 - [1] multi ./example.js 28 bytes {4} [built] - multi entry + [0] ./example.js 233 bytes {4} [built] + single entry ./example.js [1] multi ./example.js main:100000 + [1] multi ./example.js 28 bytes {4} [built] + multi entry ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 133 bytes 0 [emitted] 1.output.js 198 bytes 1 [emitted] 2.output.js 138 bytes 2 [emitted] 3.output.js 138 bytes 3 [emitted] - output.js 1.76 KiB 4 [emitted] main + output.js 1.78 KiB 4 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) > [0] ./example.js 3:1-6:3 > [2] ./pageB.js 3:1-6:3 - [4] ./reusableComponent.js 72 bytes {0} [built] - cjs require ./reusableComponent [3] ./pageA.js 1:24-54 - cjs require ./reusableComponent [5] ./pageC.js 1:24-54 + [4] ./reusableComponent.js 72 bytes {0} [built] + cjs require ./reusableComponent [3] ./pageA.js 1:24-54 + cjs require ./reusableComponent [5] ./pageC.js 1:24-54 chunk {1} 1.output.js 140 bytes <{4}> >{0}< >{3}< [rendered] > [0] ./example.js 7:1-10:3 - [2] ./pageB.js 140 bytes {1} [built] - cjs require ./pageB [0] ./example.js 8:15-33 + [2] ./pageB.js 140 bytes {1} [built] + cjs require ./pageB [0] ./example.js 8:15-33 chunk {2} 2.output.js 142 bytes <{4}> ={0}= [rendered] > [0] ./example.js 3:1-6:3 - [3] ./pageA.js 142 bytes {2} [built] - cjs require ./pageA [0] ./example.js 4:15-33 + [3] ./pageA.js 142 bytes {2} [built] + cjs require ./pageA [0] ./example.js 4:15-33 chunk {3} 3.output.js 142 bytes <{1}> ={0}= [rendered] > [2] ./pageB.js 3:1-6:3 - [5] ./pageC.js 142 bytes {3} [built] - cjs require ./pageC [2] ./pageB.js 4:15-33 + [5] ./pageC.js 142 bytes {3} [built] + cjs require ./pageC [2] ./pageB.js 4:15-33 chunk {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered] > main - [0] ./example.js 233 bytes {4} [built] - single entry ./example.js [1] multi ./example.js main:100000 - [1] multi ./example.js 28 bytes {4} [built] - multi entry + [0] ./example.js 233 bytes {4} [built] + single entry ./example.js [1] multi ./example.js main:100000 + [1] multi ./example.js 28 bytes {4} [built] + multi entry ``` diff --git a/examples/commonjs/README.md b/examples/commonjs/README.md index 92f30d4b7..fb85a0b1c 100644 --- a/examples/commonjs/README.md +++ b/examples/commonjs/README.md @@ -167,34 +167,34 @@ exports.add = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 3.44 KiB 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 329 bytes [entry] [rendered] > .\example.js main - [0] ./example.js 69 bytes {0} [built] - single entry .\example.js main - [1] ./increment.js 98 bytes {0} [built] - cjs require ./increment [0] ./example.js 1:10-32 - [2] ./math.js 162 bytes {0} [built] - cjs require ./math [1] ./increment.js 1:10-27 + [0] ./example.js 69 bytes {0} [built] + single entry .\example.js main + [1] ./increment.js 98 bytes {0} [built] + cjs require ./increment [0] ./example.js 1:10-32 + [2] ./math.js 162 bytes {0} [built] + cjs require ./math [1] ./increment.js 1:10-27 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 740 bytes 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 329 bytes [entry] [rendered] > .\example.js main - [0] ./math.js 162 bytes {0} [built] - cjs require ./math [1] ./increment.js 1:10-27 - [1] ./increment.js 98 bytes {0} [built] - cjs require ./increment [2] ./example.js 1:10-32 - [2] ./example.js 69 bytes {0} [built] - single entry .\example.js main + [0] ./math.js 162 bytes {0} [built] + cjs require ./math [1] ./increment.js 1:10-27 + [1] ./increment.js 98 bytes {0} [built] + cjs require ./increment [2] ./example.js 1:10-32 + [2] ./example.js 69 bytes {0} [built] + single entry .\example.js main ``` \ No newline at end of file diff --git a/examples/dll-app-and-vendor/0-vendor/README.md b/examples/dll-app-and-vendor/0-vendor/README.md index 61b4320f6..f8c57e9d7 100644 --- a/examples/dll-app-and-vendor/0-vendor/README.md +++ b/examples/dll-app-and-vendor/0-vendor/README.md @@ -41,7 +41,7 @@ export function square(n) { # dist/vendor.js ``` javascript -var vendor_lib_bc3751dcff9f91451e0e = +var vendor_lib_f3fbcfb4ec389ba5bbf0 = ```
/******/ (function(modules) { /* webpackBootstrap */ }) @@ -157,7 +157,7 @@ function square(n) { # dist/vendor-manifest.json ``` javascript -{"name":"vendor_lib_bc3751dcff9f91451e0e","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","providedExports":["square"]}}}} +{"name":"vendor_lib_f3fbcfb4ec389ba5bbf0","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","providedExports":["square"]}}}} ``` # Info @@ -166,15 +166,15 @@ function square(n) { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names vendor.js 3.32 KiB 0 [emitted] main Entrypoint main = vendor.js chunk {0} vendor.js (main) 60 bytes [entry] [rendered] > main - [0] dll main 12 bytes {0} [built] - dll entry - + [0] dll main 12 bytes {0} [built] + dll entry + + 1 hidden module ``` @@ -182,15 +182,15 @@ chunk {0} vendor.js (main) 60 bytes [entry] [rendered] ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names vendor.js 704 bytes 0 [emitted] main Entrypoint main = vendor.js chunk {0} vendor.js (main) 60 bytes [entry] [rendered] > main - [1] dll main 12 bytes {0} [built] - dll entry - + [1] dll main 12 bytes {0} [built] + dll entry + + 1 hidden module ``` diff --git a/examples/dll-app-and-vendor/1-app/README.md b/examples/dll-app-and-vendor/1-app/README.md index 84f722ff6..d8b1e628f 100644 --- a/examples/dll-app-and-vendor/1-app/README.md +++ b/examples/dll-app-and-vendor/1-app/README.md @@ -147,22 +147,22 @@ console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__["square"](7)); /***/ }), /* 1 */ /*!******************************************************************************************************!*\ - !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e ***! + !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 ***! \******************************************************************************************************/ /*! exports provided: square */ /***/ (function(module, exports, __webpack_require__) { -module.exports = (__webpack_require__(/*! dll-reference vendor_lib_bc3751dcff9f91451e0e */ 2))(1); +module.exports = (__webpack_require__(/*! dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 */ 2))(1); /***/ }), /* 2 */ /*!**************************************************!*\ - !*** external "vendor_lib_bc3751dcff9f91451e0e" ***! + !*** external "vendor_lib_f3fbcfb4ec389ba5bbf0" ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -module.exports = vendor_lib_bc3751dcff9f91451e0e; +module.exports = vendor_lib_f3fbcfb4ec389ba5bbf0; /***/ }) /******/ ]); @@ -174,44 +174,44 @@ module.exports = vendor_lib_bc3751dcff9f91451e0e; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names app.js 3.9 KiB 0 [emitted] main Entrypoint main = app.js chunk {0} app.js (main) 182 bytes [entry] [rendered] > ./example-app main - [0] ./example-app.js 98 bytes {0} [built] - [no exports] - single entry ./example-app main - [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e 42 bytes {0} [built] - [exports: square] - harmony side effect evaluation example-vendor [0] ./example-app.js 1:0-40 - harmony import specifier example-vendor [0] ./example-app.js 3:12-18 - harmony import specifier example-vendor [0] ./example-app.js 4:16-22 - [2] external "vendor_lib_bc3751dcff9f91451e0e" 42 bytes {0} [built] - delegated source dll-reference vendor_lib_bc3751dcff9f91451e0e [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e + [0] ./example-app.js 98 bytes {0} [built] + [no exports] + single entry ./example-app main + [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 42 bytes {0} [built] + [exports: square] + harmony side effect evaluation example-vendor [0] ./example-app.js 1:0-40 + harmony import specifier example-vendor [0] ./example-app.js 3:12-18 + harmony import specifier example-vendor [0] ./example-app.js 4:16-22 + [2] external "vendor_lib_f3fbcfb4ec389ba5bbf0" 42 bytes {0} [built] + delegated source dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names app.js 736 bytes 0 [emitted] main Entrypoint main = app.js chunk {0} app.js (main) 182 bytes [entry] [rendered] > ./example-app main - [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e 42 bytes {0} [built] - [exports: square] - harmony side effect evaluation example-vendor [2] ./example-app.js 1:0-40 - harmony import specifier example-vendor [2] ./example-app.js 3:12-18 - harmony import specifier example-vendor [2] ./example-app.js 4:16-22 - [1] external "vendor_lib_bc3751dcff9f91451e0e" 42 bytes {0} [built] - delegated source dll-reference vendor_lib_bc3751dcff9f91451e0e [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e - [2] ./example-app.js 98 bytes {0} [built] - [no exports] - single entry ./example-app main + [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 42 bytes {0} [built] + [exports: square] + harmony side effect evaluation example-vendor [2] ./example-app.js 1:0-40 + harmony import specifier example-vendor [2] ./example-app.js 3:12-18 + harmony import specifier example-vendor [2] ./example-app.js 4:16-22 + [1] external "vendor_lib_f3fbcfb4ec389ba5bbf0" 42 bytes {0} [built] + delegated source dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 + [2] ./example-app.js 98 bytes {0} [built] + [no exports] + single entry ./example-app main ``` This need to be documented (issue in webpack/webpack.js.org will be filed when merged) + + +# When a pull request need to be documented, create an issue in webpack/webpack.js.org when merged +- filters: + pull_request: + merged: true + comment: + author: webpack-bot + matching: "\\* \\[x\\] " + not: + comment_1: + author: webpack-bot + matching: admin-action-document-executed + actions: + new_issue: + target: webpack/webpack.js.org + title: "Document webpack change: {{{pull_request.title}}}" + body: |- + + + *A pull request by @{{pull_request.user.login}} was merged and maintainers requested a documentation change.* + + See pull request: {{{pull_request.html_url}}} + + --- + + {{{pull_request.body}}} + comment: + identifier: admin-action-document-executed + message: |- + I've created an issue to document this in webpack/webpack.js.org. + diff --git a/package.json b/package.json index 59fe21042..0550de2fb 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,13 @@ { "name": "webpack", - "version": "4.6.0", + "version": "4.8.3", "author": "Tobias Koppers @sokra", "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "license": "MIT", "dependencies": { + "@webassemblyjs/ast": "1.4.3", + "@webassemblyjs/wasm-edit": "1.4.3", + "@webassemblyjs/wasm-parser": "1.4.3", "acorn": "^5.0.0", "acorn-dynamic-import": "^3.0.0", "ajv": "^6.1.0", @@ -38,6 +41,7 @@ "es6-promise-polyfill": "^1.1.1", "eslint": "^4.19.1", "eslint-config-prettier": "^2.9.0", + "eslint-plugin-jest": "21.12.2", "eslint-plugin-node": "^6.0.1", "eslint-plugin-prettier": "^2.6.0", "express": "~4.13.1", @@ -47,23 +51,23 @@ "istanbul": "^0.4.5", "jade": "^1.11.0", "jade-loader": "~0.8.0", + "jest": "23.0.0-alpha.5", + "jest-silent-reporter": "0.0.4", "json-loader": "^0.5.7", "less": "^2.5.1", "less-loader": "^4.0.3", "lodash": "^4.17.4", - "mocha": "^3.2.0", - "mocha-lcov-reporter": "^1.0.0", "prettier": "^1.11.1", + "pug": "^2.0.3", + "pug-loader": "^2.4.0", "raw-loader": "~0.5.0", "react": "^15.2.1", "react-dom": "^15.2.1", "rimraf": "^2.6.2", "script-loader": "~0.7.0", - "should": "^11.1.1", "simple-git": "^1.65.0", - "sinon": "^2.3.2", "style-loader": "^0.19.1", - "typescript": "^2.9.0-dev.20180412", + "typescript": "^2.9.0-dev.20180511", "url-loader": "^0.6.2", "val-loader": "^1.0.2", "vm-browserify": "~0.0.0", @@ -88,39 +92,82 @@ "buildin/", "hot/", "web_modules/", - "schemas/" + "schemas/", + "SECURITY.md" ], "scripts": { "setup": "node ./setup/setup.js", - "test": "npm run mocha", - "mocha": "mocha test/*.test.js test/*.unittest.js --max-old-space-size=4096 --harmony --trace-deprecation", - "test:integration": "mocha test/*.test.js --max-old-space-size=4096 --harmony --trace-deprecation", - "test:unit": "mocha test/*.unittest.js --max-old-space-size=4096 --harmony --trace-deprecation", - "travis:integration": "yarn cover:init && yarn cover:integration && yarn cover:report-min", - "travis:unit": "yarn cover:init && yarn cover:unit && yarn cover:report-min", + "test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest", + "test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\"", + "test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/{TestCasesNormal,StatsTestCases,ConfigTestCases}.test.js\"", + "test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\"", + "travis:integration": "yarn cover:init && yarn cover:integration --ci $JEST && yarn cover:report-min", + "travis:basic": "yarn test:basic --ci $JEST", + "travis:unit": "yarn cover:init && yarn cover:unit --ci", "travis:lint": "yarn lint", - "travis:benchmark": "yarn benchmark", - "appveyor:integration": "yarn cover:init && yarn cover:integration && yarn cover:report-min", - "appveyor:unit": "yarn cover:init && yarn cover:unit && yarn cover:report-min", - "appveyor:benchmark": "yarn benchmark", - "circleci:test": "node node_modules/mocha/bin/mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js test/*.unittest.js", + "travis:benchmark": "yarn benchmark --ci", + "appveyor:integration": "yarn cover:init && yarn cover:integration --ci %JEST% && yarn cover:report-min", + "appveyor:unit": "yarn cover:init && yarn cover:unit --ci && yarn cover:report-min", + "appveyor:benchmark": "yarn benchmark --ci", + "circleci:test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --ci", "circleci:lint": "yarn lint", "build:examples": "cd examples && node buildAll.js", "pretest": "yarn lint", "prelint": "yarn setup", "lint": "yarn code-lint && yarn schema-lint && yarn type-lint", - "code-lint": "eslint setup lib bin hot buildin \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" \"schemas/**/*.js\"", + "code-lint": "eslint --cache setup lib bin hot buildin \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" \"schemas/**/*.js\"", "type-lint": "tsc --pretty", "fix": "yarn code-lint --fix", "pretty": "prettier \"setup/**/*.js\" \"lib/**/*.js\" \"bin/*.js\" \"hot/*.js\" \"buildin/*.js\" \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" \"schemas/**/*.js\" \"declarations.d.ts\" --write", - "schema-lint": "mocha test/*.lint.js --opts test/lint-mocha.opts", - "benchmark": "mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.benchmark.js -R spec", + "schema-lint": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.lint.js\" --no-verbose", + "benchmark": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.benchmark.js\" --runInBand", "cover": "yarn cover:init && yarn cover:all && yarn cover:report", "cover:init": "rimraf coverage", - "cover:all": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.test.js test/*.unittest.js", - "cover:integration": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.test.js", - "cover:unit": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.unittest.js", + "cover:all": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --coverage", + "cover:integration": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\" --coverage", + "cover:unit": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\" --coverage", "cover:report": "istanbul report", "cover:report-min": "istanbul report --report lcovonly" + }, + "jest": { + "forceExit": true, + "setupTestFrameworkScriptFile": "/test/setupTestFramework.js", + "testMatch": [ + "/test/*.test.js", + "/test/*.unittest.js" + ], + "watchPathIgnorePatterns": [ + "/node_modules/webpack/node_modules/", + "/test/js/", + "/test/browsertest/js/", + "/test/fixtures/temp-cache-fixture/", + "/test/fixtures/temp-", + "/benchmark/", + "/examples/*/dist", + "/coverage/" + ], + "modulePathIgnorePatterns": [ + "/node_modules/webpack/node_modules/", + "/test/js/", + "/test/browsertest/js/", + "/test/fixtures/temp-cache-fixture/", + "/test/fixtures/temp-", + "/benchmark/", + "/examples/*/dist", + "/coverage/" + ], + "transformIgnorePatterns": [ + "/" + ], + "coverageDirectory": "/coverage", + "coveragePathIgnorePatterns": [ + "\\.runtime\\.js$", + "/test/", + "/schemas/" + ], + "testEnvironment": "node", + "coverageReporters": [ + "json" + ] } } diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 2634ed3ea..f8d94d683 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -492,7 +492,14 @@ "properties": { "root": { "description": "Name of the property exposed globally by a UMD library", - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/common.arrayOfStringValues" + } + ] }, "amd": { "description": "Name of the exposed AMD library in the UMD", @@ -1672,6 +1679,10 @@ } ] }, + "serve": { + "description": "Options for webpack-serve", + "type": "object" + }, "stats": { "description": "Used by the webpack CLI program to pass stats options.", "anyOf": [ @@ -1853,6 +1864,10 @@ "type": "boolean", "description": "Display the entry points with the corresponding bundles" }, + "chunkGroups": { + "type": "boolean", + "description": "Display all chunk groups with the corresponding bundles" + }, "errorDetails": { "type": "boolean", "description": "add details to errors (like resolving log)" diff --git a/schemas/plugins/BannerPlugin.json b/schemas/plugins/BannerPlugin.json index f2e502132..87e479036 100644 --- a/schemas/plugins/BannerPlugin.json +++ b/schemas/plugins/BannerPlugin.json @@ -39,8 +39,15 @@ ], "properties": { "banner": { - "description": "The banner as string, it will be wrapped in a comment", - "type": "string" + "description": "Specifies the banner", + "anyOf": [ + { + "instanceof": "Function" + }, + { + "type": "string" + } + ] }, "raw": { "description": "If true, banner will not be wrapped in a comment", @@ -76,6 +83,10 @@ } } }, + { + "description": "The banner as function, it will be wrapped in a comment", + "instanceof": "Function" + }, { "description": "The banner as string, it will be wrapped in a comment", "minLength": 1, diff --git a/test/BenchmarkTestCases.benchmark.js b/test/BenchmarkTestCases.benchmark.js index f81f996da..e48634548 100644 --- a/test/BenchmarkTestCases.benchmark.js +++ b/test/BenchmarkTestCases.benchmark.js @@ -1,12 +1,10 @@ "use strict"; -require("should"); const path = require("path"); const fs = require("fs"); const asyncLib = require("neo-async"); -var Test = require("mocha/lib/test"); - const Benchmark = require("benchmark"); +const { remove } = require("./helpers/remove"); describe("BenchmarkTestCases", function() { const casesPath = path.join(__dirname, "benchmarkCases"); @@ -27,8 +25,7 @@ describe("BenchmarkTestCases", function() { fs.mkdirSync(baselinesPath); } catch (e) {} // eslint-disable-line no-empty - before(function(done) { - this.timeout(270000); + beforeAll(function(done) { const git = require("simple-git"); const rootPath = path.join(__dirname, ".."); getBaselineRevs(rootPath, (err, baselineRevisions) => { @@ -65,7 +62,11 @@ describe("BenchmarkTestCases", function() { err => { if (err) return callback(err); fs.writeFileSync(gitIndex, index); - doLoadWebpack(); + try { + doLoadWebpack(); + } catch (err) { + callback(err); + } } ); } @@ -75,10 +76,9 @@ describe("BenchmarkTestCases", function() { } function doLoadWebpack() { - const baselineWebpack = require(path.resolve( - baselinePath, - "lib/webpack.js" - )); + const baselineWebpack = require.requireActual( + path.resolve(baselinePath, "lib/webpack.js") + ); baselines.push({ name: baselineInfo.name, rev: baselineRevision, @@ -87,9 +87,20 @@ describe("BenchmarkTestCases", function() { callback(); } }, - done + err => { + if (err) { + done(err); + return; + } + createTests(); + done(); + } ); }); + }, 270000); + + afterAll(() => { + remove(baselinesPath); }); function getBaselineRevs(rootPath, callback) { @@ -261,64 +272,94 @@ describe("BenchmarkTestCases", function() { }); } - tests.forEach(testName => { - const testDirectory = path.join(casesPath, testName); - let headStats = null; - const suite = describe(testName, function() {}); - it(`${testName} create benchmarks`, function() { - baselines.forEach(baseline => { - let baselineStats = null; + function createTests() { + tests.forEach(testName => { + const testDirectory = path.join(casesPath, testName); + let headStats = null; + describe(`${testName} create benchmarks`, function() { + baselines.forEach(baseline => { + let baselineStats = null; + it( + `should benchmark ${baseline.name} (${baseline.rev})`, + function(done) { + const outputDirectory = path.join( + __dirname, + "js", + "benchmark", + `baseline-${baseline.name}`, + testName + ); + const config = + Object.create( + require.requireActual( + path.join(testDirectory, "webpack.config.js") + ) + ) || {}; + config.output = Object.create(config.output || {}); + if (!config.context) config.context = testDirectory; + if (!config.output.path) config.output.path = outputDirectory; + runBenchmark(baseline.webpack, config, (err, stats) => { + if (err) return done(err); + process.stderr.write(` ${baseline.name} ${stats.text}`); + if (baseline.name === "HEAD") headStats = stats; + else baselineStats = stats; + done(); + }); + }, + 180000 + ); - function it(title, fn) { - const test = new Test(title, fn); - suite.addTest(test); - } - it(`should benchmark ${baseline.name} (${ - baseline.rev - })`, function(done) { - this.timeout(180000); - const outputDirectory = path.join( - __dirname, - "js", - "benchmark", - `baseline-${baseline.name}`, - testName + it( + `should benchmark ${baseline.name} (${baseline.rev})`, + done => { + const outputDirectory = path.join( + __dirname, + "js", + "benchmark", + `baseline-${baseline.name}`, + testName + ); + const config = + require.requireActual( + path.join(testDirectory, "webpack.config.js") + ) || {}; + config.output = config.output || {}; + if (!config.context) config.context = testDirectory; + if (!config.output.path) config.output.path = outputDirectory; + runBenchmark(baseline.webpack, config, (err, stats) => { + if (err) return done(err); + process.stderr.write(` ${baseline.name} ${stats.text}`); + if (baseline.name === "HEAD") headStats = stats; + else baselineStats = stats; + done(); + }); + }, + 180000 ); - const config = Object.create( - require(path.join(testDirectory, "webpack.config.js")) - ); - config.output = Object.create(config.output || {}); - if (!config.context) config.context = testDirectory; - if (!config.output.path) config.output.path = outputDirectory; - runBenchmark(baseline.webpack, config, (err, stats) => { - if (err) return done(err); - console.log(` ${baseline.name} ${stats.text}`); - if (baseline.name === "HEAD") headStats = stats; - else baselineStats = stats; - done(); - }); + + if (baseline.name !== "HEAD") { + it(`HEAD should not be slower than ${baseline.name} (${ + baseline.rev + })`, function() { + if (baselineStats.maxConfidence < headStats.minConfidence) { + throw new Error( + `HEAD (${headStats.text}) is slower than ${baseline.name} (${ + baselineStats.text + }) (90% confidence)` + ); + } else if ( + baselineStats.minConfidence > headStats.maxConfidence + ) { + console.log( + `======> HEAD is ${Math.round( + baselineStats.mean / headStats.mean * 100 - 100 + )}% faster than ${baseline.name} (90% confidence)!` + ); + } + }); + } }); - - if (baseline.name !== "HEAD") { - it(`HEAD should not be slower than ${baseline.name} (${ - baseline.rev - })`, function() { - if (baselineStats.maxConfidence < headStats.minConfidence) { - throw new Error( - `HEAD (${headStats.text}) is slower than ${baseline.name} (${ - baselineStats.text - }) (90% confidence)` - ); - } else if (baselineStats.minConfidence > headStats.maxConfidence) { - console.log( - `======> HEAD is ${Math.round( - baselineStats.mean / headStats.mean * 100 - 100 - )}% faster than ${baseline.name} (90% confidence)!` - ); - } - }); - } }); }); - }); + } }); diff --git a/test/CachePlugin.unittest.js b/test/CachePlugin.unittest.js index 7ce741c01..c3985b8c4 100644 --- a/test/CachePlugin.unittest.js +++ b/test/CachePlugin.unittest.js @@ -1,6 +1,5 @@ "use strict"; -require("should"); const CachePlugin = require("../lib/CachePlugin"); describe("CachePlugin", () => { @@ -20,22 +19,22 @@ describe("CachePlugin", () => { it("sets file system accuracy to 1 for granular modification timestamp", () => { env.plugin.applyMtime(1483819067001); - env.plugin.FS_ACCURACY.should.be.exactly(1); + expect(env.plugin.FS_ACCURACY).toBe(1); }); it("sets file system accuracy to 10 for moderately granular modification timestamp", () => { env.plugin.applyMtime(1483819067004); - env.plugin.FS_ACCURACY.should.be.exactly(10); + expect(env.plugin.FS_ACCURACY).toBe(10); }); it("sets file system accuracy to 100 for moderately coarse modification timestamp", () => { env.plugin.applyMtime(1483819067040); - env.plugin.FS_ACCURACY.should.be.exactly(100); + expect(env.plugin.FS_ACCURACY).toBe(100); }); it("sets file system accuracy to 1000 for coarse modification timestamp", () => { env.plugin.applyMtime(1483819067400); - env.plugin.FS_ACCURACY.should.be.exactly(1000); + expect(env.plugin.FS_ACCURACY).toBe(1000); }); }); }); diff --git a/test/CaseSensitiveModulesWarning.unittest.js b/test/CaseSensitiveModulesWarning.unittest.js index 6023c02ec..98abfb85e 100644 --- a/test/CaseSensitiveModulesWarning.unittest.js +++ b/test/CaseSensitiveModulesWarning.unittest.js @@ -1,6 +1,5 @@ "use strict"; -require("should"); const CaseSensitiveModulesWarning = require("../lib/CaseSensitiveModulesWarning"); const createModule = function(identifier, numberOfReasons) { @@ -31,13 +30,14 @@ describe("CaseSensitiveModulesWarning", () => { myCaseSensitiveModulesWarning = new CaseSensitiveModulesWarning(modules); }); - it("has the a name", () => - myCaseSensitiveModulesWarning.name.should.be.exactly( + it("has the a name", () => { + expect(myCaseSensitiveModulesWarning.name).toBe( "CaseSensitiveModulesWarning" - )); + ); + }); it("has the a message", () => { - myCaseSensitiveModulesWarning.message.should.be.exactly( + expect(myCaseSensitiveModulesWarning.message).toBe( ` There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. @@ -53,9 +53,11 @@ Use equal casing. Compare these module identifiers: ); }); - it("has the an origin", () => - myCaseSensitiveModulesWarning.origin.should.be.exactly(modules[0])); + it("has the an origin", () => { + expect(myCaseSensitiveModulesWarning.origin).toBe(modules[0]); + }); - it("has the a module", () => - myCaseSensitiveModulesWarning.module.should.be.exactly(modules[0])); + it("has the a module", () => { + expect(myCaseSensitiveModulesWarning.module).toBe(modules[0]); + }); }); diff --git a/test/Chunk.unittest.js b/test/Chunk.unittest.js index 42c5c26fc..dab229ee6 100644 --- a/test/Chunk.unittest.js +++ b/test/Chunk.unittest.js @@ -1,107 +1,115 @@ /* globals describe, it, beforeEach */ "use strict"; -const should = require("should"); -const sinon = require("sinon"); const Chunk = require("../lib/Chunk"); describe("Chunk", () => { let ChunkInstance; - beforeEach( - () => (ChunkInstance = new Chunk("chunk-test", "module-test", "loc-test")) - ); + beforeEach(() => { + ChunkInstance = new Chunk("chunk-test", "module-test", "loc-test"); + }); - it("should have debugId more than 999", () => - should(ChunkInstance.debugId).be.above(999)); + it("should have debugId more than 999", () => { + expect(ChunkInstance.debugId).toBeGreaterThan(999); + }); - it("returns a string with modules information", () => - should(ChunkInstance.toString()).be.exactly("Chunk[]")); + it("returns a string with modules information", () => { + expect(ChunkInstance.toString()).toBe("Chunk[]"); + }); - it("should not be the initial instance", () => - should(ChunkInstance.canBeInitial()).be.false()); + it("should not be the initial instance", () => { + expect(ChunkInstance.canBeInitial()).toBe(false); + }); describe("entry", () => { - it("returns an error if get entry", () => - should(() => { + it("returns an error if get entry", () => { + expect(() => { ChunkInstance.entry; - }).throw("Chunk.entry was removed. Use hasRuntime()")); + }).toThrow("Chunk.entry was removed. Use hasRuntime()"); + }); - it("returns an error if set an entry", () => - should(() => { + it("returns an error if set an entry", () => { + expect(() => { ChunkInstance.entry = 10; - }).throw("Chunk.entry was removed. Use hasRuntime()")); + }).toThrow("Chunk.entry was removed. Use hasRuntime()"); + }); }); describe("initial", () => { - it("returns an error if get initial", () => - should(() => { + it("returns an error if get initial", () => { + expect(() => { ChunkInstance.initial; - }).throw("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()")); + }).toThrow("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()"); + }); - it("returns an error if set an initial", () => - should(() => { + it("returns an error if set an initial", () => { + expect(() => { ChunkInstance.initial = 10; - }).throw("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()")); + }).toThrow("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()"); + }); }); describe("hasRuntime", () => { - it("returns false", () => should(ChunkInstance.hasRuntime()).be.false()); + it("returns false", () => { + expect(ChunkInstance.hasRuntime()).toBe(false); + }); }); describe("isEmpty", () => { - it("should NOT have any module by default", () => - should(ChunkInstance.isEmpty()).be.true()); + it("should NOT have any module by default", () => { + expect(ChunkInstance.isEmpty()).toBe(true); + }); }); describe("size", () => { - it("should NOT have any module by default", () => - should( + it("should NOT have any module by default", () => { + expect( ChunkInstance.size({ chunkOverhead: 10, entryChunkMultiplicator: 2 }) - ).be.exactly(10)); + ).toBe(10); + }); }); - describe("removeModule", function() { + describe("removeModule", () => { let module; let removeChunkSpy; - beforeEach(function() { - removeChunkSpy = sinon.spy(); - + beforeEach(() => { + removeChunkSpy = jest.fn(); module = { removeChunk: removeChunkSpy }; }); - describe("and the chunk does not contain this module", function() { - it("returns false", function() { - ChunkInstance.removeModule(module).should.eql(false); + describe("and the chunk does not contain this module", () => { + it("returns false", () => { + expect(ChunkInstance.removeModule(module)).toBe(false); }); }); - describe("and the chunk does contain this module", function() { - beforeEach(function() { + describe("and the chunk does contain this module", () => { + beforeEach(() => { ChunkInstance._modules = new Set([module]); }); - it("calls module.removeChunk with itself and returns true", function() { - ChunkInstance.removeModule(module).should.eql(true); + it("calls module.removeChunk with itself and returns true", () => { + expect(ChunkInstance.removeModule(module)).toBe(true); - removeChunkSpy.callCount.should.eql(1); - removeChunkSpy.args[0][0].should.eql(ChunkInstance); + expect(removeChunkSpy.mock.calls.length).toBe(1); + expect(removeChunkSpy.mock.calls[0][0]).toBe(ChunkInstance); }); }); - describe("getNumberOfGroups", function() { - beforeEach(function() { + describe("getNumberOfGroups", () => { + beforeEach(() => { ChunkInstance._groups = new Set(); }); - it("should return the number of chunk groups contained by the chunk", function() { - ChunkInstance.getNumberOfGroups().should.eql(0); + it("should return the number of chunk groups contained by the chunk", () => { + expect(ChunkInstance.getNumberOfGroups()).toBe(0); }); }); }); diff --git a/test/Compiler-caching.test.js b/test/Compiler-caching.test.js index 9e612c848..28bdafb02 100644 --- a/test/Compiler-caching.test.js +++ b/test/Compiler-caching.test.js @@ -1,15 +1,16 @@ -/* globals describe, it, before, after */ +/* globals describe, it */ "use strict"; -const should = require("should"); const path = require("path"); const fs = require("fs"); +const rimraf = require("rimraf"); const webpack = require("../"); const WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter"); +let fixtureCount = 0; -describe("Compiler (caching)", function() { - this.timeout(15000); +describe("Compiler (caching)", () => { + jest.setTimeout(15000); function compile(entry, options, callback) { options.mode = "none"; @@ -29,14 +30,14 @@ describe("Compiler (caching)", function() { const c = webpack(options); const files = {}; c.outputFileSystem = { - join: function() { + join() { return [].join.call(arguments, "/").replace(/\/+/g, "/"); }, - mkdirp: function(path, callback) { + mkdirp(path, callback) { logs.mkdirp.push(path); callback(); }, - writeFile: function(name, content, callback) { + writeFile(name, content, callback) { logs.writeFile.push(name, content); files[name] = content.toString("utf-8"); callback(); @@ -56,19 +57,19 @@ describe("Compiler (caching)", function() { } c.run((err, stats) => { if (err) throw err; - should.strictEqual(typeof stats, "object"); + expect(typeof stats).toBe("object"); stats = stats.toJson({ modules: true, reasons: true }); - should.strictEqual(typeof stats, "object"); - stats.should.have.property("errors"); - Array.isArray(stats.errors).should.be.ok(); + expect(typeof stats).toBe("object"); + expect(stats).toHaveProperty("errors"); + expect(Array.isArray(stats.errors)).toBe(true); if (options.expectErrors) { - stats.errors.length.should.be.eql(options.expectErrors); + expect(stats.errors).toHaveLength(options.expectErrors); } else { if (stats.errors.length > 0) { - stats.errors[0].should.be.type("string"); + expect(typeof stats.errors[0]).toBe("string"); throw new Error(stats.errors[0]); } } @@ -90,42 +91,24 @@ describe("Compiler (caching)", function() { "fixtures", "temp-cache-fixture" ); - const aFilepath = path.join(tempFixturePath, "a.js"); - const cFilepath = path.join(tempFixturePath, "c.js"); function cleanup() { - function ignoreENOENT(fn) { - try { - return fn(); - } catch (e) { - if (e.code !== "ENOENT") { - throw e; - } - } - } - ignoreENOENT(() => fs.unlinkSync(aFilepath)); - ignoreENOENT(() => fs.unlinkSync(cFilepath)); - ignoreENOENT(() => fs.rmdirSync(tempFixturePath)); + rimraf.sync(`${tempFixturePath}-*`); } - before(cleanup); - after(cleanup); + + beforeAll(cleanup); + afterAll(cleanup); function createTempFixture() { + const fixturePath = `${tempFixturePath}-${fixtureCount}`; + const aFilepath = path.join(fixturePath, "a.js"); + const cFilepath = path.join(fixturePath, "c.js"); + // Remove previous copy if present - try { - if (fs.statSync(tempFixturePath)) { - fs.unlinkSync(aFilepath); - fs.unlinkSync(cFilepath); - fs.rmdirSync(tempFixturePath); - } - } catch (e) { - if (e.code !== "ENOENT") { - throw e; - } - } + rimraf.sync(fixturePath); // Copy over file since we"ll be modifying some of them - fs.mkdirSync(tempFixturePath); + fs.mkdirSync(fixturePath); fs .createReadStream(path.join(__dirname, "fixtures", "a.js")) .pipe(fs.createWriteStream(aFilepath)); @@ -133,8 +116,9 @@ describe("Compiler (caching)", function() { .createReadStream(path.join(__dirname, "fixtures", "c.js")) .pipe(fs.createWriteStream(cFilepath)); + fixtureCount++; return { - rootPath: tempFixturePath, + rootPath: fixturePath, aFilepath: aFilepath, cFilepath: cFilepath }; @@ -144,18 +128,92 @@ describe("Compiler (caching)", function() { const options = {}; const tempFixture = createTempFixture(); - const helper = compile( - "./temp-cache-fixture/c", - options, - (stats, files) => { - // Not cached the first time - stats.assets[0].name.should.be.exactly("bundle.js"); - stats.assets[0].emitted.should.be.exactly(true); + const helper = compile(tempFixture.cFilepath, options, (stats, files) => { + // Not cached the first time + expect(stats.assets[0].name).toBe("bundle.js"); + expect(stats.assets[0].emitted).toBe(true); + + helper.runAgain((stats, files, iteration) => { + // Cached the second run + expect(stats.assets[0].name).toBe("bundle.js"); + expect(stats.assets[0].emitted).toBe(false); + + const aContent = fs + .readFileSync(tempFixture.aFilepath) + .toString() + .replace("This is a", "This is a MODIFIED"); + + setTimeout(() => { + fs.writeFileSync(tempFixture.aFilepath, aContent); + + helper.runAgain((stats, files, iteration) => { + // Cached the third run + expect(stats.assets[0].name).toBe("bundle.js"); + expect(stats.assets[0].emitted).toBe(true); + + done(); + }); + }, 1100); + }); + }); + }); + + it("should cache single file (even with no timeout) ", done => { + const options = {}; + const tempFixture = createTempFixture(); + + const helper = compile(tempFixture.cFilepath, options, (stats, files) => { + // Not cached the first time + expect(stats.assets[0].name).toBe("bundle.js"); + expect(stats.assets[0].emitted).toBe(true); + + helper.runAgain((stats, files, iteration) => { + // Cached the second run + expect(stats.assets[0].name).toBe("bundle.js"); + expect(stats.assets[0].emitted).toBe(false); + + expect(files["/bundle.js"]).toMatch("This is a"); + + const aContent = fs + .readFileSync(tempFixture.aFilepath) + .toString() + .replace("This is a", "This is a MODIFIED"); + + fs.writeFileSync(tempFixture.aFilepath, aContent); helper.runAgain((stats, files, iteration) => { - // Cached the second run - stats.assets[0].name.should.be.exactly("bundle.js"); - stats.assets[0].emitted.should.be.exactly(false); + // Cached the third run + expect(stats.assets[0].name).toBe("bundle.js"); + expect(stats.assets[0].emitted).toBe(true); + + expect(files["/bundle.js"]).toMatch("This is a MODIFIED"); + + done(); + }); + }); + }); + }); + + it("should only build when modified (with manual 2s wait)", done => { + const options = {}; + const tempFixture = createTempFixture(); + + const helper = compile(tempFixture.cFilepath, options, (stats, files) => { + // Built the first time + expect(stats.modules[0].name).toMatch("c.js"); + expect(stats.modules[0].built).toBe(true); + + expect(stats.modules[1].name).toMatch("a.js"); + expect(stats.modules[1].built).toBe(true); + + setTimeout(() => { + helper.runAgain((stats, files, iteration) => { + // Not built when cached the second run + expect(stats.modules[0].name).toMatch("c.js"); + // expect(stats.modules[0].built).toBe(false); + + expect(stats.modules[1].name).toMatch("a.js"); + // expect(stats.modules[1].built).toBe(false); const aContent = fs .readFileSync(tempFixture.aFilepath) @@ -166,170 +224,59 @@ describe("Compiler (caching)", function() { fs.writeFileSync(tempFixture.aFilepath, aContent); helper.runAgain((stats, files, iteration) => { - // Cached the third run - stats.assets[0].name.should.be.exactly("bundle.js"); - stats.assets[0].emitted.should.be.exactly(true); + // And only a.js built after it was modified + expect(stats.modules[0].name).toMatch("c.js"); + expect(stats.modules[0].built).toBe(false); + + expect(stats.modules[1].name).toMatch("a.js"); + expect(stats.modules[1].built).toBe(true); done(); }); - }, 1100); + }, 2100); }); - } - ); - }); - - it("should cache single file (even with no timeout) ", done => { - const options = {}; - const tempFixture = createTempFixture(); - - const helper = compile( - "./temp-cache-fixture/c", - options, - (stats, files) => { - // Not cached the first time - stats.assets[0].name.should.be.exactly("bundle.js"); - stats.assets[0].emitted.should.be.exactly(true); - - helper.runAgain((stats, files, iteration) => { - // Cached the second run - stats.assets[0].name.should.be.exactly("bundle.js"); - stats.assets[0].emitted.should.be.exactly(false); - - files["/bundle.js"].should.containEql("This is a"); - - const aContent = fs - .readFileSync(tempFixture.aFilepath) - .toString() - .replace("This is a", "This is a MODIFIED"); - - fs.writeFileSync(tempFixture.aFilepath, aContent); - - helper.runAgain((stats, files, iteration) => { - // Cached the third run - stats.assets[0].name.should.be.exactly("bundle.js"); - stats.assets[0].emitted.should.be.exactly(true); - - files["/bundle.js"].should.containEql("This is a MODIFIED"); - - done(); - }); - }); - } - ); - }); - - it("should only build when modified (with manual 2s wait)", done => { - const options = {}; - const tempFixture = createTempFixture(); - - const helper = compile( - "./temp-cache-fixture/c", - options, - (stats, files) => { - // Built the first time - stats.modules[0].name.should.containEql("c.js"); - stats.modules[0].built.should.be.exactly( - true, - "c.js should have been built" - ); - - stats.modules[1].name.should.containEql("a.js"); - stats.modules[1].built.should.be.exactly( - true, - "a.js should have been built" - ); - - setTimeout(() => { - helper.runAgain((stats, files, iteration) => { - // Not built when cached the second run - stats.modules[0].name.should.containEql("c.js"); - //stats.modules[0].built.should.be.exactly(false, "c.js should not have built"); - - stats.modules[1].name.should.containEql("a.js"); - //stats.modules[1].built.should.be.exactly(false, "a.js should not have built"); - - const aContent = fs - .readFileSync(tempFixture.aFilepath) - .toString() - .replace("This is a", "This is a MODIFIED"); - - setTimeout(() => { - fs.writeFileSync(tempFixture.aFilepath, aContent); - - helper.runAgain((stats, files, iteration) => { - // And only a.js built after it was modified - stats.modules[0].name.should.containEql("c.js"); - stats.modules[0].built.should.be.exactly( - false, - "c.js should not have built" - ); - - stats.modules[1].name.should.containEql("a.js"); - stats.modules[1].built.should.be.exactly( - true, - "a.js should have been built" - ); - - done(); - }); - }, 2100); - }); - }, 4100); - } - ); + }, 4100); + }); }); it("should build when modified (even with no timeout)", done => { const options = {}; const tempFixture = createTempFixture(); - const helper = compile( - "./temp-cache-fixture/c", - options, - (stats, files) => { - // Built the first time - stats.modules[0].name.should.containEql("c.js"); - stats.modules[0].built.should.be.exactly( - true, - "c.js should have been built" - ); + const helper = compile(tempFixture.cFilepath, options, (stats, files) => { + // Built the first time + expect(stats.modules[0].name).toMatch("c.js"); + expect(stats.modules[0].built).toBe(true); - stats.modules[1].name.should.containEql("a.js"); - stats.modules[1].built.should.be.exactly( - true, - "a.js should have been built" - ); + expect(stats.modules[1].name).toMatch("a.js"); + expect(stats.modules[1].built).toBe(true); + + helper.runAgain((stats, files, iteration) => { + // Not built when cached the second run + expect(stats.modules[0].name).toMatch("c.js"); + // expect(stats.modules[0].built).toBe(false); + + expect(stats.modules[1].name).toMatch("a.js"); + // expect(stats.modules[1].built).toBe(false); + + const aContent = fs + .readFileSync(tempFixture.aFilepath) + .toString() + .replace("This is a", "This is a MODIFIED"); + + fs.writeFileSync(tempFixture.aFilepath, aContent); helper.runAgain((stats, files, iteration) => { - // Not built when cached the second run - stats.modules[0].name.should.containEql("c.js"); - //stats.modules[0].built.should.be.exactly(false, "c.js should not have built"); + // And only a.js built after it was modified + expect(stats.modules[0].name).toMatch("c.js"); + // expect(stats.modules[0].built).toBe(false); - stats.modules[1].name.should.containEql("a.js"); - //stats.modules[1].built.should.be.exactly(false, "a.js should not have built"); + expect(stats.modules[1].name).toMatch("a.js"); + expect(stats.modules[1].built).toBe(true); - const aContent = fs - .readFileSync(tempFixture.aFilepath) - .toString() - .replace("This is a", "This is a MODIFIED"); - - fs.writeFileSync(tempFixture.aFilepath, aContent); - - helper.runAgain((stats, files, iteration) => { - // And only a.js built after it was modified - stats.modules[0].name.should.containEql("c.js"); - //stats.modules[0].built.should.be.exactly(false, "c.js should not have built"); - - stats.modules[1].name.should.containEql("a.js"); - stats.modules[1].built.should.be.exactly( - true, - "a.js should have been built" - ); - - done(); - }); + done(); }); - } - ); + }); + }); }); }); diff --git a/test/Compiler.test.js b/test/Compiler.test.js index f977ed562..063343f38 100644 --- a/test/Compiler.test.js +++ b/test/Compiler.test.js @@ -1,9 +1,7 @@ /* globals describe, it */ "use strict"; -const should = require("should"); const path = require("path"); -const sinon = require("sinon"); const webpack = require("../"); const WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter"); @@ -29,14 +27,14 @@ describe("Compiler", () => { const c = webpack(options); const files = {}; c.outputFileSystem = { - join: function() { + join() { return [].join.call(arguments, "/").replace(/\/+/g, "/"); }, - mkdirp: function(path, callback) { + mkdirp(path, callback) { logs.mkdirp.push(path); callback(); }, - writeFile: function(name, content, callback) { + writeFile(name, content, callback) { logs.writeFile.push(name, content); files[name] = content.toString("utf-8"); callback(); @@ -48,17 +46,17 @@ describe("Compiler", () => { ); c.run((err, stats) => { if (err) throw err; - should.strictEqual(typeof stats, "object"); + expect(typeof stats).toBe("object"); const compilation = stats.compilation; stats = stats.toJson({ modules: true, reasons: true }); - should.strictEqual(typeof stats, "object"); - stats.should.have.property("errors"); - Array.isArray(stats.errors).should.be.ok(); + expect(typeof stats).toBe("object"); + expect(stats).toHaveProperty("errors"); + expect(Array.isArray(stats.errors)).toBe(true); if (stats.errors.length > 0) { - stats.errors[0].should.be.instanceOf(Error); + expect(stats.errors[0]).toBeInstanceOf(Error); throw stats.errors[0]; } stats.logs = logs; @@ -76,7 +74,7 @@ describe("Compiler", () => { } }, (stats, files) => { - stats.logs.mkdirp.should.eql(["/what", "/what/the"]); + expect(stats.logs.mkdirp).toEqual(["/what", "/what/the"]); done(); } ); @@ -84,92 +82,87 @@ describe("Compiler", () => { it("should compile a single file", done => { compile("./c", {}, (stats, files) => { - files.should.have.property("/main.js").have.type("string"); - Object.keys(files).should.be.eql(["/main.js"]); + expect(Object.keys(files)).toEqual(["/main.js"]); const bundle = files["/main.js"]; - bundle.should.containEql("function __webpack_require__("); - bundle.should.containEql("__webpack_require__(/*! ./a */ 0);"); - bundle.should.containEql("./c.js"); - bundle.should.containEql("./a.js"); - bundle.should.containEql("This is a"); - bundle.should.containEql("This is c"); - bundle.should.not.containEql("2: function("); - bundle.should.not.containEql("window"); - bundle.should.not.containEql("jsonp"); - bundle.should.not.containEql("fixtures"); + expect(bundle).toMatch("function __webpack_require__("); + expect(bundle).toMatch("__webpack_require__(/*! ./a */ 0);"); + expect(bundle).toMatch("./c.js"); + expect(bundle).toMatch("./a.js"); + expect(bundle).toMatch("This is a"); + expect(bundle).toMatch("This is c"); + expect(bundle).not.toMatch("2: function("); + expect(bundle).not.toMatch("window"); + expect(bundle).not.toMatch("jsonp"); + expect(bundle).not.toMatch("fixtures"); done(); }); }); it("should compile a complex file", done => { compile("./main1", {}, (stats, files) => { - files.should.have.property("/main.js").have.type("string"); - Object.keys(files).should.be.eql(["/main.js"]); + expect(Object.keys(files)).toEqual(["/main.js"]); const bundle = files["/main.js"]; - bundle.should.containEql("function __webpack_require__("); - bundle.should.containEql("__webpack_require__(/*! ./a */"); - bundle.should.containEql("./main1.js"); - bundle.should.containEql("./a.js"); - bundle.should.containEql("./b.js"); - bundle.should.containEql("./node_modules/m1/a.js"); - bundle.should.containEql("This is a"); - bundle.should.containEql("This is b"); - bundle.should.containEql("This is m1/a"); - bundle.should.not.containEql("4: function("); - bundle.should.not.containEql("window"); - bundle.should.not.containEql("jsonp"); - bundle.should.not.containEql("fixtures"); + expect(bundle).toMatch("function __webpack_require__("); + expect(bundle).toMatch("__webpack_require__(/*! ./a */"); + expect(bundle).toMatch("./main1.js"); + expect(bundle).toMatch("./a.js"); + expect(bundle).toMatch("./b.js"); + expect(bundle).toMatch("./node_modules/m1/a.js"); + expect(bundle).toMatch("This is a"); + expect(bundle).toMatch("This is b"); + expect(bundle).toMatch("This is m1/a"); + expect(bundle).not.toMatch("4: function("); + expect(bundle).not.toMatch("window"); + expect(bundle).not.toMatch("jsonp"); + expect(bundle).not.toMatch("fixtures"); done(); }); }); it("should compile a file with transitive dependencies", done => { compile("./abc", {}, (stats, files) => { - files.should.have.property("/main.js").have.type("string"); - Object.keys(files).should.be.eql(["/main.js"]); + expect(Object.keys(files)).toEqual(["/main.js"]); const bundle = files["/main.js"]; - bundle.should.containEql("function __webpack_require__("); - bundle.should.containEql("__webpack_require__(/*! ./a */"); - bundle.should.containEql("__webpack_require__(/*! ./b */"); - bundle.should.containEql("__webpack_require__(/*! ./c */"); - bundle.should.containEql("./abc.js"); - bundle.should.containEql("./a.js"); - bundle.should.containEql("./b.js"); - bundle.should.containEql("./c.js"); - bundle.should.containEql("This is a"); - bundle.should.containEql("This is b"); - bundle.should.containEql("This is c"); - bundle.should.not.containEql("4: function("); - bundle.should.not.containEql("window"); - bundle.should.not.containEql("jsonp"); - bundle.should.not.containEql("fixtures"); + expect(bundle).toMatch("function __webpack_require__("); + expect(bundle).toMatch("__webpack_require__(/*! ./a */"); + expect(bundle).toMatch("__webpack_require__(/*! ./b */"); + expect(bundle).toMatch("__webpack_require__(/*! ./c */"); + expect(bundle).toMatch("./abc.js"); + expect(bundle).toMatch("./a.js"); + expect(bundle).toMatch("./b.js"); + expect(bundle).toMatch("./c.js"); + expect(bundle).toMatch("This is a"); + expect(bundle).toMatch("This is b"); + expect(bundle).toMatch("This is c"); + expect(bundle).not.toMatch("4: function("); + expect(bundle).not.toMatch("window"); + expect(bundle).not.toMatch("jsonp"); + expect(bundle).not.toMatch("fixtures"); done(); }); }); it("should compile a file with multiple chunks", done => { compile("./chunks", {}, (stats, files) => { - stats.chunks.length.should.be.eql(2); - files.should.have.property("/main.js").have.type("string"); - files.should.have.property("/0.js").have.type("string"); - Object.keys(files).should.be.eql(["/0.js", "/main.js"]); + expect(stats.chunks).toHaveLength(2); + expect(Object.keys(files)).toEqual(["/0.js", "/main.js"]); const bundle = files["/main.js"]; const chunk = files["/0.js"]; - bundle.should.containEql("function __webpack_require__("); - bundle.should.containEql("__webpack_require__(/*! ./b */"); - chunk.should.not.containEql("__webpack_require__(/* ./b */"); - bundle.should.containEql("./chunks.js"); - chunk.should.containEql("./a.js"); - chunk.should.containEql("./b.js"); - chunk.should.containEql("This is a"); - bundle.should.not.containEql("This is a"); - chunk.should.containEql("This is b"); - bundle.should.not.containEql("This is b"); - bundle.should.not.containEql("4: function("); - bundle.should.not.containEql("fixtures"); - chunk.should.not.containEql("fixtures"); - bundle.should.containEql("webpackJsonp"); - chunk.should.containEql('window["webpackJsonp"] || []).push'); + expect(bundle).toMatch("function __webpack_require__("); + expect(bundle).toMatch("__webpack_require__(/*! ./b */"); + expect(chunk).not.toMatch("__webpack_require__(/* ./b */"); + expect(bundle).toMatch("./chunks.js"); + expect(chunk).toMatch("./a.js"); + expect(chunk).toMatch("./b.js"); + expect(chunk).toMatch("This is a"); + expect(bundle).not.toMatch("This is a"); + expect(chunk).toMatch("This is b"); + expect(bundle).not.toMatch("This is b"); + expect(bundle).not.toMatch("4: function("); + expect(bundle).not.toMatch("fixtures"); + expect(chunk).not.toMatch("fixtures"); + expect(bundle).toMatch("webpackJsonp"); + expect(chunk).toMatch('window["webpackJsonp"] || []).push'); done(); }); }); @@ -187,19 +180,19 @@ describe("Compiler", () => { }); describe("purgeInputFileSystem", () => { it("invokes purge() if inputFileSystem.purge", done => { - const mockPurge = sinon.spy(); + const mockPurge = jest.fn(); compiler.inputFileSystem = { purge: mockPurge }; compiler.purgeInputFileSystem(); - mockPurge.callCount.should.be.exactly(1); + expect(mockPurge.mock.calls.length).toBe(1); done(); }); it("does NOT invoke purge() if !inputFileSystem.purge", done => { - const mockPurge = sinon.spy(); + const mockPurge = jest.fn(); compiler.inputFileSystem = null; compiler.purgeInputFileSystem(); - mockPurge.callCount.should.be.exactly(0); + expect(mockPurge.mock.calls.length).toBe(0); done(); }); }); @@ -207,46 +200,46 @@ describe("Compiler", () => { it("returns booleanized this.parentCompilation", done => { compiler.parentCompilation = "stringyStringString"; const response1 = compiler.isChild(); - response1.should.be.exactly(true); + expect(response1).toBe(true); compiler.parentCompilation = 123456789; const response2 = compiler.isChild(); - response2.should.be.exactly(true); + expect(response2).toBe(true); compiler.parentCompilation = { what: "I belong to an object" }; const response3 = compiler.isChild(); - response3.should.be.exactly(true); + expect(response3).toBe(true); compiler.parentCompilation = ["Array", 123, true, null, [], () => {}]; const response4 = compiler.isChild(); - response4.should.be.exactly(true); + expect(response4).toBe(true); compiler.parentCompilation = false; const response5 = compiler.isChild(); - response5.should.be.exactly(false); + expect(response5).toBe(false); compiler.parentCompilation = 0; const response6 = compiler.isChild(); - response6.should.be.exactly(false); + expect(response6).toBe(false); compiler.parentCompilation = null; const response7 = compiler.isChild(); - response7.should.be.exactly(false); + expect(response7).toBe(false); compiler.parentCompilation = ""; const response8 = compiler.isChild(); - response8.should.be.exactly(false); + expect(response8).toBe(false); compiler.parentCompilation = NaN; const response9 = compiler.isChild(); - response9.should.be.exactly(false); + expect(response9).toBe(false); done(); }); }); }); - it("should not emit on errors", function(done) { + it("should not emit on errors", done => { const compiler = webpack({ context: __dirname, mode: "production", @@ -264,7 +257,7 @@ describe("Compiler", () => { done(); }); }); - it("should not emit on errors (watch)", function(done) { + it("should not emit on errors (watch)", done => { const compiler = webpack({ context: __dirname, mode: "production", diff --git a/test/ConfigTestCases.test.js b/test/ConfigTestCases.test.js index 5819ac38c..0fa46e346 100644 --- a/test/ConfigTestCases.test.js +++ b/test/ConfigTestCases.test.js @@ -1,12 +1,11 @@ "use strict"; -/* globals describe it */ -require("should"); +/* globals describe expect it beforeAll */ const path = require("path"); const fs = require("fs"); const vm = require("vm"); const mkdirp = require("mkdirp"); -const Test = require("mocha/lib/test"); +const rimraf = require("rimraf"); const checkArrayExpectation = require("./checkArrayExpectation"); const Stats = require("../lib/Stats"); @@ -40,8 +39,7 @@ describe("ConfigTestCases", () => { categories.forEach(category => { describe(category.name, () => { category.tests.forEach(testName => { - const suite = describe(testName, () => {}); - it(testName + " should compile", function(done) { + describe(testName, function() { const testDirectory = path.join(casesPath, category.name, testName); const outputDirectory = path.join( __dirname, @@ -50,197 +48,240 @@ describe("ConfigTestCases", () => { category.name, testName ); - const options = prepareOptions( - require(path.join(testDirectory, "webpack.config.js")) - ); - const optionsArr = [].concat(options); - optionsArr.forEach((options, idx) => { - if (!options.context) options.context = testDirectory; - if (!options.mode) options.mode = "production"; - if (!options.optimization) options.optimization = {}; - if (options.optimization.minimize === undefined) - options.optimization.minimize = false; - if (!options.entry) options.entry = "./index.js"; - if (!options.target) options.target = "async-node"; - if (!options.output) options.output = {}; - if (!options.output.path) options.output.path = outputDirectory; - if (typeof options.output.pathinfo === "undefined") - options.output.pathinfo = true; - if (!options.output.filename) - options.output.filename = "bundle" + idx + ".js"; - }); - let testConfig = { - findBundle: function(i, options) { - if ( - fs.existsSync( - path.join(options.output.path, "bundle" + i + ".js") - ) - ) { - return "./bundle" + i + ".js"; - } - }, - timeout: 30000 - }; - try { - // try to load a test file - testConfig = Object.assign( - testConfig, - require(path.join(testDirectory, "test.config.js")) - ); - } catch (e) {} // eslint-disable-line no-empty - - this.timeout(testConfig.timeout); - - webpack(options, (err, stats) => { - if (err) { - const fakeStats = { - errors: [err.stack] - }; - if ( - checkArrayExpectation( - testDirectory, - fakeStats, - "error", - "Error", - done - ) - ) - return; - // Wait for uncaught errors to occur - return setTimeout(done, 200); - } - const statOptions = Stats.presetToOptions("verbose"); - statOptions.colors = false; - mkdirp.sync(outputDirectory); - fs.writeFileSync( - path.join(outputDirectory, "stats.txt"), - stats.toString(statOptions), - "utf-8" - ); - const jsonStats = stats.toJson({ - errorDetails: true - }); - if ( - checkArrayExpectation( - testDirectory, - jsonStats, - "error", - "Error", - done - ) - ) - return; - if ( - checkArrayExpectation( - testDirectory, - jsonStats, - "warning", - "Warning", - done - ) - ) - return; - let exportedTests = 0; - - function _it(title, fn) { - const test = new Test(title, fn); - suite.addTest(test); - exportedTests++; - return test; - } - - function _beforeEach(title, fn) { - return suite.beforeEach(title, fn); - } - - function _afterEach(title, fn) { - return suite.afterEach(title, fn); - } - - const globalContext = { - console: console, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - - function _require(currentDirectory, module) { - if (Array.isArray(module) || /^\.\.?\//.test(module)) { - let fn; - let content; - let p; - if (Array.isArray(module)) { - p = path.join(currentDirectory, module[0]); - content = module - .map(arg => { - p = path.join(currentDirectory, arg); - return fs.readFileSync(p, "utf-8"); - }) - .join("\n"); - } else { - p = path.join(currentDirectory, module); - content = fs.readFileSync(p, "utf-8"); - } - if ( - options.target === "web" || - options.target === "webworker" - ) { - fn = vm.runInNewContext( - "(function(require, module, exports, __dirname, __filename, it, beforeEach, afterEach, window) {" + - content + - "\n})", - globalContext, - p - ); - } else { - fn = vm.runInThisContext( - "(function(require, module, exports, __dirname, __filename, it, beforeEach, afterEach) {" + - content + - "\n})", - p - ); - } - const m = { - exports: {} + const exportedTests = []; + const exportedBeforeEach = []; + const exportedAfterEach = []; + it( + testName + " should compile", + () => + new Promise((resolve, reject) => { + const done = err => { + if (err) return reject(err); + resolve(); }; - fn.call( - m.exports, - _require.bind(null, path.dirname(p)), - m, - m.exports, - path.dirname(p), - p, - _it, - _beforeEach, - _afterEach, - globalContext + rimraf.sync(outputDirectory); + mkdirp.sync(outputDirectory); + const options = prepareOptions( + require(path.join(testDirectory, "webpack.config.js")), + { testPath: outputDirectory } ); - return m.exports; - } else if (testConfig.modules && module in testConfig.modules) { - return testConfig.modules[module]; - } else return require(module); - } - let filesCount = 0; + const optionsArr = [].concat(options); + optionsArr.forEach((options, idx) => { + if (!options.context) options.context = testDirectory; + if (!options.mode) options.mode = "production"; + if (!options.optimization) options.optimization = {}; + if (options.optimization.minimize === undefined) + options.optimization.minimize = false; + if (!options.entry) options.entry = "./index.js"; + if (!options.target) options.target = "async-node"; + if (!options.output) options.output = {}; + if (!options.output.path) + options.output.path = outputDirectory; + if (typeof options.output.pathinfo === "undefined") + options.output.pathinfo = true; + if (!options.output.filename) + options.output.filename = "bundle" + idx + ".js"; + }); + let testConfig = { + findBundle: function(i, options) { + if ( + fs.existsSync( + path.join(options.output.path, "bundle" + i + ".js") + ) + ) { + return "./bundle" + i + ".js"; + } + }, + timeout: 30000 + }; + try { + // try to load a test file + testConfig = Object.assign( + testConfig, + require(path.join(testDirectory, "test.config.js")) + ); + } catch (e) { + // ignored + } - if (testConfig.noTests) return process.nextTick(done); - for (let i = 0; i < optionsArr.length; i++) { - const bundlePath = testConfig.findBundle(i, optionsArr[i]); - if (bundlePath) { - filesCount++; - _require(outputDirectory, bundlePath); - } - } - // give a free pass to compilation that generated an error - if (!jsonStats.errors.length && filesCount !== optionsArr.length) - return done( - new Error( - "Should have found at least one bundle file per webpack config" - ) - ); - if (exportedTests < filesCount) - return done(new Error("No tests exported by test case")); - if (testConfig.afterExecute) testConfig.afterExecute(); - process.nextTick(done); - }); + webpack(options, (err, stats) => { + if (err) { + const fakeStats = { + errors: [err.stack] + }; + if ( + checkArrayExpectation( + testDirectory, + fakeStats, + "error", + "Error", + done + ) + ) + return; + // Wait for uncaught errors to occur + return setTimeout(done, 200); + } + const statOptions = Stats.presetToOptions("verbose"); + statOptions.colors = false; + mkdirp.sync(outputDirectory); + fs.writeFileSync( + path.join(outputDirectory, "stats.txt"), + stats.toString(statOptions), + "utf-8" + ); + const jsonStats = stats.toJson({ + errorDetails: true + }); + if ( + checkArrayExpectation( + testDirectory, + jsonStats, + "error", + "Error", + done + ) + ) + return; + if ( + checkArrayExpectation( + testDirectory, + jsonStats, + "warning", + "Warning", + done + ) + ) + return; + + function _it(title, fn) { + exportedTests.push({ + title, + fn, + timeout: testConfig.timeout + }); + } + + function _beforeEach(fn) { + return exportedBeforeEach.push(fn); + } + + function _afterEach(fn) { + return exportedAfterEach.push(fn); + } + + const globalContext = { + console: console, + expect: expect, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + + function _require(currentDirectory, module) { + if (Array.isArray(module) || /^\.\.?\//.test(module)) { + let fn; + let content; + let p; + if (Array.isArray(module)) { + p = path.join(currentDirectory, module[0]); + content = module + .map(arg => { + p = path.join(currentDirectory, arg); + return fs.readFileSync(p, "utf-8"); + }) + .join("\n"); + } else { + p = path.join(currentDirectory, module); + content = fs.readFileSync(p, "utf-8"); + } + if ( + options.target === "web" || + options.target === "webworker" + ) { + fn = vm.runInNewContext( + "(function(require, module, exports, __dirname, __filename, it, beforeEach, afterEach, expect, jest, window) {" + + content + + "\n})", + globalContext, + p + ); + } else { + fn = vm.runInThisContext( + "(function(require, module, exports, __dirname, __filename, it, beforeEach, afterEach, expect, jest) {" + + "global.expect = expect; " + + content + + "\n})", + p + ); + } + const m = { + exports: {} + }; + fn.call( + m.exports, + _require.bind(null, path.dirname(p)), + m, + m.exports, + path.dirname(p), + p, + _it, + _beforeEach, + _afterEach, + expect, + jest, + globalContext + ); + return m.exports; + } else if ( + testConfig.modules && + module in testConfig.modules + ) { + return testConfig.modules[module]; + } else return require(module); + } + let filesCount = 0; + + if (testConfig.noTests) return process.nextTick(done); + for (let i = 0; i < optionsArr.length; i++) { + const bundlePath = testConfig.findBundle(i, optionsArr[i]); + if (bundlePath) { + filesCount++; + _require(outputDirectory, bundlePath); + } + } + // give a free pass to compilation that generated an error + if ( + !jsonStats.errors.length && + filesCount !== optionsArr.length + ) + return done( + new Error( + "Should have found at least one bundle file per webpack config" + ) + ); + if (exportedTests.length < filesCount) + return done(new Error("No tests exported by test case")); + if (testConfig.afterExecute) testConfig.afterExecute(); + const asyncSuite = describe("exported tests", () => { + exportedBeforeEach.forEach(beforeEach); + exportedAfterEach.forEach(afterEach); + exportedTests.forEach( + ({ title, fn, timeout }) => + fn + ? fit(title, fn, timeout) + : fit(title, () => {}).pend("Skipped") + ); + }); + // workaround for jest running clearSpies on the wrong suite (invoked by clearResourcesForRunnable) + asyncSuite.disabled = true; + + jasmine + .getEnv() + .execute([asyncSuite.id], asyncSuite) + .then(done, done); + }); + }) + ); }); }); }); diff --git a/test/ContextModuleFactory.unittest.js b/test/ContextModuleFactory.unittest.js index 17b058b2f..d4bec304c 100644 --- a/test/ContextModuleFactory.unittest.js +++ b/test/ContextModuleFactory.unittest.js @@ -1,17 +1,17 @@ /* globals describe, it, beforeEach */ "use strict"; -require("should"); + const MemoryFs = require("memory-fs"); const ContextModuleFactory = require("../lib/ContextModuleFactory"); -describe("ContextModuleFactory", function() { - describe("resolveDependencies", function() { +describe("ContextModuleFactory", () => { + describe("resolveDependencies", () => { let factory, memfs; - beforeEach(function() { + beforeEach(() => { factory = new ContextModuleFactory([]); memfs = new MemoryFs(); }); - it("should not report an error when ENOENT errors happen", function(done) { + it("should not report an error when ENOENT errors happen", done => { memfs.readdir = (dir, callback) => { setTimeout(() => callback(null, ["/file"])); }; @@ -28,14 +28,14 @@ describe("ContextModuleFactory", function() { regExp: /.*/ }, (err, res) => { - (!!err).should.be.false(); - res.should.be.an.Array(); - res.length.should.be.exactly(0); + expect(err).toBeFalsy(); + expect(Array.isArray(res)).toBe(true); + expect(res.length).toBe(0); done(); } ); }); - it("should report an error when non-ENOENT errors happen", function(done) { + it("should report an error when non-ENOENT errors happen", done => { memfs.readdir = (dir, callback) => { setTimeout(() => callback(null, ["/file"])); }; @@ -52,8 +52,8 @@ describe("ContextModuleFactory", function() { regExp: /.*/ }, (err, res) => { - err.should.be.an.Error(); - (!!res).should.be.false(); + expect(err).toBeInstanceOf(Error); + expect(res).toBeFalsy(); done(); } ); diff --git a/test/DelegatedModule.unittest.js b/test/DelegatedModule.unittest.js index fdfc9934c..977adbd50 100644 --- a/test/DelegatedModule.unittest.js +++ b/test/DelegatedModule.unittest.js @@ -1,10 +1,10 @@ /* globals describe, it, beforeEach */ "use strict"; -require("should"); + const DelegatedModule = require("../lib/DelegatedModule"); -describe("DelegatedModule", function() { - describe("#updateHash", function() { +describe("DelegatedModule", () => { + describe("#updateHash", () => { const sourceRequest = "dll-reference dll_e54c0fb67f8152792ad2"; const data = { id: "/xg9" @@ -13,7 +13,7 @@ describe("DelegatedModule", function() { const userRequest = "./library.js"; let hashedText; let hash; - beforeEach(function() { + beforeEach(() => { hashedText = ""; hash = { update: text => { @@ -28,11 +28,11 @@ describe("DelegatedModule", function() { ); delegatedModule.updateHash(hash); }); - it("updates hash with delegated module ID", function() { - hashedText.should.containEql("/xg9"); + it("updates hash with delegated module ID", () => { + expect(hashedText).toMatch("/xg9"); }); - it("updates hash with delegation type", function() { - hashedText.should.containEql("require"); + it("updates hash with delegation type", () => { + expect(hashedText).toMatch("require"); }); }); }); diff --git a/test/DependenciesBlockVariable.unittest.js b/test/DependenciesBlockVariable.unittest.js deleted file mode 100644 index f056429f5..000000000 --- a/test/DependenciesBlockVariable.unittest.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; - -const should = require("should"); -const sinon = require("sinon"); -const DependenciesBlockVariable = require("../lib/DependenciesBlockVariable"); - -describe("DependenciesBlockVariable", () => { - let DependenciesBlockVariableInstance, dependencyMock, sandbox; - - before(() => { - sandbox = sinon.sandbox.create(); - dependencyMock = { - constructor: { - name: "DependencyMock" - }, - disconnect: sandbox.spy(), - updateHash: sandbox.spy() - }; - DependenciesBlockVariableInstance = new DependenciesBlockVariable( - "dependencies-name", - "expression", - [dependencyMock] - ); - }); - - afterEach(() => sandbox.restore()); - - describe("hasDependencies", () => - it("returns `true` if has dependencies", () => - should(DependenciesBlockVariableInstance.hasDependencies()).be.true())); - - describe("disconnect", () => - it("trigger dependencies disconnection", () => { - DependenciesBlockVariableInstance.disconnect(); - should(dependencyMock.disconnect.calledOnce).be.true(); - })); - - describe("updateHash", () => { - let hash; - before(() => { - hash = { - update: sandbox.spy() - }; - DependenciesBlockVariableInstance.updateHash(hash); - }); - - it("should update hash dependencies with name", () => - should(hash.update.calledWith("dependencies-name")).be.true()); - - it("should update hash dependencies with expression", () => - should(hash.update.calledWith("expression")).be.true()); - - it("should update hash inside dependencies", () => - should(dependencyMock.updateHash.calledOnce).be.true()); - }); - - describe("expressionSource", () => { - let dependencyTemplates, applyMock; - - before(() => (applyMock = sandbox.spy())); - - it("applies information inside dependency templates", () => { - dependencyTemplates = { - get: function() { - return { - apply: applyMock - }; - } - }; - DependenciesBlockVariableInstance.expressionSource( - dependencyTemplates, - {}, - {} - ); - should(applyMock.calledOnce).be.true(); - }); - - it("applies information inside dependency templates", () => { - dependencyTemplates = { - get: function() { - return false; - } - }; - should(() => { - DependenciesBlockVariableInstance.expressionSource( - dependencyTemplates, - {}, - {} - ); - }).throw("No template for dependency: DependencyMock"); - }); - }); -}); diff --git a/test/Errors.test.js b/test/Errors.test.js index 5f08dfd5d..d67c746fb 100644 --- a/test/Errors.test.js +++ b/test/Errors.test.js @@ -1,7 +1,6 @@ "use strict"; /*globals describe it */ -const should = require("should"); const path = require("path"); const webpack = require("../lib/webpack"); @@ -13,10 +12,10 @@ describe("Errors", () => { const files = {}; c.outputFileSystem = { join: path.join.bind(path), - mkdirp: function(path, callback) { + mkdirp(path, callback) { callback(); }, - writeFile: function(name, content, callback) { + writeFile(name, content, callback) { files[name] = content.toString("utf-8"); callback(); } @@ -30,15 +29,15 @@ describe("Errors", () => { customOutputFilesystem(c); c.run((err, stats) => { if (err) throw err; - should.strictEqual(typeof stats, "object"); + expect(typeof stats).toBe("object"); stats = stats.toJson({ errorDetails: false }); - should.strictEqual(typeof stats, "object"); - stats.should.have.property("errors"); - stats.should.have.property("warnings"); - Array.isArray(stats.errors).should.be.ok(); // eslint-disable-line no-unused-expressions - Array.isArray(stats.warnings).should.be.ok(); // eslint-disable-line no-unused-expressions + expect(typeof stats).toBe("object"); + expect(stats).toHaveProperty("errors"); + expect(stats).toHaveProperty("warnings"); + expect(Array.isArray(stats.errors)).toBe(true); + expect(Array.isArray(stats.warnings)).toBe(true); callback(stats.errors, stats.warnings); }); } @@ -49,19 +48,19 @@ describe("Errors", () => { entry: "./missingFile" }, (errors, warnings) => { - errors.length.should.be.eql(2); - warnings.length.should.be.eql(0); + expect(errors).toHaveLength(2); + expect(warnings).toHaveLength(0); errors.sort(); let lines = errors[0].split("\n"); - lines[0].should.match(/missingFile.js/); - lines[1].should.match(/^Module not found/); - lines[1].should.match(/\.\/dir\/missing2/); - lines[2].should.match(/missingFile.js 12:9/); + expect(lines[0]).toMatch(/missingFile.js/); + expect(lines[1]).toMatch(/^Module not found/); + expect(lines[1]).toMatch(/\.\/dir\/missing2/); + expect(lines[2]).toMatch(/missingFile.js 12:9/); lines = errors[1].split("\n"); - lines[0].should.match(/missingFile.js/); - lines[1].should.match(/^Module not found/); - lines[1].should.match(/\.\/missing/); - lines[2].should.match(/missingFile.js 4:0/); + expect(lines[0]).toMatch(/missingFile.js/); + expect(lines[1]).toMatch(/^Module not found/); + expect(lines[1]).toMatch(/\.\/missing/); + expect(lines[2]).toMatch(/missingFile.js 4:0/); done(); } ); @@ -73,11 +72,13 @@ describe("Errors", () => { entry: "./require.extensions" }, (errors, warnings) => { - errors.length.should.be.eql(0); - warnings.length.should.be.eql(1); + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(1); const lines = warnings[0].split("\n"); - lines[0].should.match(/require.extensions\.js/); - lines[1].should.match(/require.extensions is not supported by webpack/); + expect(lines[0]).toMatch(/require.extensions\.js/); + expect(lines[1]).toMatch( + /require.extensions is not supported by webpack/ + ); done(); } ); @@ -90,17 +91,17 @@ describe("Errors", () => { }, (errors, warnings) => { if (errors.length === 0) { - warnings.length.should.be.eql(1); + expect(warnings).toHaveLength(1); const lines = warnings[0].split("\n"); - lines[4].should.match(/FILE\.js/); - lines[5].should.match(/Used by/); - lines[6].should.match(/case-sensitive/); - lines[7].should.match(/file\.js/); - lines[8].should.match(/Used by/); - lines[9].should.match(/case-sensitive/); + expect(lines[4]).toMatch(/FILE\.js/); + expect(lines[5]).toMatch(/Used by/); + expect(lines[6]).toMatch(/case-sensitive/); + expect(lines[7]).toMatch(/file\.js/); + expect(lines[8]).toMatch(/Used by/); + expect(lines[9]).toMatch(/case-sensitive/); } else { - errors.length.should.be.eql(1); - warnings.length.should.be.eql(0); + expect(errors).toHaveLength(1); + expect(warnings).toHaveLength(0); } done(); } @@ -112,13 +113,13 @@ describe("Errors", () => { entry: "./entry-point" }, (errors, warnings) => { - errors.length.should.be.eql(0); - warnings.length.should.be.eql(1); + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(1); let lines = warnings[0].split("\n"); - lines[0].should.match(/configuration/); - lines[1].should.match(/mode/); - lines[1].should.match(/development/); - lines[1].should.match(/production/); + expect(lines[0]).toMatch(/configuration/); + expect(lines[1]).toMatch(/mode/); + expect(lines[1]).toMatch(/development/); + expect(lines[1]).toMatch(/production/); done(); } ); @@ -130,8 +131,8 @@ describe("Errors", () => { entry: "./no-errors-deprecate" }, (errors, warnings) => { - errors.length.should.be.eql(0); - warnings.length.should.be.eql(0); + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); done(); } ); @@ -143,19 +144,19 @@ describe("Errors", () => { entry: "./missingFile" }, (errors, warnings) => { - errors.length.should.be.eql(2); - warnings.length.should.be.eql(0); + expect(errors).toHaveLength(2); + expect(warnings).toHaveLength(0); errors.sort(); let lines = errors[0].split("\n"); - lines[0].should.match(/missingFile.js/); - lines[1].should.match(/^Module not found/); - lines[1].should.match(/\.\/dir\/missing2/); - lines[2].should.match(/missingFile.js 12:9/); + expect(lines[0]).toMatch(/missingFile.js/); + expect(lines[1]).toMatch(/^Module not found/); + expect(lines[1]).toMatch(/\.\/dir\/missing2/); + expect(lines[2]).toMatch(/missingFile.js 12:9/); lines = errors[1].split("\n"); - lines[0].should.match(/missingFile.js/); - lines[1].should.match(/^Module not found/); - lines[1].should.match(/\.\/missing/); - lines[2].should.match(/missingFile.js 4:0/); + expect(lines[0]).toMatch(/missingFile.js/); + expect(lines[1]).toMatch(/^Module not found/); + expect(lines[1]).toMatch(/\.\/missing/); + expect(lines[2]).toMatch(/missingFile.js 4:0/); done(); } ); @@ -175,13 +176,13 @@ describe("Errors", () => { plugins: [new webpack.HotModuleReplacementPlugin()] }, (errors, warnings) => { - errors.length.should.be.eql(3); - warnings.length.should.be.eql(0); + expect(errors).toHaveLength(3); + expect(warnings).toHaveLength(0); errors.forEach(error => { const lines = error.split("\n"); - lines[0].should.match(/chunk (a|b|c)/); - lines[2].should.match(/\[chunkhash\].js/); - lines[2].should.match(/use \[hash\] instead/); + expect(lines[0]).toMatch(/chunk (a|b|c)/); + expect(lines[2]).toMatch(/\[chunkhash\].js/); + expect(lines[2]).toMatch(/use \[hash\] instead/); }); done(); } diff --git a/test/Examples.test.js b/test/Examples.test.js index d298cf8c1..527d7cb3c 100644 --- a/test/Examples.test.js +++ b/test/Examples.test.js @@ -1,7 +1,6 @@ "use strict"; /* globals describe it */ -require("should"); const path = require("path"); const fs = require("fs"); const webpack = require("../"); @@ -12,50 +11,52 @@ describe("Examples", () => { examples.forEach(examplePath => { const filterPath = path.join(examplePath, "test.filter.js"); + const relativePath = path.relative(basePath, examplePath); if (fs.existsSync(filterPath) && !require(filterPath)()) { - describe.skip(path.relative(basePath, examplePath), () => it("filtered")); + describe.skip(relativePath, () => it("filtered")); return; } - it("should compile " + path.relative(basePath, examplePath), function( - done - ) { - this.timeout(30000); - let options = {}; - let webpackConfigPath = path.join(examplePath, "webpack.config.js"); - webpackConfigPath = - webpackConfigPath.substr(0, 1).toUpperCase() + - webpackConfigPath.substr(1); - if (fs.existsSync(webpackConfigPath)) - options = require(webpackConfigPath); - if (Array.isArray(options)) options.forEach(processOptions); - else processOptions(options); + it( + "should compile " + relativePath, + function(done) { + let options = {}; + let webpackConfigPath = path.join(examplePath, "webpack.config.js"); + webpackConfigPath = + webpackConfigPath.substr(0, 1).toUpperCase() + + webpackConfigPath.substr(1); + if (fs.existsSync(webpackConfigPath)) + options = require(webpackConfigPath); + if (Array.isArray(options)) options.forEach(processOptions); + else processOptions(options); - function processOptions(options) { - options.context = examplePath; - options.output = options.output || {}; - options.output.pathinfo = true; - options.output.path = path.join(examplePath, "dist"); - options.output.publicPath = "dist/"; - if (!options.entry) options.entry = "./example.js"; - if (!options.plugins) options.plugins = []; - // To support deprecated loaders - // TODO remove in webpack 5 - options.plugins.push( - new webpack.LoaderOptionsPlugin({ - options: {} - }) - ); - } - webpack(options, (err, stats) => { - if (err) return done(err); - stats = stats.toJson({ - errorDetails: true - }); - if (stats.errors.length > 0) { - return done(new Error(stats.errors[0])); + function processOptions(options) { + options.context = examplePath; + options.output = options.output || {}; + options.output.pathinfo = true; + options.output.path = path.join(examplePath, "dist"); + options.output.publicPath = "dist/"; + if (!options.entry) options.entry = "./example.js"; + if (!options.plugins) options.plugins = []; + // To support deprecated loaders + // TODO remove in webpack 5 + options.plugins.push( + new webpack.LoaderOptionsPlugin({ + options: {} + }) + ); } - done(); - }); - }); + webpack(options, (err, stats) => { + if (err) return done(err); + stats = stats.toJson({ + errorDetails: true + }); + if (stats.errors.length > 0) { + return done(new Error(stats.errors[0])); + } + done(); + }); + }, + 45000 + ); }); }); diff --git a/test/ExternalModule.unittest.js b/test/ExternalModule.unittest.js index 5d90bfff4..075c46009 100644 --- a/test/ExternalModule.unittest.js +++ b/test/ExternalModule.unittest.js @@ -1,71 +1,70 @@ /* globals describe, it, beforeEach */ "use strict"; -require("should"); -const sinon = require("sinon"); + const ExternalModule = require("../lib/ExternalModule"); const OriginalSource = require("webpack-sources").OriginalSource; const RawSource = require("webpack-sources").RawSource; -describe("ExternalModule", function() { +describe("ExternalModule", () => { let externalModule; let request; let type; - beforeEach(function() { + beforeEach(() => { request = "some/request"; type = "some-type"; externalModule = new ExternalModule(request, type, `${type} ${request}`); }); - describe("#identifier", function() { - it("returns an identifier for this module", function() { + describe("#identifier", () => { + it("returns an identifier for this module", () => { const expected = `external "${request}"`; - externalModule.identifier().should.eql(expected); + expect(externalModule.identifier()).toBe(expected); }); }); - describe("#readableIdentifier", function() { - it("returns an identifier for this module", function() { + describe("#readableIdentifier", () => { + it("returns an identifier for this module", () => { const expected = `external "${request}"`; - externalModule.identifier().should.eql(expected); + expect(externalModule.identifier()).toBe(expected); }); }); - describe("#needRebuild", function() { - it("always returns false", function() { - externalModule.needRebuild().should.eql(false); + describe("#needRebuild", () => { + it("always returns false", () => { + expect(externalModule.needRebuild()).toBe(false); }); }); - describe("#size", function() { - it("always returns 42", function() { - externalModule.size().should.eql(42); + describe("#size", () => { + it("always returns 42", () => { + expect(externalModule.size()).toBe(42); }); }); - describe("#source", function() { - it("calls getSource with the result of getSourceString", function() { + describe("#source", () => { + it("calls getSource with the result of getSourceString", () => { // set up const expectedString = "something expected stringy"; const expectedSource = "something expected source"; - externalModule.getSource = sinon.stub().returns(expectedSource); - externalModule.getSourceString = sinon.stub().returns(expectedString); + externalModule.getSource = jest.fn(() => expectedSource); + externalModule.getSourceString = jest.fn(() => expectedString); // invoke const result = externalModule.source(); // check - externalModule.getSource.callCount.should.eql(1); - externalModule.getSourceString.callCount.should.eql(1); - externalModule.getSource.args[0][0].should.eql(expectedString); - result.should.eql(expectedSource); + expect(externalModule.getSource.mock.calls.length).toBe(1); + expect(externalModule.getSourceString.mock.calls.length).toBe(1); + expect(externalModule.getSource.mock.calls[0][0]).toBe(expectedString); + expect(result).toEqual(expectedSource); }); }); - describe("#getSource", function() { - describe("given it should use source maps", function() { - beforeEach(function() { + describe("#getSource", () => { + describe("given it should use source maps", () => { + beforeEach(() => { externalModule.useSourceMap = true; }); - it("returns an instance of OriginalSource", function() { + it("returns an instance of OriginalSource", () => { // set up const someSourceString = "some source string"; @@ -73,14 +72,14 @@ describe("ExternalModule", function() { const result = externalModule.getSource(someSourceString); // check - result.should.be.instanceOf(OriginalSource); + expect(result).toBeInstanceOf(OriginalSource); }); }); - describe("given it does not use source maps", function() { - beforeEach(function() { + describe("given it does not use source maps", () => { + beforeEach(() => { externalModule.useSourceMap = false; }); - it("returns an instance of RawSource", function() { + it("returns an instance of RawSource", () => { // set up const someSourceString = "some source string"; @@ -88,14 +87,14 @@ describe("ExternalModule", function() { const result = externalModule.getSource(someSourceString); // check - result.should.be.instanceOf(RawSource); + expect(result).toBeInstanceOf(RawSource); }); }); }); - describe("#getSourceForGlobalVariableExternal", function() { - describe("given an array as variable name in the global namespace", function() { - it("use the array as lookup in the global object", function() { + describe("#getSourceForGlobalVariableExternal", () => { + describe("given an array as variable name in the global namespace", () => { + it("use the array as lookup in the global object", () => { // set up const type = "window"; const varName = ["foo", "bar"]; @@ -109,11 +108,11 @@ describe("ExternalModule", function() { ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); - describe("given an single variable name", function() { - it("look it up in the global namespace", function() { + describe("given an single variable name", () => { + it("look it up in the global namespace", () => { // set up const type = "window"; const varName = "foo"; @@ -126,14 +125,14 @@ describe("ExternalModule", function() { ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); }); - describe("#getSourceForCommonJsExternal", function() { - describe("given an array as names in the global namespace", function() { - it("use the first to require a module and the rest as lookup on the required module", function() { + describe("#getSourceForCommonJsExternal", () => { + describe("given an array as names in the global namespace", () => { + it("use the first to require a module and the rest as lookup on the required module", () => { // set up const varName = ["module", "look", "up"]; const expected = 'module.exports = require(module)["look"]["up"];'; @@ -145,11 +144,11 @@ describe("ExternalModule", function() { ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); - describe("given an single variable name", function() { - it("require a module with that name", function() { + describe("given an single variable name", () => { + it("require a module with that name", () => { // set up const type = "window"; const varName = "foo"; @@ -162,17 +161,17 @@ describe("ExternalModule", function() { ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); }); - describe("#checkExternalVariable", function() { - it("creates a check that fails if a variable does not exist", function() { + describe("#checkExternalVariable", () => { + it("creates a check that fails if a variable does not exist", () => { // set up const variableToCheck = "foo"; const request = "bar"; - const expected = `if(typeof foo === 'undefined') {var e = new Error("Cannot find module \\"bar\\""); e.code = 'MODULE_NOT_FOUND'; throw e;} + const expected = `if(typeof foo === 'undefined') {var e = new Error("Cannot find module 'bar'"); e.code = 'MODULE_NOT_FOUND'; throw e;} `; // invoke @@ -182,12 +181,12 @@ describe("ExternalModule", function() { ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); - describe("#getSourceForAmdOrUmdExternal", function() { - it("looks up a global variable as specified by the id", function() { + describe("#getSourceForAmdOrUmdExternal", () => { + it("looks up a global variable as specified by the id", () => { // set up const id = "someId"; const optional = false; @@ -201,14 +200,14 @@ describe("ExternalModule", function() { ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); describe("given an optional check is set", function() { - it("ads a check for the existence of the variable before looking it up", function() { + it("ads a check for the existence of the variable before looking it up", () => { // set up const id = "someId"; const optional = true; - const expected = `if(typeof __WEBPACK_EXTERNAL_MODULE_someId__ === 'undefined') {var e = new Error("Cannot find module \\"some/request\\""); e.code = 'MODULE_NOT_FOUND'; throw e;} + const expected = `if(typeof __WEBPACK_EXTERNAL_MODULE_someId__ === 'undefined') {var e = new Error("Cannot find module 'some/request'"); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_someId__;`; // invoke @@ -219,13 +218,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_someId__;`; ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); }); - describe("#getSourceForDefaultCase", function() { - it("returns the given request as lookup", function() { + describe("#getSourceForDefaultCase", () => { + it("returns the given request as lookup", () => { // set up const optional = false; const expected = "module.exports = some/request;"; @@ -234,13 +233,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_someId__;`; const result = externalModule.getSourceForDefaultCase(optional, request); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); describe("given an optional check is requested", function() { - it("checks for the existence of the request setting it", function() { + it("checks for the existence of the request setting it", () => { // set up const optional = true; - const expected = `if(typeof some/request === 'undefined') {var e = new Error("Cannot find module \\"some/request\\""); e.code = 'MODULE_NOT_FOUND'; throw e;} + const expected = `if(typeof some/request === 'undefined') {var e = new Error("Cannot find module 'some/request'"); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = some/request;`; // invoke @@ -250,15 +249,15 @@ module.exports = some/request;`; ); // check - result.should.eql(expected); + expect(result).toEqual(expected); }); }); }); - describe("#updateHash", function() { + describe("#updateHash", () => { let hashedText; let hash; - beforeEach(function() { + beforeEach(() => { hashedText = ""; hash = { update: text => { @@ -268,21 +267,21 @@ module.exports = some/request;`; externalModule.id = 12345678; externalModule.updateHash(hash); }); - it("updates hash with request", function() { - hashedText.should.containEql("some/request"); + it("updates hash with request", () => { + expect(hashedText).toMatch("some/request"); }); - it("updates hash with type", function() { - hashedText.should.containEql("some-type"); + it("updates hash with type", () => { + expect(hashedText).toMatch("some-type"); }); - it("updates hash with module id", function() { - hashedText.should.containEql("12345678"); + it("updates hash with module id", () => { + expect(hashedText).toMatch("12345678"); }); }); - describe("#updateHash without optional", function() { + describe("#updateHash without optional", () => { let hashedText; let hash; - beforeEach(function() { + beforeEach(() => { hashedText = ""; hash = { update: text => { @@ -293,17 +292,17 @@ module.exports = some/request;`; externalModule.id = 12345678; externalModule.updateHash(hash); }); - it("updates hash with request", function() { - hashedText.should.containEql("some/request"); + it("updates hash with request", () => { + expect(hashedText).toMatch("some/request"); }); - it("updates hash with type", function() { - hashedText.should.containEql("some-type"); + it("updates hash with type", () => { + expect(hashedText).toMatch("some-type"); }); - it("updates hash with optional flag", function() { - hashedText.should.containEql("false"); + it("updates hash with optional flag", () => { + expect(hashedText).toMatch("false"); }); - it("updates hash with module id", function() { - hashedText.should.containEql("12345678"); + it("updates hash with module id", () => { + expect(hashedText).toMatch("12345678"); }); }); }); diff --git a/test/HarmonyExportImportedSpecifierDependency.unittest.js b/test/HarmonyExportImportedSpecifierDependency.unittest.js index 3f70bc93b..29b257455 100644 --- a/test/HarmonyExportImportedSpecifierDependency.unittest.js +++ b/test/HarmonyExportImportedSpecifierDependency.unittest.js @@ -1,7 +1,6 @@ /* globals describe, it, beforeEach */ "use strict"; -const should = require("should"); const HarmonyExportImportedSpecifierDependency = require("../lib/dependencies/HarmonyExportImportedSpecifierDependency"); describe("HarmonyExportImportedSpecifierDependency", () => { @@ -9,8 +8,8 @@ describe("HarmonyExportImportedSpecifierDependency", () => { it("should return empty string on missing module", () => { // see e.g. PR #4368 var instance = new HarmonyExportImportedSpecifierDependency(); - should(instance.getHashValue(undefined)).be.eql(""); - should(instance.getHashValue(null)).be.eql(""); + expect(instance.getHashValue(undefined)).toBe(""); + expect(instance.getHashValue(null)).toBe(""); }); }); }); diff --git a/test/HotModuleReplacementPlugin.test.js b/test/HotModuleReplacementPlugin.test.js index e56529d10..c86df04ed 100644 --- a/test/HotModuleReplacementPlugin.test.js +++ b/test/HotModuleReplacementPlugin.test.js @@ -1,38 +1,54 @@ "use strict"; -require("should"); const path = require("path"); const fs = require("fs"); +const mkdirp = require("mkdirp"); const webpack = require("../"); -describe("HotModuleReplacementPlugin", function() { - this.timeout(10000); +describe("HotModuleReplacementPlugin", () => { + jest.setTimeout(20000); it("should not have circular hashes but equal if unmodified", done => { - const entryFile = path.join(__dirname, "js", "entry.js"); + const entryFile = path.join( + __dirname, + "js", + "HotModuleReplacementPlugin", + "entry.js" + ); const statsFile1 = path.join( __dirname, "js", + "HotModuleReplacementPlugin", "HotModuleReplacementPlugin.test.stats1.txt" ); const statsFile2 = path.join( __dirname, "js", + "HotModuleReplacementPlugin", "HotModuleReplacementPlugin.test.stats2.txt" ); - const recordsFile = path.join(__dirname, "js", "records.json"); + const recordsFile = path.join( + __dirname, + "js", + "HotModuleReplacementPlugin", + "records.json" + ); try { - fs.mkdirSync(path.join(__dirname, "js")); - } catch (e) {} // eslint-disable-line no-empty + mkdirp.sync(path.join(__dirname, "js", "HotModuleReplacementPlugin")); + } catch (e) { + // empty + } try { fs.unlinkSync(recordsFile); - } catch (e) {} // eslint-disable-line no-empty + } catch (e) { + // empty + } const compiler = webpack({ cache: false, entry: entryFile, recordsPath: recordsFile, output: { - path: path.join(__dirname, "js") + path: path.join(__dirname, "js", "HotModuleReplacementPlugin") }, plugins: [ new webpack.HotModuleReplacementPlugin(), @@ -48,28 +64,19 @@ describe("HotModuleReplacementPlugin", function() { if (err) throw err; const lastHash1 = stats.toJson().hash; fs.writeFileSync(statsFile2, stats.toString()); - lastHash1.should.be.eql( - oldHash1, - "hash shouldn't change when bundle stay equal" - ); + expect(lastHash1).toBe(oldHash1); // hash shouldn't change when bundle stay equal fs.writeFileSync(entryFile, "2", "utf-8"); compiler.run((err, stats) => { if (err) throw err; const lastHash2 = stats.toJson().hash; fs.writeFileSync(statsFile1, stats.toString()); - lastHash2.should.not.be.eql( - lastHash1, - "hash should change when bundle changes" - ); + expect(lastHash2).not.toBe(lastHash1); // hash should change when bundle changes fs.writeFileSync(entryFile, "1", "utf-8"); compiler.run((err, stats) => { if (err) throw err; const currentHash1 = stats.toJson().hash; fs.writeFileSync(statsFile2, stats.toString()); - currentHash1.should.not.be.eql( - lastHash1, - "hash shouldn't change to the first hash if bundle changed back to first bundle" - ); + expect(currentHash1).not.toBe(lastHash1); // hash shouldn't change to the first hash if bundle changed back to first bundle fs.writeFileSync(entryFile, "2", "utf-8"); compiler.run((err, stats) => { if (err) throw err; @@ -77,10 +84,10 @@ describe("HotModuleReplacementPlugin", function() { fs.writeFileSync(statsFile1, stats.toString()); compiler.run((err, stats) => { if (err) throw err; - stats.toJson().hash.should.be.eql(currentHash2); - currentHash2.should.not.be.eql(lastHash2); - currentHash1.should.not.be.eql(currentHash2); - lastHash1.should.not.be.eql(lastHash2); + expect(stats.toJson().hash).toBe(currentHash2); + expect(currentHash2).not.toBe(lastHash2); + expect(currentHash1).not.toBe(currentHash2); + expect(lastHash1).not.toBe(lastHash2); done(); }); }); diff --git a/test/HotTestCases.test.js b/test/HotTestCases.test.js index e9d4254e9..b31b53213 100644 --- a/test/HotTestCases.test.js +++ b/test/HotTestCases.test.js @@ -1,10 +1,9 @@ "use strict"; -require("should"); +/* globals expect fit */ const path = require("path"); const fs = require("fs"); const vm = require("vm"); -const Test = require("mocha/lib/test"); const checkArrayExpectation = require("./checkArrayExpectation"); const webpack = require("../lib/webpack"); @@ -25,88 +24,60 @@ describe("HotTestCases", () => { categories.forEach(category => { describe(category.name, () => { category.tests.forEach(testName => { - const suite = describe(testName, function() { - this.timeout(10000); - }); - it(testName + " should compile", function(done) { - this.timeout(10000); - const testDirectory = path.join(casesPath, category.name, testName); - const outputDirectory = path.join( - __dirname, - "js", - "hot-cases", - category.name, - testName - ); - const recordsPath = path.join(outputDirectory, "records.json"); - if (fs.existsSync(recordsPath)) fs.unlinkSync(recordsPath); - const fakeUpdateLoaderOptions = { - updateIndex: 0 - }; - const configPath = path.join(testDirectory, "webpack.config.js"); - let options = {}; - if (fs.existsSync(configPath)) options = require(configPath); - if (!options.mode) options.mode = "development"; - if (!options.context) options.context = testDirectory; - if (!options.entry) options.entry = "./index.js"; - if (!options.output) options.output = {}; - if (!options.output.path) options.output.path = outputDirectory; - if (!options.output.filename) options.output.filename = "bundle.js"; - if (options.output.pathinfo === undefined) - options.output.pathinfo = true; - if (!options.module) options.module = {}; - if (!options.module.rules) options.module.rules = []; - options.module.rules.push({ - test: /\.js$/, - loader: path.join(__dirname, "hotCases", "fake-update-loader.js"), - enforce: "pre" - }); - if (!options.target) options.target = "async-node"; - if (!options.plugins) options.plugins = []; - options.plugins.push( - new webpack.HotModuleReplacementPlugin(), - new webpack.NamedModulesPlugin(), - new webpack.LoaderOptionsPlugin(fakeUpdateLoaderOptions) - ); - if (!options.recordsPath) options.recordsPath = recordsPath; - const compiler = webpack(options); - compiler.run((err, stats) => { - if (err) return done(err); - const jsonStats = stats.toJson({ - errorDetails: true - }); - if ( - checkArrayExpectation( - testDirectory, - jsonStats, - "error", - "Error", - done - ) - ) - return; - if ( - checkArrayExpectation( - testDirectory, - jsonStats, - "warning", - "Warning", - done - ) - ) - return; - let exportedTests = 0; - - function _it(title, fn) { - const test = new Test(title, fn); - test.timeout(5000); - suite.addTest(test); - exportedTests++; - return test; - } - - function _next(callback) { - fakeUpdateLoaderOptions.updateIndex++; + describe( + testName, + () => { + let exportedTests = []; + it(testName + " should compile", done => { + const testDirectory = path.join( + casesPath, + category.name, + testName + ); + const outputDirectory = path.join( + __dirname, + "js", + "hot-cases", + category.name, + testName + ); + const recordsPath = path.join(outputDirectory, "records.json"); + if (fs.existsSync(recordsPath)) fs.unlinkSync(recordsPath); + const fakeUpdateLoaderOptions = { + updateIndex: 0 + }; + const configPath = path.join(testDirectory, "webpack.config.js"); + let options = {}; + if (fs.existsSync(configPath)) options = require(configPath); + if (!options.mode) options.mode = "development"; + if (!options.context) options.context = testDirectory; + if (!options.entry) options.entry = "./index.js"; + if (!options.output) options.output = {}; + if (!options.output.path) options.output.path = outputDirectory; + if (!options.output.filename) + options.output.filename = "bundle.js"; + if (options.output.pathinfo === undefined) + options.output.pathinfo = true; + if (!options.module) options.module = {}; + if (!options.module.rules) options.module.rules = []; + options.module.rules.push({ + test: /\.js$/, + loader: path.join( + __dirname, + "hotCases", + "fake-update-loader.js" + ), + enforce: "pre" + }); + if (!options.target) options.target = "async-node"; + if (!options.plugins) options.plugins = []; + options.plugins.push( + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), + new webpack.LoaderOptionsPlugin(fakeUpdateLoaderOptions) + ); + if (!options.recordsPath) options.recordsPath = recordsPath; + const compiler = webpack(options); compiler.run((err, stats) => { if (err) return done(err); const jsonStats = stats.toJson({ @@ -117,59 +88,115 @@ describe("HotTestCases", () => { testDirectory, jsonStats, "error", - "errors" + fakeUpdateLoaderOptions.updateIndex, "Error", done ) - ) + ) { return; + } if ( checkArrayExpectation( testDirectory, jsonStats, "warning", - "warnings" + fakeUpdateLoaderOptions.updateIndex, "Warning", done ) - ) + ) { return; - if (callback) callback(jsonStats); - }); - } + } - function _require(module) { - if (module.substr(0, 2) === "./") { - const p = path.join(outputDirectory, module); - const fn = vm.runInThisContext( - "(function(require, module, exports, __dirname, __filename, it, NEXT, STATS) {" + - fs.readFileSync(p, "utf-8") + - "\n})", - p - ); - const m = { - exports: {} - }; - fn.call( - m.exports, - _require, - m, - m.exports, - outputDirectory, - p, - _it, - _next, - jsonStats - ); - return m.exports; - } else return require(module); - } - _require("./bundle.js"); - if (exportedTests < 1) - return done(new Error("No tests exported by test case")); - process.nextTick(done); - }); - }); + function _it(title, fn) { + exportedTests.push({ title, fn, timeout: 10000 }); + } + + function _next(callback) { + fakeUpdateLoaderOptions.updateIndex++; + compiler.run((err, stats) => { + if (err) return done(err); + const jsonStats = stats.toJson({ + errorDetails: true + }); + if ( + checkArrayExpectation( + testDirectory, + jsonStats, + "error", + "errors" + fakeUpdateLoaderOptions.updateIndex, + "Error", + done + ) + ) { + return; + } + if ( + checkArrayExpectation( + testDirectory, + jsonStats, + "warning", + "warnings" + fakeUpdateLoaderOptions.updateIndex, + "Warning", + done + ) + ) { + return; + } + if (callback) callback(jsonStats); + }); + } + + function _require(module) { + if (module.substr(0, 2) === "./") { + const p = path.join(outputDirectory, module); + const fn = vm.runInThisContext( + "(function(require, module, exports, __dirname, __filename, it, expect, NEXT, STATS) {" + + "global.expect = expect;" + + fs.readFileSync(p, "utf-8") + + "\n})", + p + ); + const m = { + exports: {} + }; + fn.call( + m.exports, + _require, + m, + m.exports, + outputDirectory, + p, + _it, + expect, + _next, + jsonStats + ); + return m.exports; + } else return require(module); + } + _require("./bundle.js"); + if (exportedTests.length < 1) + return done(new Error("No tests exported by test case")); + + const asyncSuite = describe("exported tests", () => { + exportedTests.forEach( + ({ title, fn, timeout }) => + fn + ? fit(title, fn, timeout) + : fit(title, () => {}).pend("Skipped") + ); + }); + // workaround for jest running clearSpies on the wrong suite (invoked by clearResourcesForRunnable) + asyncSuite.disabled = true; + + jasmine + .getEnv() + .execute([asyncSuite.id], asyncSuite) + .then(done, done); + }); + }); + }, + 10000 + ); }); }); }); diff --git a/test/Integration.test.js b/test/Integration.test.js index 64afab276..a09f0c8e3 100644 --- a/test/Integration.test.js +++ b/test/Integration.test.js @@ -1,12 +1,10 @@ "use strict"; -require("should"); const path = require("path"); - const webpack = require("../lib/webpack"); -describe("Integration", function() { - this.timeout(5000); +describe("Integration", () => { + jest.setTimeout(10000); it("should compile library1", done => { webpack( { @@ -23,8 +21,8 @@ describe("Integration", function() { }, (err, stats) => { if (err) throw err; - stats.hasErrors().should.be.not.ok(); - stats.hasWarnings().should.be.not.ok(); + expect(stats.hasErrors()).toBe(false); + expect(stats.hasWarnings()).toBe(false); done(); } ); @@ -58,13 +56,6 @@ describe("Integration", function() { optimization: { minimize: false }, - resolve: { - // cannot resolve should outside the outermost node_modules - // so it is injected here - alias: { - should: require.resolve("should") - } - }, plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 @@ -104,8 +95,8 @@ describe("Integration", function() { }, (err, stats) => { if (err) throw err; - stats.hasErrors().should.be.not.ok(); - stats.hasWarnings().should.be.not.ok(); + expect(stats.hasErrors()).toBe(false); + expect(stats.hasWarnings()).toBe(false); done(); } ); diff --git a/test/LocalModulesHelpers.unittest.js b/test/LocalModulesHelpers.unittest.js index 8f0fd513a..b85869707 100644 --- a/test/LocalModulesHelpers.unittest.js +++ b/test/LocalModulesHelpers.unittest.js @@ -1,7 +1,6 @@ /* globals describe, it */ "use strict"; -const should = require("should"); const LocalModulesHelpers = require("../lib/dependencies/LocalModulesHelpers"); describe("LocalModulesHelpers", () => { @@ -11,15 +10,18 @@ describe("LocalModulesHelpers", () => { module: "module_sample", localModules: ["first", "second"] }; - should(LocalModulesHelpers.addLocalModule(state, "local_module_sample")) - .be.an.instanceOf(Object) - .and.have.properties({ - module: "module_sample", - name: "local_module_sample", - idx: 2, - used: false - }); - should(state.localModules.length).be.eql(3); + const localModule = LocalModulesHelpers.addLocalModule( + state, + "local_module_sample" + ); + expect(localModule).toBeInstanceOf(Object); + expect(localModule).toMatchObject({ + module: "module_sample", + name: "local_module_sample", + idx: 2, + used: false + }); + expect(state.localModules.length).toBe(3); }); }); @@ -36,9 +38,9 @@ describe("LocalModulesHelpers", () => { } ] }; - should( + expect( LocalModulesHelpers.getLocalModule(state, "local_module_sample") - ).be.eql(null); + ).toBe(null); }); it("returns local module information", () => { @@ -53,7 +55,7 @@ describe("LocalModulesHelpers", () => { } ] }; - should(LocalModulesHelpers.getLocalModule(state, "first")).be.eql({ + expect(LocalModulesHelpers.getLocalModule(state, "first")).toEqual({ name: "first" }); }); diff --git a/test/ModuleDependencyError.unittest.js b/test/ModuleDependencyError.unittest.js index cd01f0765..3412b437d 100644 --- a/test/ModuleDependencyError.unittest.js +++ b/test/ModuleDependencyError.unittest.js @@ -1,15 +1,14 @@ "use strict"; const path = require("path"); -require("should"); const ModuleDependencyError = require("../lib/ModuleDependencyError"); describe("ModuleDependencyError", () => { let env; - beforeEach(() => (env = {})); - - it("is a function", () => ModuleDependencyError.should.be.a.Function()); + beforeEach(() => { + env = {}; + }); describe("when new error created", () => { beforeEach(() => { @@ -21,27 +20,30 @@ describe("ModuleDependencyError", () => { ); }); - it("is an error", () => env.moduleDependencyError.should.be.an.Error()); + it("is an error", () => { + expect(env.moduleDependencyError).toBeInstanceOf(Error); + }); - it("has a name property", () => - env.moduleDependencyError.name.should.be.exactly( - "ModuleDependencyError" - )); + it("has a name property", () => { + expect(env.moduleDependencyError.name).toBe("ModuleDependencyError"); + }); - it("has a message property", () => - env.moduleDependencyError.message.should.be.exactly( - "Location Error Message" - )); + it("has a message property", () => { + expect(env.moduleDependencyError.message).toBe("Location Error Message"); + }); - it("has a details property", () => - env.moduleDependencyError.details.should.containEql( + it("has a details property", () => { + expect(env.moduleDependencyError.details).toMatch( path.join("test", "ModuleDependencyError.unittest.js:") - )); + ); + }); - it("has an origin property", () => - env.moduleDependencyError.origin.should.be.exactly("myModule")); + it("has an origin property", () => { + expect(env.moduleDependencyError.origin).toBe("myModule"); + }); - it("has an error property", () => - env.moduleDependencyError.error.should.be.exactly(env.error)); + it("has an error property", () => { + expect(env.moduleDependencyError.error).toBe(env.error); + }); }); }); diff --git a/test/ModuleReason.unittest.js b/test/ModuleReason.unittest.js index b72519024..56a6cc25c 100644 --- a/test/ModuleReason.unittest.js +++ b/test/ModuleReason.unittest.js @@ -4,7 +4,6 @@ const Module = require("../lib/Module"); const Chunk = require("../lib/Chunk"); const Dependency = require("../lib/Dependency"); const ModuleReason = require("../lib/ModuleReason"); -const should = require("should"); describe("ModuleReason", () => { let myModule; @@ -23,12 +22,13 @@ describe("ModuleReason", () => { }); describe("hasChunk", () => { - it("returns false when chunk is not present", () => - should(myModuleReason.hasChunk(myChunk)).be.false()); + it("returns false when chunk is not present", () => { + expect(myModuleReason.hasChunk(myChunk)).toBe(false); + }); it("returns true when chunk is present", () => { myModuleReason.module.addChunk(myChunk); - should(myModuleReason.hasChunk(myChunk)).be.true(); + expect(myModuleReason.hasChunk(myChunk)).toBe(true); }); }); @@ -37,15 +37,15 @@ describe("ModuleReason", () => { myModuleReason.module.addChunk(myChunk); myModuleReason.rewriteChunks(myChunk, [myChunk2]); - should(myModuleReason.hasChunk(myChunk)).be.false(); - should(myModuleReason.hasChunk(myChunk2)).be.true(); + expect(myModuleReason.hasChunk(myChunk)).toBe(false); + expect(myModuleReason.hasChunk(myChunk2)).toBe(true); }); it("if old chunk is not present, new chunks are not added", () => { myModuleReason.rewriteChunks(myChunk, [myChunk2]); - should(myModuleReason.hasChunk(myChunk)).be.false(); - should(myModuleReason.hasChunk(myChunk2)).be.false(); + expect(myModuleReason.hasChunk(myChunk)).toBe(false); + expect(myModuleReason.hasChunk(myChunk2)).toBe(false); }); it("if already rewritten chunk is present, it is replaced with new chunks", () => { @@ -53,8 +53,8 @@ describe("ModuleReason", () => { myModuleReason.rewriteChunks(myChunk, [myChunk2]); myModuleReason.rewriteChunks(myChunk2, [myChunk]); - should(myModuleReason.hasChunk(myChunk)).be.true(); - should(myModuleReason.hasChunk(myChunk2)).be.false(); + expect(myModuleReason.hasChunk(myChunk)).toBe(true); + expect(myModuleReason.hasChunk(myChunk2)).toBe(false); }); }); }); diff --git a/test/MultiCompiler.test.js b/test/MultiCompiler.test.js index bb3a11f7e..a3e60aaaa 100644 --- a/test/MultiCompiler.test.js +++ b/test/MultiCompiler.test.js @@ -2,7 +2,6 @@ /* globals describe it */ const path = require("path"); -const should = require("should"); const MemoryFs = require("memory-fs"); const webpack = require("../"); @@ -31,7 +30,7 @@ describe("MultiCompiler", function() { if (err) { throw err; } else { - should(called).be.equal(2); + expect(called).toBe(2); done(); } }); @@ -47,7 +46,7 @@ describe("MultiCompiler", function() { throw err; } else { watcher.close(); - should(called).be.equal(2); + expect(called).toBe(2); done(); } }); @@ -64,11 +63,11 @@ describe("MultiCompiler", function() { }); it("should not be run twice at a time (watch)", function(done) { const compiler = createMultiCompiler(); - compiler.watch({}, (err, stats) => { + const watcher = compiler.watch({}, (err, stats) => { if (err) return done(err); }); compiler.watch({}, (err, stats) => { - if (err) return done(); + if (err) return watcher.close(done); }); }); it("should not be run twice at a time (run - watch)", function(done) { @@ -82,11 +81,12 @@ describe("MultiCompiler", function() { }); it("should not be run twice at a time (watch - run)", function(done) { const compiler = createMultiCompiler(); - compiler.watch({}, (err, stats) => { + let watcher; + watcher = compiler.watch({}, (err, stats) => { if (err) return done(err); }); compiler.run((err, stats) => { - if (err) return done(); + if (err) return watcher.close(done); }); }); it("should not be run twice at a time (instance cb)", function(done) { @@ -123,9 +123,10 @@ describe("MultiCompiler", function() { compiler.run((err, stats) => { if (err) return done(err); - compiler.watch({}, (err, stats) => { + let watcher; + watcher = compiler.watch({}, (err, stats) => { if (err) return done(err); - done(); + watcher.close(done); }); }); }); @@ -147,9 +148,10 @@ describe("MultiCompiler", function() { if (err) return done(err); }); watching.close(() => { - compiler.watch({}, (err, stats) => { + let watcher; + watcher = compiler.watch({}, (err, stats) => { if (err) return done(err); - done(); + watcher.close(done); }); }); }); diff --git a/test/MultiStats.unittest.js b/test/MultiStats.unittest.js index 6d096bbb0..6137dc3c6 100644 --- a/test/MultiStats.unittest.js +++ b/test/MultiStats.unittest.js @@ -1,6 +1,5 @@ "use strict"; -require("should"); const packageJSON = require("../package.json"); const MultiStats = require("../lib/MultiStats"); @@ -36,7 +35,9 @@ describe("MultiStats", () => { packageJSON.version = "1.2.3"; }); - afterEach(() => (packageJSON.version = packageVersion)); + afterEach(() => { + packageJSON.version = packageVersion; + }); describe("created", () => { beforeEach(() => { @@ -51,8 +52,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("creates a hash string", () => - myMultiStats.hash.should.be.exactly("abc123xyz890")); + it("creates a hash string", () => { + expect(myMultiStats.hash).toBe("abc123xyz890"); + }); }); describe("hasErrors", () => { @@ -69,8 +71,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("returns true", () => - myMultiStats.hasErrors().should.be.exactly(true)); + it("returns true", () => { + expect(myMultiStats.hasErrors()).toBe(true); + }); }); describe("when one has an error", () => { @@ -84,8 +87,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("returns true", () => - myMultiStats.hasErrors().should.be.exactly(true)); + it("returns true", () => { + expect(myMultiStats.hasErrors()).toBe(true); + }); }); describe("when none have errors", () => { @@ -94,8 +98,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("returns false", () => - myMultiStats.hasErrors().should.be.exactly(false)); + it("returns false", () => { + expect(myMultiStats.hasErrors()).toBe(false); + }); }); }); @@ -113,8 +118,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("returns true", () => - myMultiStats.hasWarnings().should.be.exactly(true)); + it("returns true", () => { + expect(myMultiStats.hasWarnings()).toBe(true); + }); }); describe("when one has a warning", () => { @@ -128,8 +134,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("returns true", () => - myMultiStats.hasWarnings().should.be.exactly(true)); + it("returns true", () => { + expect(myMultiStats.hasWarnings()).toBe(true); + }); }); describe("when none have warnings", () => { @@ -138,8 +145,9 @@ describe("MultiStats", () => { myMultiStats = new MultiStats(stats); }); - it("returns false", () => - myMultiStats.hasWarnings().should.be.exactly(false)); + it("returns false", () => { + expect(myMultiStats.hasWarnings()).toBe(false); + }); }); }); @@ -175,7 +183,7 @@ describe("MultiStats", () => { version: false, hash: false }); - result.should.deepEqual({ + expect(result).toEqual({ errors: ["(abc123-compilation) abc123-error"], warnings: [ "(abc123-compilation) abc123-warning", @@ -200,7 +208,7 @@ describe("MultiStats", () => { it("returns plain object representation with json set to true", () => { myMultiStats = new MultiStats(stats); result = myMultiStats.toJson(true); - result.should.deepEqual({ + expect(result).toEqual({ errors: ["(abc123-compilation) abc123-error"], warnings: [ "(abc123-compilation) abc123-warning", @@ -244,7 +252,7 @@ describe("MultiStats", () => { }); it("returns string representation", () => { - result.should.be.exactly( + expect(result).toEqual( "Hash: abc123xyz890\n" + "Version: webpack 1.2.3\n" + "Child abc123-compilation:\n" + diff --git a/test/MultiWatching.unittest.js b/test/MultiWatching.unittest.js index e5b41ba99..0977f3cfa 100644 --- a/test/MultiWatching.unittest.js +++ b/test/MultiWatching.unittest.js @@ -2,14 +2,12 @@ const Tapable = require("tapable").Tapable; const SyncHook = require("tapable").SyncHook; -require("should"); -const sinon = require("sinon"); const MultiWatching = require("../lib/MultiWatching"); -const createWatching = function() { +const createWatching = () => { return { - invalidate: sinon.spy(), - close: sinon.spy() + invalidate: jest.fn(), + close: jest.fn() }; }; @@ -24,7 +22,9 @@ const createCompiler = () => { }; describe("MultiWatching", () => { - let watchings, compiler, myMultiWatching; + let watchings; + let compiler; + let myMultiWatching; beforeEach(() => { watchings = [createWatching(), createWatching()]; @@ -33,33 +33,36 @@ describe("MultiWatching", () => { }); describe("invalidate", () => { - beforeEach(() => myMultiWatching.invalidate()); + beforeEach(() => { + myMultiWatching.invalidate(); + }); it("invalidates each watching", () => { - watchings[0].invalidate.callCount.should.be.exactly(1); - watchings[1].invalidate.callCount.should.be.exactly(1); + expect(watchings[0].invalidate.mock.calls.length).toBe(1); + expect(watchings[1].invalidate.mock.calls.length).toBe(1); }); }); describe("close", () => { let callback; - const callClosedFinishedCallback = watching => - watching.close.getCall(0).args[0](); + const callClosedFinishedCallback = watching => { + watching.close.mock.calls[0][0](); + }; beforeEach(() => { - callback = sinon.spy(); + callback = jest.fn(); myMultiWatching.close(callback); }); it("closes each watching", () => { - watchings[0].close.callCount.should.be.exactly(1); - watchings[1].close.callCount.should.be.exactly(1); + expect(watchings[0].close.mock.calls.length).toBe(1); + expect(watchings[1].close.mock.calls.length).toBe(1); }); it("calls callback after each watching has closed", () => { callClosedFinishedCallback(watchings[0]); callClosedFinishedCallback(watchings[1]); - callback.callCount.should.be.exactly(1); + expect(callback.mock.calls.length).toBe(1); }); }); }); diff --git a/test/NodeTemplatePlugin.test.js b/test/NodeTemplatePlugin.test.js index 473a4e19b..6080e6d0b 100644 --- a/test/NodeTemplatePlugin.test.js +++ b/test/NodeTemplatePlugin.test.js @@ -1,8 +1,6 @@ /* global describe, it */ "use strict"; -require("should"); - const path = require("path"); const webpack = require("../lib/webpack"); @@ -14,7 +12,7 @@ describe("NodeTemplatePlugin", () => { context: path.join(__dirname, "fixtures", "nodetest"), target: "node", output: { - path: path.join(__dirname, "js"), + path: path.join(__dirname, "js", "NodeTemplatePlugin"), filename: "result.js", chunkFilename: "[hash].result.[id].js", library: "abc", @@ -24,16 +22,16 @@ describe("NodeTemplatePlugin", () => { }, (err, stats) => { if (err) return err; - stats.hasErrors().should.be.not.ok(); - stats.hasWarnings().should.be.not.ok(); + expect(stats.hasErrors()).toBe(false); + expect(stats.hasWarnings()).toBe(false); // eslint-disable-next-line node/no-missing-require - const result = require("./js/result").abc; - result.nextTick.should.be.equal(process.nextTick); - result.fs.should.be.equal(require("fs")); + const result = require("./js/NodeTemplatePlugin/result").abc; + expect(result.nextTick).toBe(process.nextTick); + expect(result.fs).toBe(require("fs")); result.loadChunk(456, chunk => { - chunk.should.be.eql(123); + expect(chunk).toBe(123); result.loadChunk(567, chunk => { - chunk.should.be.eql({ + expect(chunk).toEqual({ a: 1 }); done(); @@ -50,7 +48,7 @@ describe("NodeTemplatePlugin", () => { context: path.join(__dirname, "fixtures", "nodetest"), target: "node", output: { - path: path.join(__dirname, "js"), + path: path.join(__dirname, "js", "NodeTemplatePluginSingle"), filename: "result2.js", chunkFilename: "[hash].result2.[id].js", library: "def", @@ -66,17 +64,17 @@ describe("NodeTemplatePlugin", () => { }, (err, stats) => { if (err) return err; - stats.hasErrors().should.be.not.ok(); + expect(stats.hasErrors()).toBe(false); // eslint-disable-next-line node/no-missing-require - const result = require("./js/result2"); - result.nextTick.should.be.equal(process.nextTick); - result.fs.should.be.equal(require("fs")); + const result = require("./js/NodeTemplatePluginSingle/result2"); + expect(result.nextTick).toBe(process.nextTick); + expect(result.fs).toBe(require("fs")); const sameTick = true; result.loadChunk(456, chunk => { - chunk.should.be.eql(123); - sameTick.should.be.eql(true); + expect(chunk).toBe(123); + expect(sameTick).toBe(true); result.loadChunk(567, chunk => { - chunk.should.be.eql({ + expect(chunk).toEqual({ a: 1 }); done(); diff --git a/test/NodeWatchFileSystem.unittest.js b/test/NodeWatchFileSystem.unittest.js deleted file mode 100644 index 4c0d55c5b..000000000 --- a/test/NodeWatchFileSystem.unittest.js +++ /dev/null @@ -1,338 +0,0 @@ -/* globals describe it */ - -var should = require("should"); -var NodeWatchFileSystem = require("../lib/node/NodeWatchFileSystem"); - -describe("NodeWatchFileSystem", function() { - it("should throw if 'files' argument is not an array", function() { - should(function() { - new NodeWatchFileSystem().watch(undefined); - }).throw("Invalid arguments: 'files'"); - }); - - it("should throw if 'dirs' argument is not an array", function() { - should(function() { - new NodeWatchFileSystem().watch([], undefined); - }).throw("Invalid arguments: 'dirs'"); - }); - - it("should throw if 'missing' argument is not an array", function() { - should(function() { - new NodeWatchFileSystem().watch([], [], undefined); - }).throw("Invalid arguments: 'missing'"); - }); - - it("should throw if 'starttime' argument is missing", function() { - should(function() { - new NodeWatchFileSystem().watch([], [], [], "42", {}, function() {}); - }).throw("Invalid arguments: 'startTime'"); - }); - - it("should throw if 'callback' argument is missing", function() { - should(function() { - new NodeWatchFileSystem().watch([], [], [], 42, {}, undefined); - }).throw("Invalid arguments: 'callback'"); - }); - - it("should throw if 'options' argument is invalid", function() { - should(function() { - new NodeWatchFileSystem().watch([], [], [], 42, "options", function() {}); - }).throw("Invalid arguments: 'options'"); - }); - - it("should throw if 'callbackUndelayed' argument is invalid", function() { - should(function() { - new NodeWatchFileSystem().watch( - [], - [], - [], - 42, - {}, - function() {}, - "undefined" - ); - }).throw("Invalid arguments: 'callbackUndelayed'"); - }); - - if (process.env.NO_WATCH_TESTS) { - it("long running tests excluded"); - return; - } - - var path = require("path"); - var fs = require("fs"); - var fixtures = path.join(__dirname, "fixtures"); - var fileDirect = path.join(fixtures, "watched-file.txt"); - var fileSubdir = path.join(fixtures, "subdir", "watched-file.txt"); - - this.timeout(10000); - - it("should register a file change (change delayed)", function(done) { - var startTime = new Date().getTime(); - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [fileDirect], - [], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([fileDirect]); - dirsModified.should.be.eql([]); - (typeof fileTimestamps.get(fileDirect)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - - setTimeout(function() { - fs.writeFile(fileDirect, "", function() {}); - }, 500); - }); - it("should register a file change (watch delayed)", function(done) { - var startTime = new Date().getTime(); - setTimeout(function() { - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [fileDirect], - [], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([fileDirect]); - dirsModified.should.be.eql([]); - (typeof fileTimestamps.get(fileDirect)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - }, 500); - - fs.writeFile(fileDirect, "", function() {}); - }); - it("should register a context change (change delayed)", function(done) { - var startTime = new Date().getTime(); - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [], - [fixtures], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps, - dirTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([]); - dirsModified.should.be.eql([fixtures]); - (typeof dirTimestamps.get(fixtures)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - - setTimeout(function() { - fs.writeFile(fileDirect, "", function() {}); - }, 500); - }); - it("should register a context change (watch delayed)", function(done) { - var startTime = new Date().getTime(); - setTimeout(function() { - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [], - [fixtures], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps, - dirTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([]); - dirsModified.should.be.eql([fixtures]); - (typeof dirTimestamps.get(fixtures)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - }, 500); - - fs.writeFile(fileDirect, "", function() {}); - }); - it("should register a context change (change delayed, subdirectory)", function(done) { - var startTime = new Date().getTime(); - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [], - [fixtures], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps, - dirTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([]); - dirsModified.should.be.eql([fixtures]); - (typeof dirTimestamps.get(fixtures)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - - setTimeout(function() { - fs.writeFile(fileSubdir, "", function() {}); - }, 500); - }); - it("should register a context change (watch delayed, subdirectory)", function(done) { - var startTime = new Date().getTime(); - setTimeout(function() { - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [], - [fixtures], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps, - dirTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([]); - dirsModified.should.be.eql([fixtures]); - (typeof dirTimestamps.get(fixtures)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - }, 500); - - fs.writeFile(fileSubdir, "", function() {}); - }); - it("should allow to combine all", function(done) { - var startTime = new Date().getTime(); - setTimeout(function() { - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [fileDirect, fileSubdir], - [fixtures], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps, - dirTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([fileSubdir, fileDirect]); - dirsModified.should.be.eql([fixtures]); - (typeof fileTimestamps.get(fileDirect)).should.be.eql("number"); - (typeof fileTimestamps.get(fileSubdir)).should.be.eql("number"); - (typeof dirTimestamps.get(fixtures)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - }, 500); - - fs.writeFile(fileDirect, "", function() {}); - fs.writeFile(fileSubdir, "", function() {}); - }); - it("should sum up multiple changes", function(done) { - var startTime = new Date().getTime(); - var wfs = new NodeWatchFileSystem(); - var watcher = wfs.watch( - [fileDirect, fileSubdir], - [fixtures], - [], - startTime, - { - aggregateTimeout: 1000 - }, - function( - err, - filesModified, - dirsModified, - missingCreated, - fileTimestamps, - dirTimestamps - ) { - if (err) throw err; - filesModified.should.be.eql([fileSubdir, fileDirect]); - dirsModified.should.be.eql([fixtures]); - (typeof fileTimestamps.get(fileDirect)).should.be.eql("number"); - (typeof fileTimestamps.get(fileSubdir)).should.be.eql("number"); - (typeof dirTimestamps.get(fixtures)).should.be.eql("number"); - watcher.close(); - done(); - } - ); - - setTimeout(function() { - fs.writeFile(fileDirect, "", function() {}); - setTimeout(function() { - fs.writeFile(fileDirect, "", function() {}); - setTimeout(function() { - fs.writeFile(fileDirect, "", function() {}); - setTimeout(function() { - fs.writeFile(fileSubdir, "", function() {}); - }, 500); - }, 500); - }, 500); - }, 500); - }); -}); diff --git a/test/NormalModule.unittest.js b/test/NormalModule.unittest.js index eb5afce61..a635b1c2d 100644 --- a/test/NormalModule.unittest.js +++ b/test/NormalModule.unittest.js @@ -1,14 +1,13 @@ /* globals describe, it, beforeEach, afterEach */ "use strict"; -require("should"); -const sinon = require("sinon"); + const NormalModule = require("../lib/NormalModule"); const NullDependency = require("../lib/dependencies/NullDependency"); const SourceMapSource = require("webpack-sources").SourceMapSource; const OriginalSource = require("webpack-sources").OriginalSource; const RawSource = require("webpack-sources").RawSource; -describe("NormalModule", function() { +describe("NormalModule", () => { let normalModule; let request; let userRequest; @@ -16,7 +15,7 @@ describe("NormalModule", function() { let loaders; let resource; let parser; - beforeEach(function() { + beforeEach(() => { request = "some/request"; userRequest = "some/userRequest"; rawRequest = "some/rawRequest"; @@ -40,39 +39,39 @@ describe("NormalModule", function() { cacheable: true }; }); - describe("#identifier", function() { - it("returns an identifier for this module", function() { - normalModule.identifier().should.eql(request); + describe("#identifier", () => { + it("returns an identifier for this module", () => { + expect(normalModule.identifier()).toBe(request); }); - it("returns an identifier from toString", function() { + it("returns an identifier from toString", () => { normalModule.debugId = 1000; - normalModule.toString().should.eql("Module[1000]"); + expect(normalModule.toString()).toBe("Module[1000]"); normalModule.id = 1; - normalModule.toString().should.eql("Module[1]"); + expect(normalModule.toString()).toBe("Module[1]"); }); }); - describe("#readableIdentifier", function() { - it("calls the given requestShortener with the user request", function() { - const spy = sinon.spy(); + describe("#readableIdentifier", () => { + it("calls the given requestShortener with the user request", () => { + const spy = jest.fn(); normalModule.readableIdentifier({ shorten: spy }); - spy.callCount.should.eql(1); - spy.args[0][0].should.eql(userRequest); + expect(spy.mock.calls.length).toBe(1); + expect(spy.mock.calls[0][0]).toBe(userRequest); }); }); - describe("#libIdent", function() { - it("contextifies the userRequest of the module", function() { - normalModule - .libIdent({ + describe("#libIdent", () => { + it("contextifies the userRequest of the module", () => { + expect( + normalModule.libIdent({ context: "some/context" }) - .should.eql("../userRequest"); + ).toBe("../userRequest"); }); - describe("given a userRequest containing loaders", function() { - beforeEach(function() { + describe("given a userRequest containing loaders", () => { + beforeEach(() => { userRequest = "some/userRequest!some/other/userRequest!some/thing/is/off/here"; normalModule = new NormalModule({ @@ -85,18 +84,16 @@ describe("NormalModule", function() { parser }); }); - it("contextifies every path in the userRequest", function() { - normalModule - .libIdent({ + it("contextifies every path in the userRequest", () => { + expect( + normalModule.libIdent({ context: "some/context" }) - .should.eql( - "../userRequest!../other/userRequest!../thing/is/off/here" - ); + ).toBe("../userRequest!../other/userRequest!../thing/is/off/here"); }); }); - describe("given a userRequest containing query parameters", function() { - it("ignores paths in query parameters", function() { + describe("given a userRequest containing query parameters", () => { + it("ignores paths in query parameters", () => { userRequest = "some/context/loader?query=foo\\bar&otherPath=testpath/other"; normalModule = new NormalModule({ @@ -108,22 +105,22 @@ describe("NormalModule", function() { resource, parser }); - normalModule - .libIdent({ + expect( + normalModule.libIdent({ context: "some/context" }) - .should.eql("./loader?query=foo\\bar&otherPath=testpath/other"); + ).toBe("./loader?query=foo\\bar&otherPath=testpath/other"); }); }); }); - describe("#nameForCondition", function() { - it("return the resource", function() { - normalModule.nameForCondition().should.eql(resource); + describe("#nameForCondition", () => { + it("return the resource", () => { + expect(normalModule.nameForCondition()).toBe(resource); }); - describe("given a resource containing a ?-sign", function() { + describe("given a resource containing a ?-sign", () => { const baseResource = "some/resource"; - beforeEach(function() { + beforeEach(() => { resource = baseResource + "?some=query"; normalModule = new NormalModule({ type: "javascript/auto", @@ -135,99 +132,67 @@ describe("NormalModule", function() { parser }); }); - it("return only the part before the ?-sign", function() { - normalModule.nameForCondition().should.eql(baseResource); + it("return only the part before the ?-sign", () => { + expect(normalModule.nameForCondition()).toBe(baseResource); }); }); }); - describe("#createSourceForAsset", function() { + describe("#createSourceForAsset", () => { let name; let content; let sourceMap; - beforeEach(function() { + beforeEach(() => { name = "some name"; content = "some content"; sourceMap = "some sourcemap"; }); - describe("given no sourcemap", function() { - it("returns a RawSource", function() { - normalModule - .createSourceForAsset(name, content) - .should.be.instanceOf(RawSource); + describe("given no sourcemap", () => { + it("returns a RawSource", () => { + expect(normalModule.createSourceForAsset(name, content)).toBeInstanceOf( + RawSource + ); }); }); - describe("given a string as the sourcemap", function() { - it("returns a OriginalSource", function() { - normalModule - .createSourceForAsset(name, content, sourceMap) - .should.be.instanceOf(OriginalSource); + describe("given a string as the sourcemap", () => { + it("returns a OriginalSource", () => { + expect( + normalModule.createSourceForAsset(name, content, sourceMap) + ).toBeInstanceOf(OriginalSource); }); }); - describe("given a some other kind of sourcemap", function() { - beforeEach(function() { + describe("given a some other kind of sourcemap", () => { + beforeEach(() => { sourceMap = () => {}; }); - it("returns a SourceMapSource", function() { - normalModule - .createSourceForAsset(name, content, sourceMap) - .should.be.instanceOf(SourceMapSource); + it("returns a SourceMapSource", () => { + expect( + normalModule.createSourceForAsset(name, content, sourceMap) + ).toBeInstanceOf(SourceMapSource); }); }); }); - describe("#originalSource", function() { + describe("#originalSource", () => { let expectedSource = "some source"; - beforeEach(function() { + beforeEach(() => { normalModule._source = new RawSource(expectedSource); }); - it("returns an original Source", function() { - normalModule.originalSource().should.eql(normalModule._source); + it("returns an original Source", () => { + expect(normalModule.originalSource()).toBe(normalModule._source); }); }); - describe("#updateHashWithSource", function() { - let hashSpy; - let hash; - beforeEach(function() { - hashSpy = sinon.spy(); - hash = { - update: hashSpy - }; - }); - describe("without the module having any source", function() { - beforeEach(function() { - normalModule._source = null; - }); - it('calls hash function with "null"', function() { - normalModule.updateHashWithSource(hash); - hashSpy.callCount.should.eql(1); - hashSpy.args[0][0].should.eql("null"); - }); - }); - describe("without the module having source", function() { - let expectedSource = "some source"; - beforeEach(function() { - normalModule._source = new RawSource(expectedSource); - }); - it('calls hash function with "source" and then the actual source of the module', function() { - normalModule.updateHashWithSource(hash); - hashSpy.callCount.should.eql(2); - hashSpy.args[0][0].should.eql("source"); - hashSpy.args[1][0].should.eql(expectedSource); - }); - }); - }); - describe("#hasDependencies", function() { - it("returns true if has dependencies", function() { + describe("#hasDependencies", () => { + it("returns true if has dependencies", () => { normalModule.addDependency(new NullDependency()); - normalModule.hasDependencies().should.eql(true); + expect(normalModule.hasDependencies()).toBe(true); }); - it("returns false if has dependencies", function() { - normalModule.hasDependencies().should.eql(false); + it("returns false if has dependencies", () => { + expect(normalModule.hasDependencies()).toBe(false); }); }); - describe("#needRebuild", function() { + describe("#needRebuild", () => { let fileTimestamps; let contextTimestamps; let fileDependencies; @@ -240,7 +205,7 @@ describe("NormalModule", function() { normalModule.buildInfo.contextDependencies = contextDependencies; } - beforeEach(function() { + beforeEach(() => { fileA = "fileA"; fileB = "fileB"; fileDependencies = [fileA, fileB]; @@ -250,178 +215,178 @@ describe("NormalModule", function() { normalModule.buildTimestamp = 2; setDeps(fileDependencies, contextDependencies); }); - describe("given all timestamps are older than the buildTimestamp", function() { - it("returns false", function() { - normalModule - .needRebuild(fileTimestamps, contextTimestamps) - .should.eql(false); + describe("given all timestamps are older than the buildTimestamp", () => { + it("returns false", () => { + expect( + normalModule.needRebuild(fileTimestamps, contextTimestamps) + ).toBe(false); }); }); - describe("given a file timestamp is newer than the buildTimestamp", function() { - beforeEach(function() { + describe("given a file timestamp is newer than the buildTimestamp", () => { + beforeEach(() => { fileTimestamps.set(fileA, 3); }); - it("returns true", function() { - normalModule - .needRebuild(fileTimestamps, contextTimestamps) - .should.eql(true); + it("returns true", () => { + expect( + normalModule.needRebuild(fileTimestamps, contextTimestamps) + ).toBe(true); }); }); - describe("given a no file timestamp exists", function() { - beforeEach(function() { + describe("given a no file timestamp exists", () => { + beforeEach(() => { fileTimestamps = new Map(); }); - it("returns true", function() { - normalModule - .needRebuild(fileTimestamps, contextTimestamps) - .should.eql(true); + it("returns true", () => { + expect( + normalModule.needRebuild(fileTimestamps, contextTimestamps) + ).toBe(true); }); }); - describe("given a context timestamp is newer than the buildTimestamp", function() { - beforeEach(function() { + describe("given a context timestamp is newer than the buildTimestamp", () => { + beforeEach(() => { contextTimestamps.set(fileA, 3); }); - it("returns true", function() { - normalModule - .needRebuild(fileTimestamps, contextTimestamps) - .should.eql(true); + it("returns true", () => { + expect( + normalModule.needRebuild(fileTimestamps, contextTimestamps) + ).toBe(true); }); }); - describe("given a no context timestamp exists", function() { - beforeEach(function() { + describe("given a no context timestamp exists", () => { + beforeEach(() => { contextTimestamps = new Map(); }); - it("returns true", function() { - normalModule - .needRebuild(fileTimestamps, contextTimestamps) - .should.eql(true); + it("returns true", () => { + expect( + normalModule.needRebuild(fileTimestamps, contextTimestamps) + ).toBe(true); }); }); }); - describe("#applyNoParseRule", function() { + describe("#applyNoParseRule", () => { let rule; let content; - describe("given a string as rule", function() { - beforeEach(function() { + describe("given a string as rule", () => { + beforeEach(() => { rule = "some-rule"; }); - describe("and the content starting with the string specified in rule", function() { - beforeEach(function() { + describe("and the content starting with the string specified in rule", () => { + beforeEach(() => { content = rule + "some-content"; }); - it("returns true", function() { - normalModule.shouldPreventParsing(rule, content).should.eql(true); + it("returns true", () => { + expect(normalModule.shouldPreventParsing(rule, content)).toBe(true); }); }); - describe("and the content does not start with the string specified in rule", function() { - beforeEach(function() { + describe("and the content does not start with the string specified in rule", () => { + beforeEach(() => { content = "some-content"; }); - it("returns false", function() { - normalModule.shouldPreventParsing(rule, content).should.eql(false); + it("returns false", () => { + expect(normalModule.shouldPreventParsing(rule, content)).toBe(false); }); }); }); - describe("given a regex as rule", function() { - beforeEach(function() { + describe("given a regex as rule", () => { + beforeEach(() => { rule = /some-rule/; }); - describe("and the content matches the rule", function() { - beforeEach(function() { + describe("and the content matches the rule", () => { + beforeEach(() => { content = rule + "some-content"; }); - it("returns true", function() { - normalModule.shouldPreventParsing(rule, content).should.eql(true); + it("returns true", () => { + expect(normalModule.shouldPreventParsing(rule, content)).toBe(true); }); }); - describe("and the content does not match the rule", function() { - beforeEach(function() { + describe("and the content does not match the rule", () => { + beforeEach(() => { content = "some-content"; }); - it("returns false", function() { - normalModule.shouldPreventParsing(rule, content).should.eql(false); + it("returns false", () => { + expect(normalModule.shouldPreventParsing(rule, content)).toBe(false); }); }); }); }); - describe("#shouldPreventParsing", function() { + describe("#shouldPreventParsing", () => { let applyNoParseRuleSpy; - beforeEach(function() { - applyNoParseRuleSpy = sinon.stub(); + beforeEach(() => { + applyNoParseRuleSpy = jest.fn(); normalModule.applyNoParseRule = applyNoParseRuleSpy; }); - describe("given no noParseRule", function() { - it("returns false", function() { - normalModule.shouldPreventParsing().should.eql(false); - applyNoParseRuleSpy.callCount.should.eql(0); + describe("given no noParseRule", () => { + it("returns false", () => { + expect(normalModule.shouldPreventParsing()).toBe(false); + expect(applyNoParseRuleSpy.mock.calls.length).toBe(0); }); }); - describe("given a noParseRule", function() { + describe("given a noParseRule", () => { let returnValOfSpy; - beforeEach(function() { + beforeEach(() => { returnValOfSpy = true; - applyNoParseRuleSpy.returns(returnValOfSpy); + applyNoParseRuleSpy.mockReturnValue(returnValOfSpy); }); - describe("that is a string", function() { - it("calls and returns whatever applyNoParseRule returns", function() { - normalModule - .shouldPreventParsing("some rule") - .should.eql(returnValOfSpy); - applyNoParseRuleSpy.callCount.should.eql(1); + describe("that is a string", () => { + it("calls and returns whatever applyNoParseRule returns", () => { + expect(normalModule.shouldPreventParsing("some rule")).toBe( + returnValOfSpy + ); + expect(applyNoParseRuleSpy.mock.calls.length).toBe(1); }); }); - describe("that is a regex", function() { - it("calls and returns whatever applyNoParseRule returns", function() { - normalModule - .shouldPreventParsing("some rule") - .should.eql(returnValOfSpy); - applyNoParseRuleSpy.callCount.should.eql(1); + describe("that is a regex", () => { + it("calls and returns whatever applyNoParseRule returns", () => { + expect(normalModule.shouldPreventParsing("some rule")).toBe( + returnValOfSpy + ); + expect(applyNoParseRuleSpy.mock.calls.length).toBe(1); }); }); - describe("that is an array", function() { - describe("of strings and or regexs", function() { + describe("that is an array", () => { + describe("of strings and or regexs", () => { let someRules; - beforeEach(function() { + beforeEach(() => { someRules = ["some rule", /some rule1/, "some rule2"]; }); - describe("and none of them match", function() { - beforeEach(function() { + describe("and none of them match", () => { + beforeEach(() => { returnValOfSpy = false; - applyNoParseRuleSpy.returns(returnValOfSpy); + applyNoParseRuleSpy.mockReturnValue(returnValOfSpy); }); - it("returns false", function() { - normalModule - .shouldPreventParsing(someRules) - .should.eql(returnValOfSpy); - applyNoParseRuleSpy.callCount.should.eql(3); + it("returns false", () => { + expect(normalModule.shouldPreventParsing(someRules)).toBe( + returnValOfSpy + ); + expect(applyNoParseRuleSpy.mock.calls.length).toBe(3); }); }); - describe("and the first of them matches", function() { - beforeEach(function() { + describe("and the first of them matches", () => { + beforeEach(() => { returnValOfSpy = true; - applyNoParseRuleSpy.returns(returnValOfSpy); + applyNoParseRuleSpy.mockReturnValue(returnValOfSpy); }); - it("returns true", function() { - normalModule - .shouldPreventParsing(someRules) - .should.eql(returnValOfSpy); - applyNoParseRuleSpy.callCount.should.eql(1); + it("returns true", () => { + expect(normalModule.shouldPreventParsing(someRules)).toBe( + returnValOfSpy + ); + expect(applyNoParseRuleSpy.mock.calls.length).toBe(1); }); }); - describe("and the last of them matches", function() { - beforeEach(function() { + describe("and the last of them matches", () => { + beforeEach(() => { returnValOfSpy = true; - applyNoParseRuleSpy.onCall(0).returns(false); - applyNoParseRuleSpy.onCall(1).returns(false); - applyNoParseRuleSpy.onCall(2).returns(true); + applyNoParseRuleSpy.mockReturnValueOnce(false); + applyNoParseRuleSpy.mockReturnValueOnce(false); + applyNoParseRuleSpy.mockReturnValue(true); }); - it("returns true", function() { - normalModule - .shouldPreventParsing(someRules) - .should.eql(returnValOfSpy); - applyNoParseRuleSpy.callCount.should.eql(3); + it("returns true", () => { + expect(normalModule.shouldPreventParsing(someRules)).toBe( + returnValOfSpy + ); + expect(applyNoParseRuleSpy.mock.calls.length).toBe(3); }); }); }); diff --git a/test/NullDependency.unittest.js b/test/NullDependency.unittest.js index d8862ed38..958027bdd 100644 --- a/test/NullDependency.unittest.js +++ b/test/NullDependency.unittest.js @@ -1,7 +1,5 @@ "use strict"; -require("should"); -const sinon = require("sinon"); const NullDependency = require("../lib/dependencies/NullDependency"); describe("NullDependency", () => { @@ -9,36 +7,43 @@ describe("NullDependency", () => { beforeEach(() => (env = {})); - it("is a function", () => NullDependency.should.be.a.Function()); + it("is a function", () => { + expect(NullDependency).toBeTypeOf("function"); + }); describe("when created", () => { beforeEach(() => (env.nullDependency = new NullDependency())); - it("has a null type", () => - env.nullDependency.type.should.be.exactly("null")); + it("has a null type", () => { + expect(env.nullDependency.type).toBe("null"); + }); - it("has update hash function", () => - env.nullDependency.updateHash.should.be.Function()); + it("has update hash function", () => { + expect(env.nullDependency.updateHash).toBeTypeOf("function"); + }); it("does not update hash", () => { const hash = { - update: sinon.stub() + update: jest.fn() }; env.nullDependency.updateHash(hash); - hash.update.called.should.be.false(); + expect(hash.update).not.toHaveBeenCalled(); }); }); describe("Template", () => { - it("is a function", () => NullDependency.Template.should.be.a.Function()); + it("is a function", () => { + expect(NullDependency.Template).toBeTypeOf("function"); + }); describe("when created", () => { - beforeEach( - () => (env.nullDependencyTemplate = new NullDependency.Template()) - ); + beforeEach(() => { + env.nullDependencyTemplate = new NullDependency.Template(); + }); - it("has apply function", () => - env.nullDependencyTemplate.apply.should.be.Function()); + it("has apply function", () => { + expect(env.nullDependencyTemplate.apply).toBeTypeOf("function"); + }); }); }); }); diff --git a/test/Parser.unittest.js b/test/Parser.unittest.js index da31c04da..059cc9eae 100644 --- a/test/Parser.unittest.js +++ b/test/Parser.unittest.js @@ -1,7 +1,5 @@ "use strict"; -const should = require("should"); - const Parser = require("../lib/Parser"); const BasicEvaluatedExpression = require("../lib/BasicEvaluatedExpression"); @@ -308,8 +306,8 @@ describe("Parser", () => { return true; }); const actual = testParser.parse(source); - should.strictEqual(typeof actual, "object"); - actual.should.be.eql(state); + expect(typeof actual).toBe("object"); + expect(actual).toEqual(state); }); }); @@ -334,13 +332,13 @@ describe("Parser", () => { }); const actual = testParser.parse(source); - should.strictEqual(typeof actual, "object"); - should.strictEqual(typeof actual.comments, "object"); + expect(typeof actual).toBe("object"); + expect(typeof actual.comments).toBe("object"); actual.comments.forEach((element, index) => { - should.strictEqual(typeof element.type, "string"); - should.strictEqual(typeof element.value, "string"); - element.type.should.be.eql(state[index].type); - element.value.should.be.eql(state[index].value); + expect(typeof element.type).toBe("string"); + expect(typeof element.value).toBe("string"); + expect(element.type).toBe(state[index].type); + expect(element.value).toBe(state[index].value); }); }); @@ -480,7 +478,8 @@ describe("Parser", () => { "template=[start string=start],[mid string=mid],[end string=end]", // eslint-disable-next-line no-template-curly-in-string "`start${'str'}mid${obj2}end`": - "template=[start${'str'}mid string=startstrmid],[end string=end]", // eslint-disable-line no-template-curly-in-string + // eslint-disable-next-line no-template-curly-in-string + "template=[start${'str'}mid string=startstrmid],[end string=end]", "'abc'.substr(1)": "string=bc", "'abcdef'.substr(2, 3)": "string=cde", "'abcdef'.substring(2, 3)": "string=c", @@ -545,7 +544,7 @@ describe("Parser", () => { it("should eval " + key, () => { const evalExpr = evaluateInParser(key); - evalExprToString(evalExpr).should.be.eql( + expect(evalExprToString(evalExpr)).toBe( testCases[key] ? key + " " + testCases[key] : key ); }); @@ -565,7 +564,7 @@ describe("Parser", () => { const expr = cases[name]; it(name, () => { const actual = parser.parse(expr); - should.strictEqual(typeof actual, "object"); + expect(typeof actual).toBe("object"); }); }); }); @@ -598,7 +597,7 @@ describe("Parser", () => { Object.keys(cases).forEach(name => { it(name, () => { const actual = parser.parse(cases[name][0]); - actual.should.be.eql(cases[name][1]); + expect(actual).toEqual(cases[name][1]); }); }); }); @@ -614,7 +613,7 @@ describe("Parser", () => { const expr = cases[name]; it(name, () => { const actual = Parser.parse(expr); - should.strictEqual(typeof actual, "object"); + expect(typeof actual).toBe("object"); }); }); }); diff --git a/test/ProfilingPlugin.unittest.js b/test/ProfilingPlugin.unittest.js index f0b97a772..0528c9ecb 100644 --- a/test/ProfilingPlugin.unittest.js +++ b/test/ProfilingPlugin.unittest.js @@ -1,6 +1,5 @@ "use strict"; -require("should"); const ProfilingPlugin = require("../lib/debug/ProfilingPlugin"); describe("Profiling Plugin", () => { @@ -8,67 +7,36 @@ describe("Profiling Plugin", () => { const plugin = new ProfilingPlugin({ outputPath: "invest_in_doge_coin" }); - plugin.outputPath.should.equal("invest_in_doge_coin"); + expect(plugin.outputPath).toBe("invest_in_doge_coin"); }); it("should handle no options", () => { const plugin = new ProfilingPlugin(); - plugin.outputPath.should.equal("events.json"); + expect(plugin.outputPath).toBe("events.json"); }); - it("should handle when unable to require the inspector", done => { + it("should handle when unable to require the inspector", () => { const profiler = new ProfilingPlugin.Profiler(); - - profiler - .startProfiling() - .then(() => { - done(); - }) - .catch(e => { - done(e); - }); + return profiler.startProfiling(); }); - it("should handle when unable to start a profiling session", done => { + it("should handle when unable to start a profiling session", () => { const profiler = new ProfilingPlugin.Profiler({ Session() { throw new Error("Sean Larkin was here."); } }); - profiler - .startProfiling() - .then(() => { - done(); - }) - .catch(e => { - done(e); - }); + return profiler.startProfiling(); }); - it("handles sending a profiling message when no session", done => { + it("handles sending a profiling message when no session", () => { const profiler = new ProfilingPlugin.Profiler(); - - profiler - .sendCommand("randy", "is a puppers") - .then(() => { - done(); - }) - .catch(e => { - done(e); - }); + return profiler.sendCommand("randy", "is a puppers"); }); - it("handles destroying when no session", done => { + it("handles destroying when no session", () => { const profiler = new ProfilingPlugin.Profiler(); - - profiler - .destroy() - .then(() => { - done(); - }) - .catch(e => { - done(e); - }); + return profiler.destroy(); }); }); diff --git a/test/README.md b/test/README.md index 05b25ccce..97fb3320b 100644 --- a/test/README.md +++ b/test/README.md @@ -4,16 +4,25 @@ Every pull request that you submit to webpack (besides README and spelling corre 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 -* Clone repo -* Run tests (this automatically runs the setup) - * `yarn test` +Run all tests (this automatically runs the setup): +```sh +yarn test +``` -* To run an individual suite: (recommended during development for easier isolated diffs) +Run an individual suite: +```sh +yarn jest ConfigTestCases +``` -Example: `$(npm bin)/mocha --grep ConfigTestCases` +Watch mode: +```sh +yarn jest --watch ConfigTestCases +``` + +See also: [Jest CLI docs](https://facebook.github.io/jest/docs/cli.html) ## Test suite overview -We use MochaJS for our tests. For more information on Mocha you can visit their [homepage](https://mochajs.org/)! +We use Jest for our tests. For more information on Jest you can visit their [homepage](https://facebook.github.io/jest/)! ### Class Tests All test files can be found in *.test.js. There are many tests that simply test API's of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation). diff --git a/test/RawModule.unittest.js b/test/RawModule.unittest.js index e4e7b8793..8d3e6b90f 100644 --- a/test/RawModule.unittest.js +++ b/test/RawModule.unittest.js @@ -4,29 +4,25 @@ const RawModule = require("../lib/RawModule"); const OriginalSource = require("webpack-sources").OriginalSource; const RawSource = require("webpack-sources").RawSource; const RequestShortener = require("../lib/RequestShortener"); -const should = require("should"); const path = require("path"); const crypto = require("crypto"); describe("RawModule", () => { - let myRawModule; - - before(() => { - const source = "sourceStr attribute"; - const identifier = "identifierStr attribute"; - const readableIdentifier = "readableIdentifierStr attribute"; - myRawModule = new RawModule(source, identifier, readableIdentifier); - }); + const source = "sourceStr attribute"; + const identifier = "identifierStr attribute"; + const readableIdentifier = "readableIdentifierStr attribute"; + const myRawModule = new RawModule(source, identifier, readableIdentifier); describe("identifier", () => { - it("returns value for identifierStr attribute", () => - should(myRawModule.identifier()).be.exactly("identifierStr attribute")); + it("returns value for identifierStr attribute", () => { + expect(myRawModule.identifier()).toBe("identifierStr attribute"); + }); }); describe("size", () => { it('returns value for sourceStr attribute"s length property', () => { const sourceStrLength = myRawModule.sourceStr.length; - should(myRawModule.size()).be.exactly(sourceStrLength); + expect(myRawModule.size()).toBe(sourceStrLength); }); }); @@ -36,13 +32,15 @@ describe("RawModule", () => { "on readableIdentifierStr attribute", () => { const requestShortener = new RequestShortener(path.resolve()); - should.exist(myRawModule.readableIdentifier(requestShortener)); + expect(myRawModule.readableIdentifier(requestShortener)).toBeDefined(); } ); }); describe("needRebuild", () => { - it("returns false", () => should(myRawModule.needRebuild()).be.false()); + it("returns false", () => { + expect(myRawModule.needRebuild()).toBe(false); + }); }); describe("source", () => { @@ -55,7 +53,7 @@ describe("RawModule", () => { myRawModule.identifier() ); myRawModule.useSourceMap = true; - myRawModule.source().should.match(originalSource); + expect(myRawModule.source()).toEqual(originalSource); } ); @@ -65,7 +63,7 @@ describe("RawModule", () => { () => { const rawSource = new RawSource(myRawModule.sourceStr); myRawModule.useSourceMap = false; - myRawModule.source().should.match(rawSource); + expect(myRawModule.source()).toEqual(rawSource); } ); }); @@ -80,7 +78,7 @@ describe("RawModule", () => { const hashFoo = hashModule(new RawModule('"foo"')); const hashBar = hashModule(new RawModule('"bar"')); - hashFoo.should.not.equal(hashBar); + expect(hashFoo).not.toBe(hashBar); }); }); }); diff --git a/test/RemovedPlugins.unittest.js b/test/RemovedPlugins.unittest.js index 1f5f2b30b..915ee0e11 100644 --- a/test/RemovedPlugins.unittest.js +++ b/test/RemovedPlugins.unittest.js @@ -1,18 +1,18 @@ const webpack = require("../lib/webpack"); const RemovedPluginError = require("../lib/RemovedPluginError"); -require("should"); describe("removed plugin errors", () => { it("should error when accessing removed plugins", () => { - (() => webpack.optimize.UglifyJsPlugin).should.throw(RemovedPluginError, { - message: /webpack\.optimize\.UglifyJsPlugin has been removed, please use config\.optimization\.minimize instead\./ - }); + expect(() => webpack.optimize.UglifyJsPlugin).toThrow(RemovedPluginError); + expect( + () => webpack.optimize.UglifyJsPlugin + ).toThrowErrorMatchingSnapshot(); - (() => webpack.optimize.CommonsChunkPlugin).should.throw( - RemovedPluginError, - { - message: /webpack\.optimize\.CommonsChunkPlugin has been removed, please use config\.optimization\.splitChunks instead\./ - } + expect(() => webpack.optimize.CommonsChunkPlugin).toThrow( + RemovedPluginError ); + expect( + () => webpack.optimize.CommonsChunkPlugin + ).toThrowErrorMatchingSnapshot(); }); }); diff --git a/test/RuleSet.unittest.js b/test/RuleSet.unittest.js index 69b6a444d..c62b7bb64 100644 --- a/test/RuleSet.unittest.js +++ b/test/RuleSet.unittest.js @@ -1,7 +1,5 @@ "use strict"; -const should = require("should"); - const RuleSet = require("../lib/RuleSet"); function match(ruleSet, resource) { @@ -23,11 +21,11 @@ function match(ruleSet, resource) { describe("RuleSet", () => { it("should create RuleSet with a blank array", () => { const loader = new RuleSet([]); - loader.rules.should.eql([]); + expect(loader.rules).toEqual([]); }); it("should create RuleSet and match with empty array", () => { const loader = new RuleSet([]); - match(loader, "something").should.eql([]); + expect(match(loader, "something")).toEqual([]); }); it("should not match with loaders array", () => { const loader = new RuleSet([ @@ -36,7 +34,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "something").should.eql([]); + expect(match(loader, "something")).toEqual([]); }); it("should match with regex", () => { @@ -46,7 +44,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should match with string", () => { @@ -56,7 +54,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should match with function", () => { @@ -68,11 +66,11 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should throw if invalid test", () => { - should.throws(() => { + expect(() => { const loader = new RuleSet([ { test: { @@ -81,8 +79,8 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); - }, /Unexcepted property invalid in condition/); + match(loader, "style.css"); + }).toThrow(/Unexcepted property invalid in condition/); }); it("should accept multiple test array that all match", () => { @@ -92,7 +90,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should accept multiple test array that not all match", () => { @@ -102,7 +100,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should not match if include does not match", () => { @@ -113,7 +111,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql([]); + expect(match(loader, "style.css")).toEqual([]); }); it("should match if include matches", () => { @@ -124,7 +122,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should not match if exclude matches", () => { @@ -135,7 +133,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql([]); + expect(match(loader, "style.css")).toEqual([]); }); it("should match if exclude does not match", () => { @@ -146,7 +144,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should work if a loader is applied to all files", () => { @@ -155,8 +153,8 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); - match(loader, "scripts.js").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); + expect(match(loader, "scripts.js")).toEqual(["css"]); }); it("should work with using loader as string", () => { @@ -166,7 +164,7 @@ describe("RuleSet", () => { loader: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should work with using loader as array", () => { @@ -176,7 +174,7 @@ describe("RuleSet", () => { loader: ["css"] } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should work with using loaders as string", () => { @@ -186,7 +184,7 @@ describe("RuleSet", () => { loaders: "css" } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should work with using loaders as array", () => { @@ -196,11 +194,11 @@ describe("RuleSet", () => { loaders: ["css"] } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should throw if using loaders with non-string or array", () => { - should.throws(function() { + expect(() => { const loader = new RuleSet([ { test: /\.css$/, @@ -209,8 +207,8 @@ describe("RuleSet", () => { } } ]); - match(loader, "style.css").should.eql(["css"]); - }, /No loader specified/); + match(loader, "style.css"); + }).toThrow(/No loader specified/); }); it("should work with using loader with inline query", () => { @@ -220,7 +218,7 @@ describe("RuleSet", () => { loader: "css?modules=1" } ]); - match(loader, "style.css").should.eql(["css?modules=1"]); + expect(match(loader, "style.css")).toEqual(["css?modules=1"]); }); it("should work with using loader with string query", () => { @@ -231,7 +229,7 @@ describe("RuleSet", () => { query: "modules=1" } ]); - match(loader, "style.css").should.eql(["css?modules=1"]); + expect(match(loader, "style.css")).toEqual(["css?modules=1"]); }); it("should work with using loader with object query", () => { @@ -244,7 +242,7 @@ describe("RuleSet", () => { } } ]); - match(loader, "style.css").should.eql(['css?{"modules":1}']); + expect(match(loader, "style.css")).toEqual(['css?{"modules":1}']); }); it("should work with using array loaders with basic object notation", () => { @@ -258,11 +256,11 @@ describe("RuleSet", () => { ] } ]); - match(loader, "style.css").should.eql(["css"]); + expect(match(loader, "style.css")).toEqual(["css"]); }); it("should throw if using array loaders with object notation without specifying a loader", () => { - should.throws(() => { + expect(() => { const loader = new RuleSet([ { test: /\.css$/, @@ -274,7 +272,7 @@ describe("RuleSet", () => { } ]); match(loader, "style.css"); - }, /No loader specified/); + }).toThrow(/No loader specified/); }); it("should work with using array loaders with object notation", () => { @@ -289,7 +287,7 @@ describe("RuleSet", () => { ] } ]); - match(loader, "style.css").should.eql(["css?modules=1"]); + expect(match(loader, "style.css")).toEqual(["css?modules=1"]); }); it("should work with using multiple array loaders with object notation", () => { @@ -308,7 +306,7 @@ describe("RuleSet", () => { ] } ]); - match(loader, "style.css").should.eql([ + expect(match(loader, "style.css")).toEqual([ "style?filesize=1000", "css?modules=1" ]); @@ -321,14 +319,14 @@ describe("RuleSet", () => { loaders: "style?filesize=1000!css?modules=1" } ]); - match(loader, "style.css").should.eql([ + expect(match(loader, "style.css")).toEqual([ "style?filesize=1000", "css?modules=1" ]); }); it("should throw if using array loaders with a single legacy", () => { - should.throws(() => { + expect(() => { const loader = new RuleSet([ { test: /\.css$/, @@ -336,8 +334,8 @@ describe("RuleSet", () => { query: "modules=1" } ]); - match(loader, "style.css").should.eql(["css"]); - }, /options\/query cannot be used with loaders/); + match(loader, "style.css"); + }).toThrow(/options\/query cannot be used with loaders/); }); it("should work when using array loaders", () => { @@ -347,7 +345,7 @@ describe("RuleSet", () => { loaders: ["style-loader", "css-loader"] } ]); - match(loader, "style.css").should.eql(["style-loader", "css-loader"]); + expect(match(loader, "style.css")).toEqual(["style-loader", "css-loader"]); }); it("should work when using an array of functions returning a loader", () => { @@ -368,7 +366,7 @@ describe("RuleSet", () => { ] } ]); - match(loader, "style.css").should.eql(["style-loader", "css-loader"]); + expect(match(loader, "style.css")).toEqual(["style-loader", "css-loader"]); }); it("should work when using an array of either functions or strings returning a loader", () => { @@ -385,7 +383,7 @@ describe("RuleSet", () => { ] } ]); - match(loader, "style.css").should.eql(["style-loader", "css-loader"]); + expect(match(loader, "style.css")).toEqual(["style-loader", "css-loader"]); }); it("should work when using an array of functions returning either a loader object or loader name string", () => { @@ -404,37 +402,35 @@ describe("RuleSet", () => { ] } ]); - match(loader, "style.css").should.eql(["style-loader", "css-loader"]); + expect(match(loader, "style.css")).toEqual(["style-loader", "css-loader"]); }); it("should throw if using array loaders with invalid type", () => { - should.throws(() => { + expect(() => { const loader = new RuleSet([ { test: /\.css$/, loaders: ["style-loader", "css-loader", 5] } ]); - match(loader, "style.css").should.eql(["css"]); - }, /No loader specified/); + match(loader, "style.css"); + }).toThrow(/No loader specified/); }); describe("when exclude array holds an undefined item", () => { function errorHasContext(err) { - if ( + return ( /Expected condition but got falsy value/.test(err) && /test/.test(err) && /include/.test(err) && /exclude/.test(err) && /node_modules/.test(err) && /undefined/.test(err) - ) { - return true; - } + ); } it("should throw with context", () => { - should.throws(() => { + try { const loader = new RuleSet([ { test: /\.css$/, @@ -443,11 +439,14 @@ describe("RuleSet", () => { exclude: ["node_modules", undefined] } ]); - match(loader, "style.css").should.eql(["css"]); - }, errorHasContext); + match(loader, "style.css"); + throw new Error("unreachable"); + } catch (e) { + expect(errorHasContext(e.message)).toBe(true); + } }); it("in resource should throw with context", () => { - should.throws(() => { + try { const loader = new RuleSet([ { resource: { @@ -457,12 +456,14 @@ describe("RuleSet", () => { } } ]); - match(loader, "style.css").should.eql(["css"]); - }, errorHasContext); + match(loader, "style.css"); + throw new Error("unreachable"); + } catch (e) { + expect(errorHasContext(e.message)).toBe(true); + } }); - it("in issuer should throw with context", () => { - should.throws(() => { + try { const loader = new RuleSet([ { issuer: { @@ -472,8 +473,11 @@ describe("RuleSet", () => { } } ]); - match(loader, "style.css").should.eql(["css"]); - }, errorHasContext); + match(loader, "style.css"); + throw new Error("unreachable"); + } catch (e) { + expect(errorHasContext(e.message)).toBe(true); + } }); }); }); diff --git a/test/Schemas.lint.js b/test/Schemas.lint.js index 619c80ece..50fff3bad 100644 --- a/test/Schemas.lint.js +++ b/test/Schemas.lint.js @@ -2,7 +2,6 @@ const fs = require("fs"); const path = require("path"); -require("should"); const glob = require("glob"); const rootDir = path.resolve(__dirname, ".."); @@ -30,9 +29,9 @@ describe("Schemas", () => { if (content) { it("should be formated correctly", () => { - fileContent - .replace(/\r\n?/g, "\n") - .should.be.eql(JSON.stringify(content, 0, 2) + "\n"); + expect(fileContent.replace(/\r\n?/g, "\n")).toBe( + JSON.stringify(content, 0, 2) + "\n" + ); }); const arrayProperties = ["oneOf", "anyOf", "allOf"]; @@ -61,8 +60,8 @@ describe("Schemas", () => { const validateProperty = property => { it("should have description set", () => { - property.should.be.property("description").be.type("string"); - property.description.length.should.be.above(1); + expect(typeof property.description).toBe("string"); + expect(property.description.length).toBeGreaterThan(1); }); }; @@ -120,7 +119,7 @@ describe("Schemas", () => { } if ("properties" in item) { it("should have additionalProperties set to some value when describing properties", () => { - item.should.be.property("additionalProperties"); + expect(item.additionalProperties).toBeDefined(); }); Object.keys(item.properties).forEach(name => { describe(`> '${name}'`, () => { diff --git a/test/SideEffectsFlagPlugin.unittest.js b/test/SideEffectsFlagPlugin.unittest.js index 3b4a7e291..a0e9c9830 100644 --- a/test/SideEffectsFlagPlugin.unittest.js +++ b/test/SideEffectsFlagPlugin.unittest.js @@ -4,100 +4,108 @@ const SideEffectsFlagPlugin = require("../lib/optimize/SideEffectsFlagPlugin"); describe("SideEffectsFlagPlugin", () => { it("should assume true", () => { - SideEffectsFlagPlugin.moduleHasSideEffects( - "./foo/bar.js", - undefined - ).should.eql(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./foo/bar.js", undefined) + ).toBe(true); }); it("should understand boolean values", () => { - SideEffectsFlagPlugin.moduleHasSideEffects("./foo/bar.js", true).should.eql( - true - ); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./foo/bar.js", - false - ).should.eql(false); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./foo/bar.js", true) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./foo/bar.js", false) + ).toBe(false); }); it("should understand a glob", () => { - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "./src/**/*.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./x.js", - "./src/**/*.js" - ).should.eql(false); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "./**/src/x/y/z.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "**.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "./src/**/z.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "./**/x/**/z.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "./**/src/**" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "./**/src/*" - ).should.eql(false); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "*.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "x/**/z.js" - ).should.eql(false); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "src/**/z.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "src/**/{x,y,z}.js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "src/**/[x-z].js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "src/**/[[:lower:]].js" - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "!*.js" - ).should.eql(false); - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - "!**/*.js" - ).should.eql(false); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "./src/**/*.js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./x.js", "./src/**/*.js") + ).toBe(false); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "./**/src/x/y/z.js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", "**.js") + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "./src/**/z.js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "./**/x/**/z.js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "./**/src/**" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", "./**/src/*") + ).toBe(false); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", "*.js") + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", "x/**/z.js") + ).toBe(false); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "src/**/z.js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "src/**/{x,y,z}.js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "src/**/[x-z].js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects( + "./src/x/y/z.js", + "src/**/[[:lower:]].js" + ) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", "!*.js") + ).toBe(false); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", "!**/*.js") + ).toBe(false); }); it("should understand arrays", () => { const array = ["./src/**/*.js", "./dirty.js"]; - SideEffectsFlagPlugin.moduleHasSideEffects( - "./src/x/y/z.js", - array - ).should.eql(true); - SideEffectsFlagPlugin.moduleHasSideEffects("./dirty.js", array).should.eql( - true - ); - SideEffectsFlagPlugin.moduleHasSideEffects("./clean.js", array).should.eql( - false - ); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./src/x/y/z.js", array) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./dirty.js", array) + ).toBe(true); + expect( + SideEffectsFlagPlugin.moduleHasSideEffects("./clean.js", array) + ).toBe(false); }); }); diff --git a/test/SizeFormatHelpers.unittest.js b/test/SizeFormatHelpers.unittest.js index d641ee342..5fd655827 100644 --- a/test/SizeFormatHelpers.unittest.js +++ b/test/SizeFormatHelpers.unittest.js @@ -1,52 +1,49 @@ /* globals describe, it, beforeEach */ "use strict"; -const should = require("should"); const SizeFormatHelpers = require("../lib/SizeFormatHelpers"); describe("SizeFormatHelpers", () => { describe("formatSize", () => { it("should handle zero size", () => { - should(SizeFormatHelpers.formatSize(0)).be.eql("0 bytes"); + expect(SizeFormatHelpers.formatSize(0)).toBe("0 bytes"); }); it("should handle bytes", () => { - should(SizeFormatHelpers.formatSize(1000)).be.eql("1000 bytes"); + expect(SizeFormatHelpers.formatSize(1000)).toBe("1000 bytes"); }); it("should handle integer kibibytes", () => { - should(SizeFormatHelpers.formatSize(2048)).be.eql("2 KiB"); + expect(SizeFormatHelpers.formatSize(2048)).toBe("2 KiB"); }); it("should handle float kibibytes", () => { - should(SizeFormatHelpers.formatSize(2560)).be.eql("2.5 KiB"); + expect(SizeFormatHelpers.formatSize(2560)).toBe("2.5 KiB"); }); it("should handle integer mebibytes", () => { - should(SizeFormatHelpers.formatSize(10 * 1024 * 1024)).be.eql("10 MiB"); + expect(SizeFormatHelpers.formatSize(10 * 1024 * 1024)).toBe("10 MiB"); }); it("should handle float mebibytes", () => { - should(SizeFormatHelpers.formatSize(12.5 * 1024 * 1024)).be.eql( - "12.5 MiB" - ); + expect(SizeFormatHelpers.formatSize(12.5 * 1024 * 1024)).toBe("12.5 MiB"); }); it("should handle integer gibibytes", () => { - should(SizeFormatHelpers.formatSize(3 * 1024 * 1024 * 1024)).be.eql( + expect(SizeFormatHelpers.formatSize(3 * 1024 * 1024 * 1024)).toBe( "3 GiB" ); }); it("should handle float gibibytes", () => { - should(SizeFormatHelpers.formatSize(1.2 * 1024 * 1024 * 1024)).be.eql( + expect(SizeFormatHelpers.formatSize(1.2 * 1024 * 1024 * 1024)).toBe( "1.2 GiB" ); }); it("should handle undefined/NaN", () => { - should(SizeFormatHelpers.formatSize(undefined)).be.eql("unknown size"); - should(SizeFormatHelpers.formatSize(NaN)).be.eql("unknown size"); + expect(SizeFormatHelpers.formatSize(undefined)).toBe("unknown size"); + expect(SizeFormatHelpers.formatSize(NaN)).toBe("unknown size"); }); }); }); diff --git a/test/SortableSet.unittest.js b/test/SortableSet.unittest.js index 7bc73584e..66968c3b3 100644 --- a/test/SortableSet.unittest.js +++ b/test/SortableSet.unittest.js @@ -6,7 +6,7 @@ const SortableSet = require("../lib/util/SortableSet"); describe("util/SortableSet", () => { it("Can be constructed like a normal Set", () => { const sortableSet = new SortableSet([1, 1, 1, 1, 1, 4, 5, 2], () => {}); - Array.from(sortableSet).should.eql([1, 4, 5, 2]); + expect(Array.from(sortableSet)).toEqual([1, 4, 5, 2]); }); it("Can sort its content", () => { @@ -15,7 +15,7 @@ describe("util/SortableSet", () => { (a, b) => a - b ); sortableSet.sort(); - Array.from(sortableSet).should.eql([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); + expect(Array.from(sortableSet)).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); }); it("Can sort by a specified function", () => { @@ -24,6 +24,6 @@ describe("util/SortableSet", () => { (a, b) => a - b ); sortableSet.sortWith((a, b) => b - a); - Array.from(sortableSet).should.eql([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]); + expect(Array.from(sortableSet)).toEqual([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]); }); }); diff --git a/test/SourceMapDevToolModuleOptionsPlugin.unittest.js b/test/SourceMapDevToolModuleOptionsPlugin.unittest.js index 9b3d0e0fb..dd348267b 100644 --- a/test/SourceMapDevToolModuleOptionsPlugin.unittest.js +++ b/test/SourceMapDevToolModuleOptionsPlugin.unittest.js @@ -1,6 +1,5 @@ "use strict"; -require("should"); const SourceMapDevToolModuleOptionsPlugin = require("../lib/SourceMapDevToolModuleOptionsPlugin"); const applyPluginWithOptions = require("./helpers/applyPluginWithOptions"); @@ -8,47 +7,50 @@ describe("SourceMapDevToolModuleOptionsPlugin", () => { describe("when applied", () => { let eventBindings; - beforeEach(() => (eventBindings = undefined)); + beforeEach(() => { + eventBindings = undefined; + }); describe("with module false and line-to-line false", () => { - beforeEach( - () => - (eventBindings = applyPluginWithOptions( - SourceMapDevToolModuleOptionsPlugin, - { - module: false, - lineToLine: false - } - )) - ); + beforeEach(() => { + eventBindings = applyPluginWithOptions( + SourceMapDevToolModuleOptionsPlugin, + { + module: false, + lineToLine: false + } + ); + }); - it("does not bind any event handlers", () => - eventBindings.length.should.be.exactly(0)); + it("does not bind any event handlers", () => { + expect(eventBindings.length).toBe(0); + }); }); describe("with module true", () => { - beforeEach( - () => - (eventBindings = applyPluginWithOptions( - SourceMapDevToolModuleOptionsPlugin, - { - module: true, - lineToLine: false - } - )) - ); + beforeEach(() => { + eventBindings = applyPluginWithOptions( + SourceMapDevToolModuleOptionsPlugin, + { + module: true, + lineToLine: false + } + ); + }); - it("binds one event handler", () => - eventBindings.length.should.be.exactly(1)); + it("binds one event handler", () => { + expect(eventBindings.length).toBe(1); + }); describe("event handler", () => { - it("binds to build-module event", () => - eventBindings[0].name.should.be.exactly("build-module")); + it("binds to build-module event", () => { + expect(eventBindings[0].name).toBe("build-module"); + }); it("sets source map flag", () => { const module = {}; eventBindings[0].handler(module); - module.should.deepEqual({ + expect(module).toEqual({ useSourceMap: true }); }); @@ -56,28 +58,28 @@ describe("SourceMapDevToolModuleOptionsPlugin", () => { }); describe("with line-to-line true", () => { - beforeEach( - () => - (eventBindings = applyPluginWithOptions( - SourceMapDevToolModuleOptionsPlugin, - { - module: false, - lineToLine: true - } - )) - ); + beforeEach(() => + (eventBindings = applyPluginWithOptions( + SourceMapDevToolModuleOptionsPlugin, + { + module: false, + lineToLine: true + } + ))); - it("binds one event handler", () => - eventBindings.length.should.be.exactly(1)); + it("binds one event handler", () => { + expect(eventBindings.length).toBe(1); + }); describe("event handler", () => { - it("binds to build-module event", () => - eventBindings[0].name.should.be.exactly("build-module")); + it("binds to build-module event", () => { + expect(eventBindings[0].name).toBe("build-module"); + }); it("sets line-to-line flag", () => { const module = {}; eventBindings[0].handler(module); - module.should.deepEqual({ + expect(module).toEqual({ lineToLine: true }); }); @@ -85,29 +87,30 @@ describe("SourceMapDevToolModuleOptionsPlugin", () => { }); describe("with line-to-line object", () => { - beforeEach( - () => - (eventBindings = applyPluginWithOptions( - SourceMapDevToolModuleOptionsPlugin, - { - module: false, - lineToLine: {} - } - )) - ); + beforeEach(() => { + eventBindings = applyPluginWithOptions( + SourceMapDevToolModuleOptionsPlugin, + { + module: false, + lineToLine: {} + } + ); + }); - it("binds one event handler", () => - eventBindings.length.should.be.exactly(1)); + it("binds one event handler", () => { + expect(eventBindings.length).toBe(1); + }); describe("event handler", () => { - it("binds to build-module event", () => - eventBindings[0].name.should.be.exactly("build-module")); + it("binds to build-module event", () => { + expect(eventBindings[0].name).toBe("build-module"); + }); describe("when module has no resource", () => { it("makes no changes", () => { const module = {}; eventBindings[0].handler(module); - module.should.deepEqual({}); + expect(module).toEqual({}); }); }); @@ -117,7 +120,7 @@ describe("SourceMapDevToolModuleOptionsPlugin", () => { resource: "foo" }; eventBindings[0].handler(module); - module.should.deepEqual({ + expect(module).toEqual({ lineToLine: true, resource: "foo" }); @@ -130,7 +133,7 @@ describe("SourceMapDevToolModuleOptionsPlugin", () => { resource: "foo?bar" }; eventBindings[0].handler(module); - module.should.deepEqual({ + expect(module).toEqual({ lineToLine: true, resource: "foo?bar" }); diff --git a/test/Stats.test.js b/test/Stats.test.js index d59bc1965..ffe2b8cec 100644 --- a/test/Stats.test.js +++ b/test/Stats.test.js @@ -1,13 +1,11 @@ /*globals describe it */ "use strict"; -require("should"); - const webpack = require("../lib/webpack"); const MemoryFs = require("memory-fs"); describe("Stats", () => { - it("should print env string in stats", function(done) { + it("should print env string in stats", done => { const compiler = webpack({ context: __dirname, entry: "./fixtures/a" @@ -16,15 +14,15 @@ describe("Stats", () => { compiler.run((err, stats) => { if (err) return done(err); try { - stats - .toString({ + expect( + stats.toString({ all: false, env: true, _env: "production" }) - .should.be.eql('Environment (--env): "production"'); - stats - .toString({ + ).toBe('Environment (--env): "production"'); + expect( + stats.toString({ all: false, env: true, _env: { @@ -32,15 +30,15 @@ describe("Stats", () => { baz: true } }) - .should.be.eql( - "Environment (--env): {\n" + - ' "prod": [\n' + - ' "foo",\n' + - ' "bar"\n' + - " ],\n" + - ' "baz": true\n' + - "}" - ); + ).toBe( + "Environment (--env): {\n" + + ' "prod": [\n' + + ' "foo",\n' + + ' "bar"\n' + + " ],\n" + + ' "baz": true\n' + + "}" + ); done(); } catch (e) { done(e); diff --git a/test/Stats.unittest.js b/test/Stats.unittest.js index 563a4e23e..c8f1f5d10 100644 --- a/test/Stats.unittest.js +++ b/test/Stats.unittest.js @@ -1,8 +1,6 @@ /*globals describe it */ "use strict"; -require("should"); - const Stats = require("../lib/Stats"); const packageJson = require("../package.json"); @@ -23,7 +21,7 @@ describe( "./node_modules/ts-loader!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/app.vue"; const expectPath = `./src/app.vue (${inputPath})\n`; - mockStats.formatFilePath(inputPath).should.be.exactly(expectPath); + expect(mockStats.formatFilePath(inputPath)).toBe(expectPath); }); }); @@ -38,7 +36,7 @@ describe( context: "" } }); - mockStats.hasErrors().should.be.ok(); + expect(mockStats.hasErrors()).toBe(true); }); it("hasWarnings", () => { const mockStats = new Stats({ @@ -49,7 +47,7 @@ describe( context: "" } }); - mockStats.hasWarnings().should.be.ok(); + expect(mockStats.hasWarnings()).toBe(true); }); }); describe("does not have", () => { @@ -62,7 +60,7 @@ describe( context: "" } }); - mockStats.hasErrors().should.not.be.ok(); + expect(mockStats.hasErrors()).toBe(false); }); it("hasWarnings", () => { const mockStats = new Stats({ @@ -73,7 +71,7 @@ describe( context: "" } }); - mockStats.hasWarnings().should.not.be.ok(); + expect(mockStats.hasWarnings()).toBe(false); }); }); describe("children have", () => { @@ -91,7 +89,7 @@ describe( errors: [], hash: "1234" }); - mockStats.hasErrors().should.be.ok(); + expect(mockStats.hasErrors()).toBe(true); }); it("hasWarnings", () => { const mockStats = new Stats({ @@ -107,7 +105,7 @@ describe( warnings: [], hash: "1234" }); - mockStats.hasWarnings().should.be.ok(); + expect(mockStats.hasWarnings()).toBe(true); }); }); it("formatError handles string errors", () => { @@ -116,6 +114,7 @@ describe( warnings: [], assets: [], entrypoints: new Map(), + namedChunkGroups: new Map(), chunks: [], modules: [], children: [], @@ -131,7 +130,7 @@ describe( } }); const obj = mockStats.toJson(); - obj.errors[0].should.be.equal("firstError"); + expect(obj.errors[0]).toEqual("firstError"); }); }); describe("toJson", () => { @@ -142,6 +141,7 @@ describe( assets: [], entrypoints: new Map(), chunks: [], + namedChunkGroups: new Map(), modules: [], children: [], hash: "1234", @@ -156,12 +156,13 @@ describe( } }); const result = mockStats.toJson(); - result.should.deepEqual({ + expect(result).toEqual({ assets: [], assetsByChunkName: {}, children: [], chunks: [], entrypoints: {}, + namedChunkGroups: {}, filteredAssets: 0, filteredModules: 0, errors: [], @@ -177,29 +178,29 @@ describe( describe("Presets", () => { describe("presetToOptions", () => { it("returns correct object with 'Normal'", () => { - Stats.presetToOptions("Normal").should.eql({}); + expect(Stats.presetToOptions("Normal")).toEqual({}); }); it("truthy values behave as 'normal'", () => { const normalOpts = Stats.presetToOptions("normal"); - Stats.presetToOptions("pizza").should.eql(normalOpts); - Stats.presetToOptions(true).should.eql(normalOpts); - Stats.presetToOptions(1).should.eql(normalOpts); + expect(Stats.presetToOptions("pizza")).toEqual(normalOpts); + expect(Stats.presetToOptions(true)).toEqual(normalOpts); + expect(Stats.presetToOptions(1)).toEqual(normalOpts); - Stats.presetToOptions("verbose").should.not.eql(normalOpts); - Stats.presetToOptions(false).should.not.eql(normalOpts); + expect(Stats.presetToOptions("verbose")).not.toEqual(normalOpts); + expect(Stats.presetToOptions(false)).not.toEqual(normalOpts); }); it("returns correct object with 'none'", () => { - Stats.presetToOptions("none").should.eql({ + expect(Stats.presetToOptions("none")).toEqual({ all: false }); }); it("falsy values behave as 'none'", () => { const noneOpts = Stats.presetToOptions("none"); - Stats.presetToOptions("").should.eql(noneOpts); - Stats.presetToOptions(null).should.eql(noneOpts); - Stats.presetToOptions().should.eql(noneOpts); - Stats.presetToOptions(0).should.eql(noneOpts); - Stats.presetToOptions(false).should.eql(noneOpts); + expect(Stats.presetToOptions("")).toEqual(noneOpts); + expect(Stats.presetToOptions(null)).toEqual(noneOpts); + expect(Stats.presetToOptions()).toEqual(noneOpts); + expect(Stats.presetToOptions(0)).toEqual(noneOpts); + expect(Stats.presetToOptions(false)).toEqual(noneOpts); }); }); }); diff --git a/test/StatsTestCases.test.js b/test/StatsTestCases.test.js index e75a40383..6ab8049d6 100644 --- a/test/StatsTestCases.test.js +++ b/test/StatsTestCases.test.js @@ -1,7 +1,6 @@ /*globals describe it */ "use strict"; -require("should"); const path = require("path"); const fs = require("fs"); @@ -20,8 +19,8 @@ const tests = fs describe("StatsTestCases", () => { tests.forEach(testName => { - it("should print correct stats for " + testName, function(done) { - this.timeout(10000); + it("should print correct stats for " + testName, done => { + jest.setTimeout(10000); let options = { mode: "development", entry: "./index", @@ -71,13 +70,11 @@ describe("StatsTestCases", () => { }); c.run((err, stats) => { if (err) return done(err); - if (/error$/.test(testName)) { - stats.hasErrors().should.be.equal(true); + expect(stats.hasErrors()).toBe(true); } else if (stats.hasErrors()) { return done(new Error(stats.toJson().errors.join("\n\n"))); } - let toStringOptions = { context: path.join(base, testName), colors: false @@ -87,7 +84,6 @@ describe("StatsTestCases", () => { toStringOptions = options.stats; if (toStringOptions === null || typeof toStringOptions !== "object") toStringOptions = Stats.presetToOptions(toStringOptions); - hasColorSetting = typeof options.stats.colors !== "undefined"; if (!toStringOptions.context) toStringOptions.context = path.join(base, testName); @@ -95,9 +91,8 @@ describe("StatsTestCases", () => { if (Array.isArray(options) && !toStringOptions.children) { toStringOptions.children = options.map(o => o.stats); } - let actual = stats.toString(toStringOptions); - (typeof actual).should.be.eql("string"); + expect(typeof actual).toBe("string"); if (!hasColorSetting) { actual = actual .replace(/\u001b\[[0-9;]*m/g, "") @@ -118,25 +113,12 @@ describe("StatsTestCases", () => { "$1 Thu Jan 01 1970 00:00:00 GMT" ); } - actual = actual .replace(/\r\n?/g, "\n") .replace(/[\t ]*Version:.+\n/g, "") .replace(path.join(base, testName), "Xdir/" + testName) .replace(/ dependencies:Xms/g, ""); - const expected = fs - .readFileSync(path.join(base, testName, "expected.txt"), "utf-8") - .replace(/\r/g, ""); - if (actual !== expected) { - fs.writeFileSync( - path.join(base, testName, "actual.txt"), - actual, - "utf-8" - ); - } else if (fs.existsSync(path.join(base, testName, "actual.txt"))) { - fs.unlinkSync(path.join(base, testName, "actual.txt")); - } - actual.should.be.eql(expected); + expect(actual).toMatchSnapshot(); done(); }); }); diff --git a/test/Template.unittest.js b/test/Template.unittest.js index fd1dcc68e..8b744e9c5 100644 --- a/test/Template.unittest.js +++ b/test/Template.unittest.js @@ -1,28 +1,23 @@ "use strict"; -require("should"); - const Template = require("../lib/Template"); describe("Template", () => { - it("should generate valid identifiers", () => - Template.toIdentifier("0abc-def9").should.equal("_0abc_def9")); + it("should generate valid identifiers", () => { + expect(Template.toIdentifier("0abc-def9")).toBe("_0abc_def9"); + }); it("should generate valid number identifiers", () => { const items = []; let item; for (let i = 0; i < 80; i += 1) { item = Template.numberToIdentifer(i); - if (item === "") { - throw new Error("empty number identifier"); - } else if (items.indexOf(item) > -1) { - throw new Error("duplicate number identifier"); - } else { - items.push(item); - } + expect(item).not.toBe(""); + expect(items).not.toContain(item); + items.push(item); } }); it("should generate sanitized path identifiers", () => { - Template.toPath("path/to-sdfas/sadfome$$.js").should.equal( + expect(Template.toPath("path/to-sdfas/sadfome$$.js")).toBe( "path-to-sdfas-sadfome$$-js" ); }); diff --git a/test/TestCases.template.js b/test/TestCases.template.js new file mode 100644 index 000000000..c860c7211 --- /dev/null +++ b/test/TestCases.template.js @@ -0,0 +1,262 @@ +/* global describe it beforeAll expect */ +"use strict"; + +const path = require("path"); +const fs = require("fs"); +const vm = require("vm"); +const mkdirp = require("mkdirp"); +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); +const checkArrayExpectation = require("./checkArrayExpectation"); + +const Stats = require("../lib/Stats"); +const webpack = require("../lib/webpack"); + +const uglifyJsForTesting = new UglifyJsPlugin({ + cache: false, + parallel: false, + sourceMap: true +}); + +const DEFAULT_OPTIMIZATIONS = { + removeAvailableModules: true, + removeEmptyChunks: true, + mergeDuplicateChunks: true, + flagIncludedChunks: true, + occurrenceOrder: true, + sideEffects: true, + providedExports: true, + usedExports: true, + noEmitOnErrors: false, + concatenateModules: false, + namedModules: false, + minimizer: [uglifyJsForTesting] +}; + +const NO_EMIT_ON_ERRORS_OPTIMIZATIONS = { + noEmitOnErrors: false, + minimizer: [uglifyJsForTesting] +}; + +const casesPath = path.join(__dirname, "cases"); +let categories = fs.readdirSync(casesPath); +categories = categories.map(cat => { + return { + name: cat, + tests: fs + .readdirSync(path.join(casesPath, cat)) + .filter(folder => folder.indexOf("_") < 0) + }; +}); + +const describeCases = config => { + describe(config.name, () => { + categories.forEach(category => { + describe(category.name, function() { + category.tests + .filter(test => { + const testDirectory = path.join(casesPath, category.name, test); + const filterPath = path.join(testDirectory, "test.filter.js"); + if (fs.existsSync(filterPath) && !require(filterPath)(config)) { + describe.skip(test, () => it("filtered")); + return false; + } + return true; + }) + .forEach(testName => { + describe(testName, () => { + const testDirectory = path.join( + casesPath, + category.name, + testName + ); + const outputDirectory = path.join( + __dirname, + "js", + config.name, + category.name, + testName + ); + const options = { + context: casesPath, + entry: "./" + category.name + "/" + testName + "/index", + target: "async-node", + devtool: config.devtool, + mode: config.mode || "none", + optimization: config.mode + ? NO_EMIT_ON_ERRORS_OPTIMIZATIONS + : Object.assign( + {}, + config.optimization, + DEFAULT_OPTIMIZATIONS + ), + performance: { + hints: false + }, + output: { + pathinfo: true, + path: outputDirectory, + filename: "bundle.js" + }, + resolve: { + modules: ["web_modules", "node_modules"], + mainFields: [ + "webpack", + "browser", + "web", + "browserify", + ["jam", "main"], + "main" + ], + aliasFields: ["browser"], + extensions: [ + ".mjs", + ".webpack.js", + ".web.js", + ".js", + ".json" + ], + concord: true + }, + resolveLoader: { + modules: [ + "web_loaders", + "web_modules", + "node_loaders", + "node_modules" + ], + mainFields: ["webpackLoader", "webLoader", "loader", "main"], + extensions: [ + ".webpack-loader.js", + ".web-loader.js", + ".loader.js", + ".js" + ] + }, + module: { + rules: [ + { + test: /\.coffee$/, + loader: "coffee-loader" + }, + { + test: /\.pug/, + loader: "pug-loader" + } + ] + }, + plugins: (config.plugins || []).concat(function() { + this.hooks.compilation.tap("TestCasesTest", compilation => { + [ + "optimize", + "optimizeModulesBasic", + "optimizeChunksBasic", + "afterOptimizeTree", + "afterOptimizeAssets" + ].forEach(hook => { + compilation.hooks[hook].tap("TestCasesTest", () => + compilation.checkConstraints() + ); + }); + }); + }) + }; + let exportedTests = []; + it( + testName + " should compile", + done => { + webpack(options, (err, stats) => { + if (err) done(err); + const statOptions = Stats.presetToOptions("verbose"); + statOptions.colors = false; + mkdirp.sync(outputDirectory); + fs.writeFileSync( + path.join(outputDirectory, "stats.txt"), + stats.toString(statOptions), + "utf-8" + ); + const jsonStats = stats.toJson({ + errorDetails: true + }); + if ( + checkArrayExpectation( + testDirectory, + jsonStats, + "error", + "Error", + done + ) + ) + return; + if ( + checkArrayExpectation( + testDirectory, + jsonStats, + "warning", + "Warning", + done + ) + ) + return; + + function _it(title, fn) { + exportedTests.push({ title, fn, timeout: 10000 }); + } + + function _require(module) { + if (module.substr(0, 2) === "./") { + const p = path.join(outputDirectory, module); + const fn = vm.runInThisContext( + "(function(require, module, exports, __dirname, it, expect) {" + + "global.expect = expect;" + + fs.readFileSync(p, "utf-8") + + "\n})", + p + ); + const m = { + exports: {}, + webpackTestSuiteModule: true + }; + fn.call( + m.exports, + _require, + m, + m.exports, + outputDirectory, + _it, + expect + ); + return m.exports; + } else return require(module); + } + _require.webpackTestSuiteRequire = true; + _require("./bundle.js"); + if (exportedTests.length === 0) + return done(new Error("No tests exported by test case")); + + const asyncSuite = describe("exported tests", () => { + exportedTests.forEach( + ({ title, fn, timeout }) => + fn + ? fit(title, fn, timeout) + : fit(title, () => {}).pend("Skipped") + ); + }); + // workaround for jest running clearSpies on the wrong suite (invoked by clearResourcesForRunnable) + asyncSuite.disabled = true; + + jasmine + .getEnv() + .execute([asyncSuite.id], asyncSuite) + .then(done, done); + }); + }, + 60000 + ); + }); + }); + }); + }); + }); +}; + +module.exports.describeCases = describeCases; diff --git a/test/TestCases.test.js b/test/TestCases.test.js deleted file mode 100644 index c286fabef..000000000 --- a/test/TestCases.test.js +++ /dev/null @@ -1,339 +0,0 @@ -/* global describe, it*/ -"use strict"; - -require("should"); -const path = require("path"); -const fs = require("fs"); -const vm = require("vm"); -const mkdirp = require("mkdirp"); -const Test = require("mocha/lib/test"); -const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); -const checkArrayExpectation = require("./checkArrayExpectation"); - -const Stats = require("../lib/Stats"); -const webpack = require("../lib/webpack"); - -const uglifyJsForTesting = new UglifyJsPlugin({ - cache: false, - parallel: false, - sourceMap: true -}); - -const DEFAULT_OPTIMIZATIONS = { - removeAvailableModules: true, - removeEmptyChunks: true, - mergeDuplicateChunks: true, - flagIncludedChunks: true, - occurrenceOrder: true, - sideEffects: true, - providedExports: true, - usedExports: true, - noEmitOnErrors: false, - concatenateModules: false, - namedModules: false, - minimizer: [uglifyJsForTesting] -}; - -const NO_EMIT_ON_ERRORS_OPTIMIZATIONS = { - noEmitOnErrors: false, - minimizer: [uglifyJsForTesting] -}; - -describe("TestCases", () => { - const casesPath = path.join(__dirname, "cases"); - let categories = fs.readdirSync(casesPath); - categories = categories.map(cat => { - return { - name: cat, - tests: fs - .readdirSync(path.join(casesPath, cat)) - .filter(folder => folder.indexOf("_") < 0) - }; - }); - [ - { - name: "normal" - }, - { - name: "production", - mode: "production" - }, - { - name: "development", - mode: "development", - devtool: "none" - }, - { - name: "hot", - plugins: [new webpack.HotModuleReplacementPlugin()] - }, - { - name: "hot-multi-step", - plugins: [ - new webpack.HotModuleReplacementPlugin({ - multiStep: true - }) - ] - }, - { - name: "devtool-eval", - devtool: "eval" - }, - { - name: "devtool-eval-named-modules", - devtool: "eval", - plugins: [new webpack.NamedModulesPlugin()] - }, - { - name: "devtool-eval-source-map", - devtool: "#eval-source-map" - }, - { - name: "devtool-inline-source-map", - devtool: "inline-source-map" - }, - { - name: "devtool-source-map", - devtool: "#@source-map" - }, - { - name: "devtool-cheap-inline-source-map", - devtool: "cheap-inline-source-map" - }, - { - name: "devtool-cheap-eval-source-map", - devtool: "cheap-eval-source-map" - }, - { - name: "devtool-cheap-eval-module-source-map", - devtool: "cheap-eval-module-source-map" - }, - { - name: "devtool-cheap-source-map", - devtool: "cheap-source-map" - }, - { - name: "minimized-source-map", - mode: "production", - devtool: "eval-cheap-module-source-map", - minimize: true - }, - { - name: "minimized-hashed-modules", - mode: "production", - minimize: true, - plugins: [new webpack.HashedModuleIdsPlugin()] - }, - { - name: "all-combined", - mode: "production", - devtool: "#@source-map", - minimize: true, - plugins: [ - new webpack.HotModuleReplacementPlugin(), - new webpack.NamedModulesPlugin(), - new webpack.NamedChunksPlugin() - ] - } - ].forEach(config => { - describe(config.name, () => { - categories.forEach(category => { - describe(category.name, function() { - this.timeout(30000); - category.tests - .filter(test => { - const testDirectory = path.join(casesPath, category.name, test); - const filterPath = path.join(testDirectory, "test.filter.js"); - if (fs.existsSync(filterPath) && !require(filterPath)(config)) { - describe.skip(test, () => it("filtered")); - return false; - } - return true; - }) - .forEach(testName => { - const suite = describe(testName, () => {}); - it(testName + " should compile", done => { - const testDirectory = path.join( - casesPath, - category.name, - testName - ); - const outputDirectory = path.join( - __dirname, - "js", - config.name, - category.name, - testName - ); - const options = { - context: casesPath, - entry: "./" + category.name + "/" + testName + "/index", - target: "async-node", - devtool: config.devtool, - mode: config.mode || "none", - optimization: config.mode - ? NO_EMIT_ON_ERRORS_OPTIMIZATIONS - : Object.assign( - {}, - config.optimization, - DEFAULT_OPTIMIZATIONS - ), - performance: { - hints: false - }, - output: { - pathinfo: true, - path: outputDirectory, - filename: "bundle.js" - }, - resolve: { - modules: ["web_modules", "node_modules"], - mainFields: [ - "webpack", - "browser", - "web", - "browserify", - ["jam", "main"], - "main" - ], - aliasFields: ["browser"], - extensions: [ - ".mjs", - ".webpack.js", - ".web.js", - ".js", - ".json" - ], - concord: true - }, - resolveLoader: { - modules: [ - "web_loaders", - "web_modules", - "node_loaders", - "node_modules" - ], - mainFields: [ - "webpackLoader", - "webLoader", - "loader", - "main" - ], - extensions: [ - ".webpack-loader.js", - ".web-loader.js", - ".loader.js", - ".js" - ] - }, - module: { - rules: [ - { - test: /\.coffee$/, - loader: "coffee-loader" - }, - { - test: /\.jade$/, - loader: "jade-loader" - } - ] - }, - plugins: (config.plugins || []).concat(function() { - this.hooks.compilation.tap("TestCasesTest", compilation => { - [ - "optimize", - "optimizeModulesBasic", - "optimizeChunksBasic", - "afterOptimizeTree", - "afterOptimizeAssets" - ].forEach(hook => { - compilation.hooks[hook].tap("TestCasesTest", () => - compilation.checkConstraints() - ); - }); - }); - }) - }; - webpack(options, (err, stats) => { - if (err) return done(err); - const statOptions = Stats.presetToOptions("verbose"); - statOptions.colors = false; - mkdirp.sync(outputDirectory); - fs.writeFileSync( - path.join(outputDirectory, "stats.txt"), - stats.toString(statOptions), - "utf-8" - ); - const jsonStats = stats.toJson({ - errorDetails: true - }); - if ( - checkArrayExpectation( - testDirectory, - jsonStats, - "error", - "Error", - done - ) - ) - return; - if ( - checkArrayExpectation( - testDirectory, - jsonStats, - "warning", - "Warning", - done - ) - ) - return; - let exportedTest = 0; - - function _it(title, fn) { - const test = new Test(title, fn); - suite.addTest(test); - exportedTest++; - // WORKAROUND for a v8 bug - // Error objects retrain all scopes in the stacktrace - test._trace = test._trace.message; - - return test; - } - - function _require(module) { - if (module.substr(0, 2) === "./") { - const p = path.join(outputDirectory, module); - const fn = vm.runInThisContext( - "(function(require, module, exports, __dirname, it) {" + - fs.readFileSync(p, "utf-8") + - "\n})", - p - ); - const m = { - exports: {}, - webpackTestSuiteModule: true - }; - fn.call( - m.exports, - _require, - m, - m.exports, - outputDirectory, - _it - ); - return m.exports; - } else return require(module); - } - _require.webpackTestSuiteRequire = true; - _require("./bundle.js"); - if (exportedTest === 0) - return done(new Error("No tests exported by test case")); - done(); - }); - }); - }); - }); - }); - }); - }); -}); diff --git a/test/TestCasesAllCombined.test.js b/test/TestCasesAllCombined.test.js new file mode 100644 index 000000000..e413ff2c2 --- /dev/null +++ b/test/TestCasesAllCombined.test.js @@ -0,0 +1,16 @@ +const { describeCases } = require("./TestCases.template"); +const webpack = require("../lib/webpack"); + +describe("TestCases", () => { + describeCases({ + name: "all-combined", + mode: "production", + devtool: "#@source-map", + minimize: true, + plugins: [ + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), + new webpack.NamedChunksPlugin() + ] + }); +}); diff --git a/test/TestCasesDevelopment.test.js b/test/TestCasesDevelopment.test.js new file mode 100644 index 000000000..5d1ec3123 --- /dev/null +++ b/test/TestCasesDevelopment.test.js @@ -0,0 +1,9 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "development", + mode: "development", + devtool: "none" + }); +}); diff --git a/test/TestCasesDevtoolCheapEvalModuleSourceMap.test.js b/test/TestCasesDevtoolCheapEvalModuleSourceMap.test.js new file mode 100644 index 000000000..9a951ea0f --- /dev/null +++ b/test/TestCasesDevtoolCheapEvalModuleSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-cheap-eval-module-source-map", + devtool: "cheap-eval-module-source-map" + }); +}); diff --git a/test/TestCasesDevtoolCheapEvalSourceMap.test.js b/test/TestCasesDevtoolCheapEvalSourceMap.test.js new file mode 100644 index 000000000..3bccf31af --- /dev/null +++ b/test/TestCasesDevtoolCheapEvalSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-cheap-eval-source-map", + devtool: "cheap-eval-source-map" + }); +}); diff --git a/test/TestCasesDevtoolCheapInlineSourceMap.test.js b/test/TestCasesDevtoolCheapInlineSourceMap.test.js new file mode 100644 index 000000000..ce5a41516 --- /dev/null +++ b/test/TestCasesDevtoolCheapInlineSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-cheap-inline-source-map", + devtool: "cheap-inline-source-map" + }); +}); diff --git a/test/TestCasesDevtoolCheapSourceMap.test.js b/test/TestCasesDevtoolCheapSourceMap.test.js new file mode 100644 index 000000000..dd38edcab --- /dev/null +++ b/test/TestCasesDevtoolCheapSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-cheap-source-map", + devtool: "cheap-source-map" + }); +}); diff --git a/test/TestCasesDevtoolEval.test.js b/test/TestCasesDevtoolEval.test.js new file mode 100644 index 000000000..d03f12978 --- /dev/null +++ b/test/TestCasesDevtoolEval.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-eval", + devtool: "eval" + }); +}); diff --git a/test/TestCasesDevtoolEvalNamedModules.test.js b/test/TestCasesDevtoolEvalNamedModules.test.js new file mode 100644 index 000000000..a3c1cd699 --- /dev/null +++ b/test/TestCasesDevtoolEvalNamedModules.test.js @@ -0,0 +1,10 @@ +const { describeCases } = require("./TestCases.template"); +const webpack = require("../lib/webpack"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-eval-named-modules", + devtool: "eval", + plugins: [new webpack.NamedModulesPlugin()] + }); +}); diff --git a/test/TestCasesDevtoolEvalSourceMap.test.js b/test/TestCasesDevtoolEvalSourceMap.test.js new file mode 100644 index 000000000..bb68ab810 --- /dev/null +++ b/test/TestCasesDevtoolEvalSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-eval-source-map", + devtool: "#eval-source-map" + }); +}); diff --git a/test/TestCasesDevtoolInlineSourceMap.test.js b/test/TestCasesDevtoolInlineSourceMap.test.js new file mode 100644 index 000000000..de3dc7127 --- /dev/null +++ b/test/TestCasesDevtoolInlineSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-inline-source-map", + devtool: "inline-source-map" + }); +}); diff --git a/test/TestCasesDevtoolSourceMap.test.js b/test/TestCasesDevtoolSourceMap.test.js new file mode 100644 index 000000000..b204305ea --- /dev/null +++ b/test/TestCasesDevtoolSourceMap.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "devtool-source-map", + devtool: "#@source-map" + }); +}); diff --git a/test/TestCasesHot.test.js b/test/TestCasesHot.test.js new file mode 100644 index 000000000..30c0f2f6c --- /dev/null +++ b/test/TestCasesHot.test.js @@ -0,0 +1,9 @@ +const { describeCases } = require("./TestCases.template"); +const webpack = require("../lib/webpack"); + +describe("TestCases", () => { + describeCases({ + name: "hot", + plugins: [new webpack.HotModuleReplacementPlugin()] + }); +}); diff --git a/test/TestCasesHotMultiStep.test.js b/test/TestCasesHotMultiStep.test.js new file mode 100644 index 000000000..981c1b544 --- /dev/null +++ b/test/TestCasesHotMultiStep.test.js @@ -0,0 +1,13 @@ +const { describeCases } = require("./TestCases.template"); +const webpack = require("../lib/webpack"); + +describe("TestCases", () => { + describeCases({ + name: "hot-multi-step", + plugins: [ + new webpack.HotModuleReplacementPlugin({ + multiStep: true + }) + ] + }); +}); diff --git a/test/TestCasesMinimizedHashedModules.test.js b/test/TestCasesMinimizedHashedModules.test.js new file mode 100644 index 000000000..b28e926b9 --- /dev/null +++ b/test/TestCasesMinimizedHashedModules.test.js @@ -0,0 +1,11 @@ +const { describeCases } = require("./TestCases.template"); +const webpack = require("../lib/webpack"); + +describe("TestCases", () => { + describeCases({ + name: "minimized-hashed-modules", + mode: "production", + minimize: true, + plugins: [new webpack.HashedModuleIdsPlugin()] + }); +}); diff --git a/test/TestCasesMinimizedSourceMap.test.js b/test/TestCasesMinimizedSourceMap.test.js new file mode 100644 index 000000000..9ec3b5717 --- /dev/null +++ b/test/TestCasesMinimizedSourceMap.test.js @@ -0,0 +1,10 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "minimized-source-map", + mode: "production", + devtool: "eval-cheap-module-source-map", + minimize: true + }); +}); diff --git a/test/TestCasesNormal.test.js b/test/TestCasesNormal.test.js new file mode 100644 index 000000000..9d975ad28 --- /dev/null +++ b/test/TestCasesNormal.test.js @@ -0,0 +1,7 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "normal" + }); +}); diff --git a/test/TestCasesProduction.test.js b/test/TestCasesProduction.test.js new file mode 100644 index 000000000..8708f34d2 --- /dev/null +++ b/test/TestCasesProduction.test.js @@ -0,0 +1,8 @@ +const { describeCases } = require("./TestCases.template"); + +describe("TestCases", () => { + describeCases({ + name: "production", + mode: "production" + }); +}); diff --git a/test/Validation.test.js b/test/Validation.test.js index b29e9f5e1..6f29d6a9e 100644 --- a/test/Validation.test.js +++ b/test/Validation.test.js @@ -1,8 +1,6 @@ /* globals describe, it */ "use strict"; -require("should"); - const webpack = require("../lib/webpack"); describe("Validation", () => { @@ -201,7 +199,7 @@ describe("Validation", () => { " - configuration has an unknown property 'postcss'. These properties are valid:", " object { mode?, amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, " + "loader?, module?, name?, node?, output?, optimization?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, " + - "recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }", + "recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions? }", " For typos: please correct them.", " For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.", " Loaders should be updated to allow passing options via loader options in module.rules.", @@ -282,11 +280,10 @@ describe("Validation", () => { } }, test(err) { - err.message.should.startWith("Invalid configuration object."); - err.message - .split("\n") - .slice(1)[0] - .should.be.eql(" - configuration.stats should be one of these:"); + expect(err.message).toMatch(/^Invalid configuration object./); + expect(err.message.split("\n").slice(1)[0]).toBe( + " - configuration.stats should be one of these:" + ); } }, { @@ -393,11 +390,8 @@ describe("Validation", () => { return; } - err.message.should.startWith("Invalid configuration object."); - err.message - .split("\n") - .slice(1) - .should.be.eql(testCase.message); + expect(err.message).toMatch(/^Invalid configuration object./); + expect(err.message.split("\n").slice(1)).toEqual(testCase.message); return; } diff --git a/test/WatchDetection.test.js b/test/WatchDetection.test.js index f801a4d7c..590c56ef8 100644 --- a/test/WatchDetection.test.js +++ b/test/WatchDetection.test.js @@ -1,7 +1,6 @@ "use strict"; -/*globals describe it before after */ -require("should"); +/*globals describe it */ const path = require("path"); const fs = require("fs"); const MemoryFs = require("memory-fs"); @@ -10,20 +9,21 @@ const webpack = require("../"); describe("WatchDetection", () => { if (process.env.NO_WATCH_TESTS) { - it("long running tests excluded"); + it.skip("long running tests excluded", () => {}); return; } - for (let changeTimeout = 0; changeTimeout < 100; changeTimeout += 10) { + jest.setTimeout(10000); + + for (let changeTimeout = 10; changeTimeout < 100; changeTimeout += 10) { createTestCase(changeTimeout); } - for (let changeTimeout = 100; changeTimeout <= 2000; changeTimeout += 100) { + for (let changeTimeout = 200; changeTimeout <= 2000; changeTimeout += 200) { createTestCase(changeTimeout); } function createTestCase(changeTimeout) { - describe("time between changes " + changeTimeout + "ms", function() { - this.timeout(10000); + describe(`time between changes ${changeTimeout}ms`, () => { const fixturePath = path.join( __dirname, "fixtures", @@ -32,29 +32,41 @@ describe("WatchDetection", () => { const filePath = path.join(fixturePath, "file.js"); const file2Path = path.join(fixturePath, "file2.js"); const loaderPath = path.join(__dirname, "fixtures", "delay-loader.js"); - before(() => { + + beforeAll(() => { try { fs.mkdirSync(fixturePath); - } catch (e) {} // eslint-disable-line no-empty + } catch (e) { + // empty + } fs.writeFileSync(filePath, "require('./file2')", "utf-8"); fs.writeFileSync(file2Path, "original", "utf-8"); }); - after(done => { + + afterAll(done => { setTimeout(() => { try { fs.unlinkSync(filePath); - } catch (e) {} // eslint-disable-line no-empty + } catch (e) { + // empty + } try { fs.unlinkSync(file2Path); - } catch (e) {} // eslint-disable-line no-empty + } catch (e) { + // empty + } try { fs.rmdirSync(fixturePath); - } catch (e) {} // eslint-disable-line no-empty + } catch (e) { + // empty + } done(); }, 100); // cool down a bit }); + it("should build the bundle correctly", done => { const compiler = webpack({ + mode: "development", entry: loaderPath + "!" + filePath, output: { path: "/", @@ -130,7 +142,7 @@ describe("WatchDetection", () => { onChange = null; watcher.close(() => { - setTimeout(done, 1000); + setTimeout(done, 500); }); } diff --git a/test/WatchTestCases.test.js b/test/WatchTestCases.test.js index ea4a3c6f5..339d3bcd2 100644 --- a/test/WatchTestCases.test.js +++ b/test/WatchTestCases.test.js @@ -1,17 +1,18 @@ +/* global beforeAll expect fit */ "use strict"; -require("should"); const path = require("path"); const fs = require("fs"); const vm = require("vm"); -const Test = require("mocha/lib/test"); const mkdirp = require("mkdirp"); +const rimraf = require("rimraf"); const checkArrayExpectation = require("./checkArrayExpectation"); +const { remove } = require("./helpers/remove"); const Stats = require("../lib/Stats"); const webpack = require("../lib/webpack"); -function copyDiff(src, dest) { +function copyDiff(src, dest, initial) { if (!fs.existsSync(dest)) fs.mkdirSync(dest); const files = fs.readdirSync(src); files.forEach(filename => { @@ -19,33 +20,29 @@ function copyDiff(src, dest) { const destFile = path.join(dest, filename); const directory = fs.statSync(srcFile).isDirectory(); if (directory) { - copyDiff(srcFile, destFile); + copyDiff(srcFile, destFile, initial); } else { var content = fs.readFileSync(srcFile); - if (/^DELETE\s*$/.test(content.toString("utf-8"))) + if (/^DELETE\s*$/.test(content.toString("utf-8"))) { fs.unlinkSync(destFile); - else fs.writeFileSync(destFile, content); - } - }); -} - -function remove(src) { - if (!fs.existsSync(src)) return; - const files = fs.readdirSync(src); - files.forEach(filename => { - const srcFile = path.join(src, filename); - const directory = fs.statSync(srcFile).isDirectory(); - if (directory) { - remove(srcFile); - } else { - fs.unlinkSync(srcFile); + } else { + fs.writeFileSync(destFile, content); + if (initial) { + const longTimeAgo = Date.now() - 1000 * 60 * 60 * 24; + fs.utimesSync( + destFile, + Date.now() - longTimeAgo, + Date.now() - longTimeAgo + ); + } + } } }); } describe("WatchTestCases", () => { if (process.env.NO_WATCH_TESTS) { - it("long running tests excluded"); + it.skip("long running tests excluded", () => {}); return; } @@ -58,17 +55,26 @@ describe("WatchTestCases", () => { tests: fs .readdirSync(path.join(casesPath, cat)) .filter(folder => folder.indexOf("_") < 0) + .filter(testName => { + const testDirectory = path.join(casesPath, cat, testName); + const filterPath = path.join(testDirectory, "test.filter.js"); + if (fs.existsSync(filterPath) && !require(filterPath)()) { + describe.skip(testName, () => it("filtered")); + return false; + } + return true; + }) .sort() }; }); - before(() => { + beforeAll(() => { let dest = path.join(__dirname, "js"); if (!fs.existsSync(dest)) fs.mkdirSync(dest); dest = path.join(__dirname, "js", "watch-src"); if (!fs.existsSync(dest)) fs.mkdirSync(dest); }); categories.forEach(category => { - before(() => { + beforeAll(() => { const dest = path.join(__dirname, "js", "watch-src", category.name); if (!fs.existsSync(dest)) fs.mkdirSync(dest); }); @@ -89,231 +95,262 @@ describe("WatchTestCases", () => { .filter(name => { return fs.statSync(path.join(testDirectory, name)).isDirectory(); }) - .map(name => { - return { - name: name, - suite: describe(name, () => {}) + .map(name => ({ name })); + + beforeAll(done => { + rimraf(tempDirectory, done); + }); + + it( + testName + " should compile", + done => { + const outputDirectory = path.join( + __dirname, + "js", + "watch", + category.name, + testName + ); + + let options = {}; + const configPath = path.join(testDirectory, "webpack.config.js"); + if (fs.existsSync(configPath)) options = require(configPath); + const applyConfig = options => { + if (!options.mode) options.mode = "development"; + if (!options.context) options.context = tempDirectory; + if (!options.entry) options.entry = "./index.js"; + if (!options.target) options.target = "async-node"; + if (!options.output) options.output = {}; + if (!options.output.path) options.output.path = outputDirectory; + if (typeof options.output.pathinfo === "undefined") + options.output.pathinfo = true; + if (!options.output.filename) + options.output.filename = "bundle.js"; }; - }); - before(() => remove(tempDirectory)); - it("should compile", function(done) { - this.timeout(45000); - const outputDirectory = path.join( - __dirname, - "js", - "watch", - category.name, - testName - ); + if (Array.isArray(options)) { + options.forEach(applyConfig); + } else { + applyConfig(options); + } - let options = {}; - const configPath = path.join(testDirectory, "webpack.config.js"); - if (fs.existsSync(configPath)) options = require(configPath); - const applyConfig = options => { - if (!options.mode) options.mode = "development"; - if (!options.context) options.context = tempDirectory; - if (!options.entry) options.entry = "./index.js"; - if (!options.target) options.target = "async-node"; - if (!options.output) options.output = {}; - if (!options.output.path) options.output.path = outputDirectory; - if (typeof options.output.pathinfo === "undefined") - options.output.pathinfo = true; - if (!options.output.filename) - options.output.filename = "bundle.js"; - }; - if (Array.isArray(options)) { - options.forEach(applyConfig); - } else { - applyConfig(options); - } + const state = {}; + let runIdx = 0; + let waitMode = false; + let run = runs[runIdx]; + let triggeringFilename; + let lastHash = ""; + const currentWatchStepModule = require("./helpers/currentWatchStep"); + currentWatchStepModule.step = run.name; + copyDiff(path.join(testDirectory, run.name), tempDirectory, true); - const state = {}; - let runIdx = 0; - let waitMode = false; - let run = runs[runIdx]; - let triggeringFilename; - let lastHash = ""; - const currentWatchStepModule = require("./helpers/currentWatchStep"); - currentWatchStepModule.step = run.name; - copyDiff(path.join(testDirectory, run.name), tempDirectory); - - setTimeout(() => { - const compiler = webpack(options); - compiler.hooks.invalid.tap( - "WatchTestCasesTest", - (filename, mtime) => { - triggeringFilename = filename; - } - ); - const watching = compiler.watch( - { - aggregateTimeout: 1000 - }, - (err, stats) => { - if (err) return done(err); - if (!stats) - return done(new Error("No stats reported from Compiler")); - if (stats.hash === lastHash) return; - lastHash = stats.hash; - if (run.done && lastHash !== stats.hash) { - return done( - new Error( - "Compilation changed but no change was issued " + - lastHash + - " != " + - stats.hash + - " (run " + - runIdx + - ")\n" + - "Triggering change: " + - triggeringFilename - ) + setTimeout(() => { + const compiler = webpack(options); + compiler.hooks.invalid.tap( + "WatchTestCasesTest", + (filename, mtime) => { + triggeringFilename = filename; + } + ); + const watching = compiler.watch( + { + aggregateTimeout: 1000 + }, + (err, stats) => { + if (err) return done(err); + if (!stats) + return done(new Error("No stats reported from Compiler")); + if (stats.hash === lastHash) return; + lastHash = stats.hash; + if (run.done && lastHash !== stats.hash) { + return done( + new Error( + "Compilation changed but no change was issued " + + lastHash + + " != " + + stats.hash + + " (run " + + runIdx + + ")\n" + + "Triggering change: " + + triggeringFilename + ) + ); + } + if (waitMode) return; + run.done = true; + if (err) return done(err); + const statOptions = Stats.presetToOptions("verbose"); + statOptions.colors = false; + mkdirp.sync(outputDirectory); + fs.writeFileSync( + path.join(outputDirectory, "stats.txt"), + stats.toString(statOptions), + "utf-8" ); - } - if (waitMode) return; - run.done = true; - if (err) return done(err); - const statOptions = Stats.presetToOptions("verbose"); - statOptions.colors = false; - mkdirp.sync(outputDirectory); - fs.writeFileSync( - path.join(outputDirectory, "stats.txt"), - stats.toString(statOptions), - "utf-8" - ); - const jsonStats = stats.toJson({ - errorDetails: true - }); - if ( - checkArrayExpectation( - path.join(testDirectory, run.name), - jsonStats, - "error", - "Error", - done - ) - ) - return; - if ( - checkArrayExpectation( - path.join(testDirectory, run.name), - jsonStats, - "warning", - "Warning", - done - ) - ) - return; - let exportedTests = 0; - - function _it(title, fn) { - const test = new Test(title, fn); - run.suite.addTest(test); - exportedTests++; - return test; - } - - const globalContext = { - console: console - }; - - function _require(currentDirectory, module) { - if (Array.isArray(module) || /^\.\.?\//.test(module)) { - let fn; - let content; - let p; - if (Array.isArray(module)) { - p = path.join(currentDirectory, module[0]); - content = module - .map(arg => { - p = path.join(currentDirectory, arg); - return fs.readFileSync(p, "utf-8"); - }) - .join("\n"); - } else { - p = path.join(currentDirectory, module); - content = fs.readFileSync(p, "utf-8"); - } - if ( - options.target === "web" || - options.target === "webworker" - ) { - fn = vm.runInNewContext( - "(function(require, module, exports, __dirname, __filename, it, WATCH_STEP, STATS_JSON, STATE, window) {" + - content + - "\n})", - globalContext, - p - ); - } else { - fn = vm.runInThisContext( - "(function(require, module, exports, __dirname, __filename, it, WATCH_STEP, STATS_JSON, STATE) {" + - content + - "\n})", - p - ); - } - const m = { - exports: {} - }; - fn.call( - m.exports, - _require.bind(null, path.dirname(p)), - m, - m.exports, - path.dirname(p), - p, - _it, - run.name, - jsonStats, - state, - globalContext - ); - return module.exports; - } else if ( - testConfig.modules && - module in testConfig.modules - ) { - return testConfig.modules[module]; - } else return require(module); - } - - let testConfig = {}; - try { - // try to load a test file - testConfig = require(path.join( - testDirectory, - "test.config.js" - )); - } catch (e) {} // eslint-disable-line no-empty - - if (testConfig.noTests) return process.nextTick(done); - _require( - outputDirectory, - testConfig.bundlePath || "./bundle.js" - ); - - if (exportedTests < 1) - return done(new Error("No tests exported by test case")); - runIdx++; - if (runIdx < runs.length) { - run = runs[runIdx]; - waitMode = true; - setTimeout(() => { - waitMode = false; - currentWatchStepModule.step = run.name; - copyDiff( + const jsonStats = stats.toJson({ + errorDetails: true + }); + if ( + checkArrayExpectation( path.join(testDirectory, run.name), - tempDirectory + jsonStats, + "error", + "Error", + done + ) + ) + return; + if ( + checkArrayExpectation( + path.join(testDirectory, run.name), + jsonStats, + "warning", + "Warning", + done + ) + ) + return; + + const exportedTests = []; + + function _it(title, fn) { + exportedTests.push({ title, fn, timeout: 45000 }); + } + + const globalContext = { + console: console, + expect: expect + }; + + function _require(currentDirectory, module) { + if (Array.isArray(module) || /^\.\.?\//.test(module)) { + let fn; + let content; + let p; + if (Array.isArray(module)) { + p = path.join(currentDirectory, module[0]); + content = module + .map(arg => { + p = path.join(currentDirectory, arg); + return fs.readFileSync(p, "utf-8"); + }) + .join("\n"); + } else { + p = path.join(currentDirectory, module); + content = fs.readFileSync(p, "utf-8"); + } + if ( + options.target === "web" || + options.target === "webworker" + ) { + fn = vm.runInNewContext( + "(function(require, module, exports, __dirname, __filename, it, WATCH_STEP, STATS_JSON, STATE, expect, window) {" + + content + + "\n})", + globalContext, + p + ); + } else { + fn = vm.runInThisContext( + "(function(require, module, exports, __dirname, __filename, it, WATCH_STEP, STATS_JSON, STATE, expect) {" + + "global.expect = expect;" + + content + + "\n})", + p + ); + } + const m = { + exports: {} + }; + fn.call( + m.exports, + _require.bind(null, path.dirname(p)), + m, + m.exports, + path.dirname(p), + p, + _it, + run.name, + jsonStats, + state, + expect, + globalContext + ); + return module.exports; + } else if ( + testConfig.modules && + module in testConfig.modules + ) { + return testConfig.modules[module]; + } else return require.requireActual(module); + } + + let testConfig = {}; + try { + // try to load a test file + testConfig = require(path.join( + testDirectory, + "test.config.js" + )); + } catch (e) { + // empty + } + + if (testConfig.noTests) return process.nextTick(done); + _require( + outputDirectory, + testConfig.bundlePath || "./bundle.js" + ); + + if (exportedTests.length < 1) + return done(new Error("No tests exported by test case")); + + const continueStep = () => { + runIdx++; + if (runIdx < runs.length) { + run = runs[runIdx]; + waitMode = true; + setTimeout(() => { + waitMode = false; + currentWatchStepModule.step = run.name; + copyDiff( + path.join(testDirectory, run.name), + tempDirectory, + false + ); + }, 1500); + } else { + watching.close(); + + done(); + } + }; + + // Run the tests + const asyncSuite = describe(`step ${run.name}`, () => { + exportedTests.forEach( + ({ title, fn, timeout }) => + fn + ? fit(title, fn, timeout) + : fit(title, () => {}).pend("Skipped") ); - }, 1500); - } else { - watching.close(); - process.nextTick(done); + }); + // workaround for jest running clearSpies on the wrong suite (invoked by clearResourcesForRunnable) + asyncSuite.disabled = true; + + jasmine + .getEnv() + .execute([asyncSuite.id], asyncSuite) + .then(continueStep, done); } - } - ); - }, 300); + ); + }, 300); + }, + 45000 + ); + + afterAll(() => { + remove(tempDirectory); }); }); }); diff --git a/test/WatcherEvents.test.js b/test/WatcherEvents.test.js index 6a74464d2..00fc41dbf 100644 --- a/test/WatcherEvents.test.js +++ b/test/WatcherEvents.test.js @@ -1,8 +1,7 @@ "use strict"; -/*globals describe it before after */ +/* globals describe it */ const path = require("path"); -require("should"); const MemoryFs = require("memory-fs"); const webpack = require("../"); @@ -28,20 +27,20 @@ const createMultiCompiler = () => { ]); }; -describe("WatcherEvents", function() { +describe("WatcherEvents", () => { if (process.env.NO_WATCH_TESTS) { - it("long running tests excluded"); + it.skip("long running tests excluded", () => {}); return; } - this.timeout(10000); + jest.setTimeout(10000); - it("should emit 'watch-close' when using single-compiler mode and the compiler is not running", function(done) { + it("should emit 'watch-close' when using single-compiler mode and the compiler is not running", done => { let called = false; const compiler = createSingleCompiler(); const watcher = compiler.watch({}, (err, stats) => { - called.should.be.exactly(true); + expect(called).toBe(true); done(err); }); @@ -54,12 +53,12 @@ describe("WatcherEvents", function() { }); }); - it("should emit 'watch-close' when using multi-compiler mode and the compiler is not running", function(done) { + it("should emit 'watch-close' when using multi-compiler mode and the compiler is not running", done => { let called = false; const compiler = createMultiCompiler(); const watcher = compiler.watch({}, (err, stats) => { - called.should.be.exactly(true); + expect(called).toBe(true); done(err); }); diff --git a/test/WebEnvironmentPlugin.unittest.js b/test/WebEnvironmentPlugin.unittest.js index ce1d87f4f..137956a00 100644 --- a/test/WebEnvironmentPlugin.unittest.js +++ b/test/WebEnvironmentPlugin.unittest.js @@ -1,31 +1,23 @@ "use strict"; -const should = require("should"); const WebEnvironmentPlugin = require("../lib/web/WebEnvironmentPlugin"); describe("WebEnvironmentPlugin", () => { - let WebEnvironmentPluginInstance; - - before( - () => - (WebEnvironmentPluginInstance = new WebEnvironmentPlugin( - "inputFileSystem", - "outputFileSystem" - )) - ); - describe("apply", () => { - let compileSpy; - before(() => { - compileSpy = { - outputFileSystem: "otherOutputFileSystem" - }; - WebEnvironmentPluginInstance.apply(compileSpy); - }); + const WebEnvironmentPluginInstance = new WebEnvironmentPlugin( + "inputFileSystem", + "outputFileSystem" + ); + const compileSpy = { + outputFileSystem: "otherOutputFileSystem" + }; - it("should set compiler.outputFileSystem information with the same as set in WebEnvironmentPlugin", () => - should(compileSpy.outputFileSystem).be.eql( + WebEnvironmentPluginInstance.apply(compileSpy); + + it("should set compiler.outputFileSystem information with the same as set in WebEnvironmentPlugin", () => { + expect(compileSpy.outputFileSystem).toBe( WebEnvironmentPluginInstance.outputFileSystem - )); + ); + }); }); }); diff --git a/test/WebpackError.unittest.js b/test/WebpackError.unittest.js index f52692e4b..cbf90fab4 100644 --- a/test/WebpackError.unittest.js +++ b/test/WebpackError.unittest.js @@ -1,8 +1,8 @@ "use strict"; +const path = require("path"); const util = require("util"); -require("should"); const WebpackError = require("../lib/WebpackError"); describe("WebpackError", () => { @@ -18,12 +18,12 @@ describe("WebpackError", () => { } } - it("Should provide inspect method for use by for util.inspect", function() { + it("Should provide inspect method for use by for util.inspect", () => { const errorStr = util.inspect(new CustomError("Message")); const errorArr = errorStr.split("\n"); - errorArr[0].should.equal("CustomError: CustomMessage"); - errorArr[1].should.containEql("WebpackError.unittest.js"); - errorArr[errorArr.length - 1].should.equal("CustomDetails"); + expect(errorArr[0]).toBe("CustomError: CustomMessage"); + expect(errorArr[1]).toMatch(path.basename(__filename)); + expect(errorArr[errorArr.length - 1]).toBe("CustomDetails"); }); }); diff --git a/test/WebpackMissingModule.unittest.js b/test/WebpackMissingModule.unittest.js index c08f978da..73ea0a790 100644 --- a/test/WebpackMissingModule.unittest.js +++ b/test/WebpackMissingModule.unittest.js @@ -1,15 +1,14 @@ /* globals describe, it */ "use strict"; -const should = require("should"); const WebpackMissingModule = require("../lib/dependencies/WebpackMissingModule"); describe("WebpackMissingModule", () => { describe("#moduleCode", () => { it("returns an error message based on given error message", () => { const errorMessage = WebpackMissingModule.moduleCode("mock message"); - should(errorMessage).be.eql( - 'var e = new Error("Cannot find module \\"mock message\\""); e.code = \'MODULE_NOT_FOUND\'; throw e;' + expect(errorMessage).toBe( + "var e = new Error(\"Cannot find module 'mock message'\"); e.code = 'MODULE_NOT_FOUND'; throw e;" ); }); }); @@ -17,8 +16,8 @@ describe("WebpackMissingModule", () => { describe("#promise", () => { it("returns an error message based on given error message", () => { const errorMessage = WebpackMissingModule.promise("mock message"); - should(errorMessage).be.eql( - 'Promise.reject(function webpackMissingModule() { var e = new Error("Cannot find module \\"mock message\\""); e.code = \'MODULE_NOT_FOUND\'; return e; }())' + expect(errorMessage).toBe( + "Promise.reject(function webpackMissingModule() { var e = new Error(\"Cannot find module 'mock message'\"); e.code = 'MODULE_NOT_FOUND'; return e; }())" ); }); }); @@ -26,8 +25,8 @@ describe("WebpackMissingModule", () => { describe("#module", () => { it("returns an error message based on given error message", () => { const errorMessage = WebpackMissingModule.module("mock message"); - should(errorMessage).be.eql( - '!(function webpackMissingModule() { var e = new Error("Cannot find module \\"mock message\\""); e.code = \'MODULE_NOT_FOUND\'; throw e; }())' + expect(errorMessage).toBe( + "!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'mock message'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())" ); }); }); diff --git a/test/__snapshots__/RemovedPlugins.unittest.js.snap b/test/__snapshots__/RemovedPlugins.unittest.js.snap new file mode 100644 index 000000000..ecac2f61a --- /dev/null +++ b/test/__snapshots__/RemovedPlugins.unittest.js.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`removed plugin errors should error when accessing removed plugins 1`] = `"webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead."`; + +exports[`removed plugin errors should error when accessing removed plugins 2`] = `"webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead."`; diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap new file mode 100644 index 000000000..74b351dd2 --- /dev/null +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -0,0 +1,2628 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = ` +"Hash: 4fe9463156cb2a99f4a94fe9463156cb2a99f4a9 +Child fitting: + Hash: 4fe9463156cb2a99f4a9 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] + f2e891598128a57b072c.js 10.2 KiB 1 [emitted] + d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] + 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] + Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js f2e891598128a57b072c.js + chunk {0} 9ac13fb7087e9ff1b93e.js 916 bytes <{1}> <{2}> <{3}> + > ./g [4] ./index.js 7:0-13 + [7] ./g.js 916 bytes {0} [built] + chunk {1} f2e891598128a57b072c.js 1.87 KiB ={2}= ={3}= >{0}< [entry] [rendered] + > ./index main + [3] ./e.js 899 bytes {1} [built] + [4] ./index.js 111 bytes {1} [built] + [6] ./f.js 900 bytes {1} [built] + chunk {2} d1ba53816ff760e185b0.js 1.76 KiB ={1}= ={3}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [0] ./b.js 899 bytes {2} [built] + [5] ./a.js 899 bytes {2} [built] + chunk {3} 7b5b0a943e9362bc88c6.js 1.76 KiB ={1}= ={2}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [1] ./c.js 899 bytes {3} [built] + [2] ./d.js 899 bytes {3} [built] +Child content-change: + Hash: 4fe9463156cb2a99f4a9 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] + f2e891598128a57b072c.js 10.2 KiB 1 [emitted] + d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] + 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] + Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js f2e891598128a57b072c.js + chunk {0} 9ac13fb7087e9ff1b93e.js 916 bytes <{1}> <{2}> <{3}> + > ./g [4] ./index.js 7:0-13 + [7] ./g.js 916 bytes {0} [built] + chunk {1} f2e891598128a57b072c.js 1.87 KiB ={2}= ={3}= >{0}< [entry] [rendered] + > ./index main + [3] ./e.js 899 bytes {1} [built] + [4] ./index.js 111 bytes {1} [built] + [6] ./f.js 900 bytes {1} [built] + chunk {2} d1ba53816ff760e185b0.js 1.76 KiB ={1}= ={3}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [0] ./b.js 899 bytes {2} [built] + [5] ./a.js 899 bytes {2} [built] + chunk {3} 7b5b0a943e9362bc88c6.js 1.76 KiB ={1}= ={2}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [1] ./c.js 899 bytes {3} [built] + [2] ./d.js 899 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = ` +"Hash: 84ad1d7e4c9cdd4b13e4 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +cf8697fa2c994f39a5d4.js 1.94 KiB 6, 7 [emitted] +fd868baa40dab4fc30fd.js 1.93 KiB 0 [emitted] +79c527bb5bf9cba1dc12.js 1.96 KiB 2 [emitted] +e9d82e81fefd7353e8df.js 1.94 KiB 3, 1 [emitted] +ae76098eeb55b9c448f2.js 1.01 KiB 4 [emitted] +05d92aaacfbffa4b7e56.js 1.94 KiB 5 [emitted] +d6418937dfae4b3ee922.js 1 KiB 1 [emitted] +685acdc95ff4af957f47.js 1 KiB 7 [emitted] +606f48c13070850338b1.js 1.94 KiB 8 [emitted] +c5a8eae840969538f450.js 1.94 KiB 9 [emitted] +c69b2f79fdf6e98907c4.js 8.68 KiB 10 [emitted] main +fcdf398c8972e4dcf788.js 1.94 KiB 11 [emitted] +Entrypoint main = c69b2f79fdf6e98907c4.js +chunk {0} fd868baa40dab4fc30fd.js 1.76 KiB <{10}> ={1}= ={2}= ={3}= ={7}= ={9}= [recorded] aggressive splitted + > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [0] ./b.js 899 bytes {0} {5} [built] + [1] ./d.js 899 bytes {0} {8} [built] +chunk {1} d6418937dfae4b3ee922.js 899 bytes <{10}> ={0}= ={2}= ={8}= + > ./c ./d ./e [11] ./index.js 3:0-30 + > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 + [2] ./e.js 899 bytes {1} {3} [built] +chunk {2} 79c527bb5bf9cba1dc12.js 1.76 KiB <{10}> ={0}= ={1}= ={11}= ={3}= ={6}= ={7}= ={9}= [recorded] aggressive splitted + > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 + > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [3] ./f.js 899 bytes {2} [built] + [4] ./g.js 901 bytes {2} [built] +chunk {3} e9d82e81fefd7353e8df.js 1.76 KiB <{10}> ={0}= ={2}= ={7}= ={9}= [rendered] [recorded] aggressive splitted + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [2] ./e.js 899 bytes {1} {3} [built] + [6] ./h.js 899 bytes {3} {11} [built] +chunk {4} ae76098eeb55b9c448f2.js 899 bytes <{10}> + > ./a [11] ./index.js 1:0-16 + [10] ./a.js 899 bytes {4} [built] +chunk {5} 05d92aaacfbffa4b7e56.js 1.76 KiB <{10}> + > ./b ./c [11] ./index.js 2:0-23 + [0] ./b.js 899 bytes {0} {5} [built] + [5] ./c.js 899 bytes {5} {8} [built] +chunk {6} cf8697fa2c994f39a5d4.js 1.76 KiB <{10}> ={11}= ={2}= + > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 + [8] ./j.js 901 bytes {6} {9} [built] + [9] ./k.js 899 bytes {6} {7} [built] +chunk {7} 685acdc95ff4af957f47.js 899 bytes <{10}> ={0}= ={2}= ={3}= ={9}= + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [9] ./k.js 899 bytes {6} {7} [built] +chunk {8} 606f48c13070850338b1.js 1.76 KiB <{10}> ={1}= [recorded] aggressive splitted + > ./c ./d ./e [11] ./index.js 3:0-30 + [1] ./d.js 899 bytes {0} {8} [built] + [5] ./c.js 899 bytes {5} {8} [built] +chunk {9} c5a8eae840969538f450.js 1.76 KiB <{10}> ={0}= ={2}= ={3}= ={7}= [rendered] [recorded] aggressive splitted + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [7] ./i.js 899 bytes {9} {11} [built] + [8] ./j.js 901 bytes {6} {9} [built] +chunk {10} c69b2f79fdf6e98907c4.js (main) 248 bytes >{0}< >{1}< >{11}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< >{8}< >{9}< [entry] [rendered] + > ./index main + [11] ./index.js 248 bytes {10} [built] +chunk {11} fcdf398c8972e4dcf788.js 1.76 KiB <{10}> ={2}= ={6}= [rendered] [recorded] aggressive splitted + > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 + [6] ./h.js 899 bytes {3} {11} [built] + [7] ./i.js 899 bytes {9} {11} [built]" +`; + +exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = ` +"Entrypoint main = main.js +chunk {0} 0.js 21 bytes <{3}> ={1}= ={2}= [rendered] reused as split chunk (cache group: default) + > [3] ./index.js 17:1-21:3 + > [3] ./index.js 2:1-5:3 + > ./a ./b [3] ./index.js 9:1-13:3 + [0] ./a.js 21 bytes {0} [built] +chunk {1} 1.js 21 bytes <{3}> ={0}= [rendered] + > ./a ./b [3] ./index.js 9:1-13:3 + [1] ./b.js 21 bytes {1} [built] +chunk {2} 2.js 21 bytes <{3}> ={0}= [rendered] + > [3] ./index.js 17:1-21:3 + [2] ./c.js 21 bytes {2} [built] +chunk {3} main.js (main) 515 bytes >{0}< >{1}< >{2}< [entry] [rendered] + > ./ main + [3] ./index.js 515 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for async-commons-chunk-auto 1`] = ` +"Child disabled: + Entrypoint main = disabled/main.js + Entrypoint a = disabled/a.js + Entrypoint b = disabled/b.js + Entrypoint c = disabled/c.js + chunk {0} disabled/async-g.js (async-g) 54 bytes <{1}> <{5}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [8] ./g.js 34 bytes {0} [built] + chunk {1} disabled/async-a.js (async-a) 216 bytes <{4}> >{0}< [rendered] + > ./a [7] ./index.js 1:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {2} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] + > ./b [7] ./index.js 2:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [4] ./b.js 72 bytes {2} {6} [built] + chunk {3} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] + > ./c [7] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + | ./c.js 72 bytes [built] + | ./node_modules/z.js 20 bytes [built] + chunk {4} disabled/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [7] ./index.js 147 bytes {4} [built] + chunk {5} disabled/a.js (a) 216 bytes >{0}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} disabled/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [4] ./b.js 72 bytes {2} {6} [built] + chunk {7} disabled/c.js (c) 167 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + | ./c.js 72 bytes [built] + | ./node_modules/z.js 20 bytes [built] +Child default: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/b.js + Entrypoint c = default/c.js + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {4} [built] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + > ./a [8] ./index.js 1:0-47 + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [5] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + > ./c [8] ./index.js 3:0-47 + [6] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) + > ./c [8] ./index.js 3:0-47 + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [5] ./b.js 72 bytes {6} {11} [built] + chunk {12} default/c.js (c) 152 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + [6] ./c.js 72 bytes {7} {12} [built] +Child vendors: + Entrypoint main = vendors/main.js + Entrypoint a = vendors/vendors.js vendors/a.js + Entrypoint b = vendors/vendors.js vendors/b.js + Entrypoint c = vendors/vendors.js vendors/c.js + chunk {0} vendors/async-g.js (async-g) 54 bytes <{1}> <{4}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [9] ./g.js 34 bytes {0} [built] + chunk {1} vendors/async-a.js (async-a) 216 bytes <{5}> >{0}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {2} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] + [5] ./b.js 72 bytes {2} {7} [built] + chunk {3} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [4] ./node_modules/z.js 20 bytes {3} {4} [built] + [6] ./c.js 72 bytes {3} {8} [built] + chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{0}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./a a + > ./b b + > ./c c + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] + [4] ./node_modules/z.js 20 bytes {3} {4} [built] + chunk {5} vendors/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} vendors/a.js (a) 176 bytes ={4}= >{0}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} vendors/b.js (b) 112 bytes ={4}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [5] ./b.js 72 bytes {2} {7} [built] + chunk {8} vendors/c.js (c) 112 bytes ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [6] ./c.js 72 bytes {3} {8} [built] +Child multiple-vendors: + Entrypoint main = multiple-vendors/main.js + Entrypoint a = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/a.js + Entrypoint b = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/b.js + Entrypoint c = multiple-vendors/libs-x.js multiple-vendors/vendors~async-c~c.js multiple-vendors/c.js + chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} multiple-vendors/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} multiple-vendors/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} multiple-vendors/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} multiple-vendors/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} multiple-vendors/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} multiple-vendors/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built] +Child all: + Entrypoint main = all/main.js + Entrypoint a = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/a.js + Entrypoint b = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/b.js + Entrypoint c = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~async-c~c.js all/c.js + chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} all/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} all/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} all/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} all/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} all/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} all/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built]" +`; + +exports[`StatsTestCases should print correct stats for chunk-module-id-range 1`] = ` +"Hash: bc5067cf597a5fece180 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main2.js 3.89 KiB 0 [emitted] main2 +main1.js 3.89 KiB 1 [emitted] main1 +Entrypoint main1 = main1.js +Entrypoint main2 = main2.js +chunk {0} main2.js (main2) 136 bytes [entry] [rendered] + > ./main2 main2 + [0] ./e.js 20 bytes {0} [built] + [1] ./f.js 20 bytes {0} [built] + [2] ./main2.js 56 bytes {0} [built] + [100] ./d.js 20 bytes {0} {1} [built] + [101] ./a.js 20 bytes {0} {1} [built] +chunk {1} main1.js (main1) 136 bytes [entry] [rendered] + > ./main1 main1 + [3] ./b.js 20 bytes {1} [built] + [4] ./main1.js 56 bytes {1} [built] + [100] ./d.js 20 bytes {0} {1} [built] + [101] ./a.js 20 bytes {0} {1} [built] + [102] ./c.js 20 bytes {1} [built]" +`; + +exports[`StatsTestCases should print correct stats for chunks 1`] = ` +"Hash: 329edf3a78275c679fe4 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +0.bundle.js 152 bytes 0 [emitted] +1.bundle.js 289 bytes 1 [emitted] + bundle.js 7.27 KiB 2 [emitted] main +3.bundle.js 227 bytes 3 [emitted] +Entrypoint main = bundle.js +chunk {0} 0.bundle.js 22 bytes <{2}> [rendered] + > ./b [4] ./index.js 2:0-16 + [2] ./b.js 22 bytes {0} [built] + amd require ./b [4] ./index.js 2:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {1} 1.bundle.js 54 bytes <{2}> >{3}< [rendered] + > ./c [4] ./index.js 3:0-16 + [3] ./c.js 54 bytes {1} [built] + amd require ./c [4] ./index.js 3:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {2} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main + [4] ./index.js 51 bytes {2} [built] + single entry ./index main + factory:Xms building:Xms = Xms + [5] ./a.js 22 bytes {2} [built] + cjs require ./a [4] ./index.js 1:0-14 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {3} 3.bundle.js 44 bytes <{1}> [rendered] + > [3] ./c.js 1:0-52 + [0] ./d.js 22 bytes {3} [built] + require.ensure item ./d [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms + [1] ./e.js 22 bytes {3} [built] + require.ensure item ./e [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for chunks-development 1`] = ` +"Hash: d9a9db28b39a3075bdb3 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +0.bundle.js 433 bytes 0 [emitted] +1.bundle.js 297 bytes 1 [emitted] +2.bundle.js 588 bytes 2 [emitted] + bundle.js 7.65 KiB main [emitted] main +Entrypoint main = bundle.js +chunk {main} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main + [./a.js] 22 bytes {main} [built] + cjs require ./a [./index.js] 1:0-14 + cjs require ./a [./e.js] 1:0-14 + [./index.js] Xms -> factory:Xms building:Xms = Xms + [./index.js] 51 bytes {main} [built] + single entry ./index main + factory:Xms building:Xms = Xms +chunk {0} 0.bundle.js 54 bytes <{main}> >{2}< [rendered] + > ./c [./index.js] ./index.js 3:0-16 + [./c.js] 54 bytes {0} [built] + amd require ./c [./index.js] 3:0-16 + [./index.js] Xms -> factory:Xms building:Xms = Xms +chunk {1} 1.bundle.js 22 bytes <{main}> [rendered] + > ./b [./index.js] ./index.js 2:0-16 + [./b.js] 22 bytes {1} [built] + amd require ./b [./index.js] 2:0-16 + [./index.js] Xms -> factory:Xms building:Xms = Xms +chunk {2} 2.bundle.js 60 bytes <{0}> [rendered] + > [./c.js] ./c.js 1:0-52 + [./d.js] 22 bytes {2} [built] + require.ensure item ./d [./c.js] 1:0-52 + [./index.js] Xms -> [./c.js] Xms -> factory:Xms building:Xms = Xms + [./e.js] 38 bytes {2} [built] + require.ensure item ./e [./c.js] 1:0-52 + [./index.js] Xms -> [./c.js] Xms -> factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for circular-correctness 1`] = ` +"Entrypoint main = bundle.js +chunk {0} 0.bundle.js (a) 49 bytes <{2}> <{3}> >{3}< [rendered] + [1] ./module-a.js 49 bytes {0} [built] +chunk {1} 1.bundle.js (b) 49 bytes <{2}> <{3}> >{3}< [rendered] + [2] ./module-b.js 49 bytes {1} [built] +chunk {2} bundle.js (main) 98 bytes >{0}< >{1}< [entry] [rendered] + [3] ./index.js 98 bytes {2} [built] +chunk {3} 3.bundle.js (c) 98 bytes <{0}> <{1}> >{0}< >{1}< [rendered] + [0] ./module-c.js 98 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for color-disabled 1`] = ` +"Hash: 259c9ad9aa282b7b9017 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 2.61 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for color-enabled 1`] = ` +"Hash: 259c9ad9aa282b7b9017 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 2.61 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for color-enabled-custom 1`] = ` +"Hash: 259c9ad9aa282b7b9017 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 2.61 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for commons-chunk-min-size-0 1`] = ` +"Hash: ba7c69f3acc19ed72f3f +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + entry-1.js 5.62 KiB 0 [emitted] entry-1 +vendor-1~entry-1.js 314 bytes 1 [emitted] vendor-1~entry-1 +Entrypoint entry-1 = vendor-1~entry-1.js entry-1.js +[0] ./entry-1.js 145 bytes {0} [built] +[1] ./modules/a.js 22 bytes {1} [built] +[2] ./modules/b.js 22 bytes {1} [built] +[3] ./modules/c.js 22 bytes {1} [built] +[4] ./modules/d.js 22 bytes {0} [built] +[5] ./modules/e.js 22 bytes {0} [built] +[6] ./modules/f.js 22 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for commons-chunk-min-size-Infinity 1`] = ` +"Hash: f8b8bebc8cf37cf02f7f +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + entry-1.js 5.62 KiB 0 [emitted] entry-1 +vendor-1.js 314 bytes 1 [emitted] vendor-1 +Entrypoint entry-1 = vendor-1.js entry-1.js +[0] ./entry-1.js 145 bytes {0} [built] +[1] ./modules/a.js 22 bytes {1} [built] +[2] ./modules/b.js 22 bytes {1} [built] +[3] ./modules/c.js 22 bytes {1} [built] +[4] ./modules/d.js 22 bytes {0} [built] +[5] ./modules/e.js 22 bytes {0} [built] +[6] ./modules/f.js 22 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for commons-plugin-issue-4980 1`] = ` +"Hash: b7026c887b1a4d42c4c08b5ecbff0d004a138881 +Child + Hash: b7026c887b1a4d42c4c0 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + app.js 5.71 KiB 0 [emitted] app + vendor.6a3bdffda9f0de672978.js 619 bytes 1 [emitted] vendor + Entrypoint app = vendor.6a3bdffda9f0de672978.js app.js + [./constants.js] 87 bytes {1} [built] + [./entry-1.js] ./entry-1.js + 2 modules 190 bytes {0} [built] + | ./entry-1.js 67 bytes [built] + | ./submodule-a.js 59 bytes [built] + | ./submodule-b.js 59 bytes [built] +Child + Hash: 8b5ecbff0d004a138881 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + app.js 5.72 KiB 0 [emitted] app + vendor.6a3bdffda9f0de672978.js 619 bytes 1 [emitted] vendor + Entrypoint app = vendor.6a3bdffda9f0de672978.js app.js + [./constants.js] 87 bytes {1} [built] + [./entry-2.js] ./entry-2.js + 2 modules 197 bytes {0} [built] + | ./entry-2.js 67 bytes [built] + | ./submodule-a.js 59 bytes [built] + | ./submodule-c.js 66 bytes [built]" +`; + +exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1`] = ` +"[0] ./index.js + 2 modules 119 bytes {0} [built] + | ./index.js 46 bytes [built] + | ModuleConcatenation bailout: Module is an entry point + | ./node_modules/pmodule/a.js 49 bytes [built] + | ./node_modules/pmodule/aa.js 24 bytes [built] +[1] ./node_modules/pmodule/b.js 49 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[2] ./node_modules/pmodule/bb.js 24 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[3] ./node_modules/pmodule/c.js 49 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[4] ./node_modules/pmodule/cc.js 24 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[5] ./node_modules/pmodule/index.js 63 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk" +`; + +exports[`StatsTestCases should print correct stats for define-plugin 1`] = ` +"Hash: efa53b4a8c763381d4296ac4ef4ab386e0e18a8c +Child + Hash: efa53b4a8c763381d429 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + main.js 2.63 KiB 0 [emitted] main + Entrypoint main = main.js + [0] ./index.js 24 bytes {0} [built] +Child + Hash: 6ac4ef4ab386e0e18a8c + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + main.js 2.63 KiB 0 [emitted] main + Entrypoint main = main.js + [0] ./index.js 24 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for exclude-with-loader 1`] = ` +"Hash: 82110ff5e7d166cc4117 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 3.05 KiB 0 [emitted] main + + 1 hidden asset +Entrypoint main = bundle.js +[0] ./index.js 77 bytes {0} [built] +[1] ./a.txt 43 bytes {0} [built] + + 2 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for external 1`] = ` +"Hash: 447b77fa7bc9bbdfcf31 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 2.74 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 17 bytes {0} [built] +[1] external \\"test\\" 42 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for filter-warnings 1`] = ` +"Hash: a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25a128fafbc2b7d659de25 +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: a128fafbc2b7d659de25 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.19 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]" +`; + +exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` +"Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +chunk {0} c.js (c) 49 bytes <{3}> <{4}> >{1}< [rendered] + [1] ./module-c.js 49 bytes {0} [built] + import() ./module-c [2] ./module-b.js 1:0-47 + import() ./module-c [4] ./e2.js 1:0-47 +chunk {1} a.js (a) 49 bytes <{0}> <{2}> >{4}< [rendered] + [0] ./module-a.js 49 bytes {1} [built] + import() ./module-a [1] ./module-c.js 1:0-47 + import() ./module-a [3] ./e1.js 1:0-47 +chunk {2} e1.js (e1) 49 bytes >{1}< [entry] [rendered] + [3] ./e1.js 49 bytes {2} [built] + single entry ./e1 e1 +chunk {3} e2.js (e2) 49 bytes >{0}< [entry] [rendered] + [4] ./e2.js 49 bytes {3} [built] + single entry ./e2 e2 +chunk {4} b.js (b) 49 bytes <{1}> >{0}< [rendered] + [2] ./module-b.js 49 bytes {4} [built] + import() ./module-b [0] ./module-a.js 1:0-47" +`; + +exports[`StatsTestCases should print correct stats for graph-correctness-modules 1`] = ` +"Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +chunk {0} y.js (y) 0 bytes <{3}> <{4}> [rendered] + [3] ./module-y.js 0 bytes {0} [built] + import() ./module-y [0] ./module-x.js 1:0-47 +chunk {1} c.js (c) 49 bytes <{4}> <{5}> >{2}< [rendered] + [2] ./module-c.js 49 bytes {1} [built] + import() ./module-c [4] ./module-b.js 1:0-47 + import() ./module-c [6] ./e2.js 2:0-47 +chunk {2} a.js (a) 49 bytes <{1}> <{3}> >{5}< [rendered] + [1] ./module-a.js 49 bytes {2} [built] + import() ./module-a [2] ./module-c.js 1:0-47 + import() ./module-a [5] ./e1.js 2:0-47 +chunk {3} e1.js (e1) 119 bytes >{0}< >{2}< [entry] [rendered] + [0] ./module-x.js 49 bytes {3} {4} [built] + import() ./module-x [4] ./module-b.js 2:0-20 + harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 + harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 + [5] ./e1.js 70 bytes {3} [built] + single entry ./e1 e1 +chunk {4} e2.js (e2) 119 bytes >{0}< >{1}< [entry] [rendered] + [0] ./module-x.js 49 bytes {3} {4} [built] + import() ./module-x [4] ./module-b.js 2:0-20 + harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 + harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 + [6] ./e2.js 70 bytes {4} [built] + single entry ./e2 e2 +chunk {5} b.js (b) 179 bytes <{2}> >{1}< [rendered] + [4] ./module-b.js 179 bytes {5} [built] + import() ./module-b [1] ./module-a.js 1:0-47" +`; + +exports[`StatsTestCases should print correct stats for import-context-filter 1`] = ` +"Hash: f249efcc0232c180bf68 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 305 bytes 0 [emitted] + 1.js 314 bytes 1 [emitted] + 2.js 308 bytes 2 [emitted] +entry.js 8.07 KiB 3 [emitted] entry +Entrypoint entry = entry.js +[0] ./templates/bar.js 38 bytes {0} [optional] [built] +[1] ./templates/baz.js 38 bytes {1} [optional] [built] +[2] ./templates/foo.js 38 bytes {2} [optional] [built] +[3] ./entry.js 450 bytes {3} [built] +[4] ./templates lazy ^\\\\.\\\\/.*$ include: \\\\.js$ exclude: \\\\.noimport\\\\.js$ namespace object 160 bytes {3} [optional] [built]" +`; + +exports[`StatsTestCases should print correct stats for import-weak 1`] = ` +"Hash: 9cccc27b7625bd171c12 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 149 bytes 0 [emitted] +entry.js 8.06 KiB 1 [emitted] entry +Entrypoint entry = entry.js +[0] ./modules/b.js 22 bytes {0} [built] +[1] ./entry.js 120 bytes {1} [built] +[2] ./modules/a.js 37 bytes [built]" +`; + +exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = ` +"Hash: 3c127dca42ce1c13b8eae6c0ceac1aa3be512946a5969fc94d792cce5364503bf42779f704747e2d +Child 1 chunks: + Hash: 3c127dca42ce1c13b8ea + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 5.98 KiB 0 [emitted] main + Entrypoint main = bundle.js + chunk {0} bundle.js (main) 191 bytes <{0}> >{0}< [entry] [rendered] + [0] ./index.js 73 bytes {0} [built] + [1] ./a.js 22 bytes {0} [built] + [2] ./b.js 22 bytes {0} [built] + [3] ./c.js 30 bytes {0} [built] + [4] ./d.js 22 bytes {0} [built] + [5] ./e.js 22 bytes {0} [built] +Child 2 chunks: + Hash: e6c0ceac1aa3be512946 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.bundle.js 1 KiB 0 [emitted] + bundle.js 7.46 KiB 1 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 118 bytes <{0}> <{1}> >{0}< [rendered] + [0] ./d.js 22 bytes {0} [built] + [1] ./e.js 22 bytes {0} [built] + [2] ./a.js 22 bytes {0} [built] + [3] ./b.js 22 bytes {0} [built] + [4] ./c.js 30 bytes {0} [built] + chunk {1} bundle.js (main) 73 bytes >{0}< [entry] [rendered] + [5] ./index.js 73 bytes {1} [built] +Child 3 chunks: + Hash: a5969fc94d792cce5364 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.bundle.js 886 bytes 0 [emitted] + 1.bundle.js 245 bytes 1 [emitted] + bundle.js 7.46 KiB 2 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 74 bytes <{0}> <{2}> >{0}< >{1}< [rendered] + [0] ./d.js 22 bytes {0} [built] + [2] ./a.js 22 bytes {0} [built] + [4] ./c.js 30 bytes {0} [built] + chunk {1} 1.bundle.js 44 bytes <{0}> <{2}> [rendered] + [1] ./e.js 22 bytes {1} [built] + [3] ./b.js 22 bytes {1} [built] + chunk {2} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + [5] ./index.js 73 bytes {2} [built] +Child 4 chunks: + Hash: 503bf42779f704747e2d + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.bundle.js 236 bytes 0 [emitted] + 1.bundle.js 245 bytes 1 [emitted] + 2.bundle.js 715 bytes 2 [emitted] + bundle.js 7.46 KiB 3 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 44 bytes <{2}> <{3}> [rendered] + [0] ./d.js 22 bytes {0} [built] + [2] ./a.js 22 bytes {0} [built] + chunk {1} 1.bundle.js 44 bytes <{2}> <{3}> [rendered] + [1] ./e.js 22 bytes {1} [built] + [3] ./b.js 22 bytes {1} [built] + chunk {2} 2.bundle.js 30 bytes <{3}> >{0}< >{1}< [rendered] + [4] ./c.js 30 bytes {2} [built] + chunk {3} bundle.js (main) 73 bytes >{0}< >{1}< >{2}< [entry] [rendered] + [5] ./index.js 73 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for max-modules 1`] = ` +"Hash: 528955f6d280625ce14d +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 5.85 KiB 0 [emitted] main +Entrypoint main = main.js + [0] ./a.js?1 33 bytes {0} [built] + [1] ./a.js?2 33 bytes {0} [built] + [2] ./a.js?3 33 bytes {0} [built] + [3] ./a.js?4 33 bytes {0} [built] + [4] ./a.js?5 33 bytes {0} [built] + [5] ./a.js?6 33 bytes {0} [built] + [6] ./a.js?7 33 bytes {0} [built] + [7] ./a.js?8 33 bytes {0} [built] + [8] ./a.js?9 33 bytes {0} [built] + [9] ./a.js?10 33 bytes {0} [built] +[10] ./index.js 181 bytes {0} [built] +[11] ./c.js?1 33 bytes {0} [built] +[13] ./c.js?2 33 bytes {0} [built] +[15] ./c.js?3 33 bytes {0} [built] +[17] ./c.js?4 33 bytes {0} [built] +[19] ./c.js?5 33 bytes {0} [built] +[23] ./c.js?7 33 bytes {0} [built] +[25] ./c.js?8 33 bytes {0} [built] +[27] ./c.js?9 33 bytes {0} [built] +[29] ./c.js?10 33 bytes {0} [built] + + 11 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for max-modules-default 1`] = ` +"Hash: 528955f6d280625ce14d +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 5.85 KiB 0 [emitted] main +Entrypoint main = main.js + [0] ./a.js?1 33 bytes {0} [built] + [1] ./a.js?2 33 bytes {0} [built] + [2] ./a.js?3 33 bytes {0} [built] + [3] ./a.js?4 33 bytes {0} [built] + [4] ./a.js?5 33 bytes {0} [built] + [5] ./a.js?6 33 bytes {0} [built] + [6] ./a.js?7 33 bytes {0} [built] + [7] ./a.js?8 33 bytes {0} [built] + [8] ./a.js?9 33 bytes {0} [built] + [9] ./a.js?10 33 bytes {0} [built] +[10] ./index.js 181 bytes {0} [built] +[11] ./c.js?1 33 bytes {0} [built] +[13] ./c.js?2 33 bytes {0} [built] +[27] ./c.js?9 33 bytes {0} [built] +[29] ./c.js?10 33 bytes {0} [built] + + 16 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for module-assets 1`] = ` +"Hash: f544bcf110bd1cf43d65 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT +Entrypoint main = main.js +chunk {0} 0.js 68 bytes <{1}> [rendered] + [0] ./node_modules/a/1.png 51 bytes {0} [built] [1 asset] + [1] ./node_modules/a/index.js 17 bytes {0} [built] +chunk {1} main.js (main) 12 bytes >{0}< [entry] [rendered] + [2] ./index.js 12 bytes {1} [built] +[0] ./node_modules/a/1.png 51 bytes {0} [built] [1 asset] +[1] ./node_modules/a/index.js 17 bytes {0} [built] +[2] ./index.js 12 bytes {1} [built]" +`; + +exports[`StatsTestCases should print correct stats for module-deduplication 1`] = ` +"Asset Size Chunks Chunk Names + 0.js 730 bytes 0, 5 [emitted] + 1.js 730 bytes 1, 4 [emitted] + 2.js 730 bytes 2, 3 [emitted] + 3.js 661 bytes 3 [emitted] + 4.js 661 bytes 4 [emitted] + 5.js 661 bytes 5 [emitted] +e1.js 8.4 KiB 6 [emitted] e1 +e2.js 8.43 KiB 7 [emitted] e2 +e3.js 8.45 KiB 8 [emitted] e3 +Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +Entrypoint e3 = e3.js +chunk {0} 0.js 37 bytes <{7}> <{8}> [rendered] + [2] ./d.js 9 bytes {0} {6} [built] + [5] ./async1.js 28 bytes {0} {5} [built] +chunk {1} 1.js 37 bytes <{6}> <{8}> [rendered] + [3] ./f.js 9 bytes {1} {7} [built] + [6] ./async2.js 28 bytes {1} {4} [built] +chunk {2} 2.js 37 bytes <{6}> <{7}> [rendered] + [4] ./h.js 9 bytes {2} {8} [built] + [7] ./async3.js 28 bytes {2} {3} [built] +chunk {3} 3.js 28 bytes <{8}> [rendered] + [7] ./async3.js 28 bytes {2} {3} [built] +chunk {4} 4.js 28 bytes <{7}> [rendered] + [6] ./async2.js 28 bytes {1} {4} [built] +chunk {5} 5.js 28 bytes <{6}> [rendered] + [5] ./async1.js 28 bytes {0} {5} [built] +chunk {6} e1.js (e1) 152 bytes >{1}< >{2}< >{5}< [entry] [rendered] + [0] ./b.js 9 bytes {6} {7} {8} [built] + [1] ./a.js 9 bytes {6} {7} {8} [built] + [2] ./d.js 9 bytes {0} {6} [built] + [8] ./e1.js 116 bytes {6} [built] + [9] ./c.js 9 bytes {6} [built] +chunk {7} e2.js (e2) 152 bytes >{0}< >{2}< >{4}< [entry] [rendered] + [0] ./b.js 9 bytes {6} {7} {8} [built] + [1] ./a.js 9 bytes {6} {7} {8} [built] + [3] ./f.js 9 bytes {1} {7} [built] + [10] ./e2.js 116 bytes {7} [built] + [11] ./e.js 9 bytes {7} [built] +chunk {8} e3.js (e3) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] + [0] ./b.js 9 bytes {6} {7} {8} [built] + [1] ./a.js 9 bytes {6} {7} {8} [built] + [4] ./h.js 9 bytes {2} {8} [built] + [12] ./e3.js 116 bytes {8} [built] + [13] ./g.js 9 bytes {8} [built]" +`; + +exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` +" Asset Size Chunks Chunk Names +async3.js 818 bytes 0 [emitted] async3 +async1.js 818 bytes 1 [emitted] async1 +async2.js 818 bytes 2 [emitted] async2 + e1.js 8.29 KiB 3 [emitted] e1 + e2.js 8.31 KiB 4 [emitted] e2 + e3.js 8.33 KiB 5 [emitted] e3 +Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +Entrypoint e3 = e3.js +chunk {0} async3.js (async3) 89 bytes <{2}> <{5}> >{1}< [rendered] + [4] ./h.js 9 bytes {0} {5} [built] + [7] ./async3.js 80 bytes {0} [built] +chunk {1} async1.js (async1) 89 bytes <{0}> <{3}> >{2}< [rendered] + [2] ./d.js 9 bytes {1} {3} [built] + [5] ./async1.js 80 bytes {1} [built] +chunk {2} async2.js (async2) 89 bytes <{1}> <{4}> >{0}< [rendered] + [3] ./f.js 9 bytes {2} {4} [built] + [6] ./async2.js 80 bytes {2} [built] +chunk {3} e1.js (e1) 144 bytes >{1}< [entry] [rendered] + [0] ./b.js 9 bytes {3} {4} {5} [built] + [1] ./a.js 9 bytes {3} {4} {5} [built] + [2] ./d.js 9 bytes {1} {3} [built] + [8] ./e1.js 108 bytes {3} [built] + [9] ./c.js 9 bytes {3} [built] +chunk {4} e2.js (e2) 144 bytes >{2}< [entry] [rendered] + [0] ./b.js 9 bytes {3} {4} {5} [built] + [1] ./a.js 9 bytes {3} {4} {5} [built] + [3] ./f.js 9 bytes {2} {4} [built] + [10] ./e2.js 108 bytes {4} [built] + [11] ./e.js 9 bytes {4} [built] +chunk {5} e3.js (e3) 144 bytes >{0}< [entry] [rendered] + [0] ./b.js 9 bytes {3} {4} {5} [built] + [1] ./a.js 9 bytes {3} {4} {5} [built] + [4] ./h.js 9 bytes {0} {5} [built] + [12] ./e3.js 108 bytes {5} [built] + [13] ./g.js 9 bytes {5} [built]" +`; + +exports[`StatsTestCases should print correct stats for module-trace-disabled-in-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 2.79 KiB 0 main +Entrypoint main = main.js +[0] ./index.js 25 bytes {0} [built] + +ERROR in ./index.js +Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-disabled-in-error'" +`; + +exports[`StatsTestCases should print correct stats for module-trace-enabled-in-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 2.79 KiB 0 main +Entrypoint main = main.js +[0] ./index.js 25 bytes {0} [built] + +ERROR in ./index.js +Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-enabled-in-error' + @ ./index.js 1:0-25" +`; + +exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = ` +"Child + Chunk Group main = main.js + Chunk Group async-a = async-a~async-b.js async-a.js + Chunk Group async-b = async-a~async-b.js async-b.js + Chunk Group async-c = vendors.js async-c.js + chunk {0} async-a~async-b.js (async-a~async-b) 133 bytes <{5}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) + > ./a [6] ./index.js 1:0-47 + > ./b [6] ./index.js 2:0-47 + [0] ./shared.js 133 bytes {0} [built] + chunk {1} async-a.js (async-a) 40 bytes <{5}> ={0}= [rendered] + > ./a [6] ./index.js 1:0-47 + [3] ./a.js 40 bytes {1} [built] + chunk {2} async-b.js (async-b) 40 bytes <{5}> ={0}= [rendered] + > ./b [6] ./index.js 2:0-47 + [4] ./b.js 40 bytes {2} [built] + chunk {3} async-c.js (async-c) 45 bytes <{5}> ={4}= [rendered] + > ./c [6] ./index.js 3:0-47 + [5] ./c.js 45 bytes {3} [built] + chunk {4} vendors.js (vendors) 40 bytes <{5}> ={3}= [rendered] split chunk (cache group: vendors) (name: vendors) + > ./c [6] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {4} [built] + [2] ./node_modules/y.js 20 bytes {4} [built] + chunk {5} main.js (main) 146 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [6] ./index.js 146 bytes {5} [built] +Child + Entrypoint main = main.js + Chunk Group async-a = async-a~async-b.js async-a.js + Chunk Group async-b = async-a~async-b.js async-b.js + Chunk Group async-c = vendors.js async-c.js + chunk {0} async-a~async-b.js (async-a~async-b) 133 bytes <{5}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) + > ./a [6] ./index.js 1:0-47 + > ./b [6] ./index.js 2:0-47 + [0] ./shared.js 133 bytes {0} [built] + chunk {1} async-a.js (async-a) 40 bytes <{5}> ={0}= [rendered] + > ./a [6] ./index.js 1:0-47 + [3] ./a.js 40 bytes {1} [built] + chunk {2} async-b.js (async-b) 40 bytes <{5}> ={0}= [rendered] + > ./b [6] ./index.js 2:0-47 + [4] ./b.js 40 bytes {2} [built] + chunk {3} async-c.js (async-c) 45 bytes <{5}> ={4}= [rendered] + > ./c [6] ./index.js 3:0-47 + [5] ./c.js 45 bytes {3} [built] + chunk {4} vendors.js (vendors) 40 bytes <{5}> ={3}= [rendered] split chunk (cache group: vendors) (name: vendors) + > ./c [6] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {4} [built] + [2] ./node_modules/y.js 20 bytes {4} [built] + chunk {5} main.js (main) 146 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [6] ./index.js 146 bytes {5} [built]" +`; + +exports[`StatsTestCases should print correct stats for named-chunks-plugin 1`] = ` +"Hash: 4d266c3680a506e31e7e +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + entry.js 5.47 KiB entry [emitted] entry +vendor.js 269 bytes vendor [emitted] vendor +Entrypoint entry = vendor.js entry.js +[./entry.js] 72 bytes {entry} [built] +[./modules/a.js] 22 bytes {vendor} [built] +[./modules/b.js] 22 bytes {vendor} [built] +[./modules/c.js] 22 bytes {entry} [built]" +`; + +exports[`StatsTestCases should print correct stats for named-chunks-plugin-async 1`] = ` +"Hash: b54cb3a3bc63561b46b3 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +chunk-containing-__a_js.js 509 bytes chunk-containing-__a_js [emitted] +chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted] + entry.js 7.55 KiB entry [emitted] entry +Entrypoint entry = entry.js +[0] ./modules/b.js 22 bytes {chunk-containing-__b_js} [built] +[1] ./modules/a.js 37 bytes {chunk-containing-__a_js} [built] +[2] ./entry.js 47 bytes {entry} [built]" +`; + +exports[`StatsTestCases should print correct stats for no-emit-on-errors-plugin-with-child-error 1`] = ` +"Hash: 6c219bd2ffa7d0ba8efb +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + child.js 2.61 KiB +bundle.js 2.61 KiB 0 main +Entrypoint main = bundle.js +[0] ./index.js 0 bytes {0} [built] + +WARNING in configuration +The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. +You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ +Child child: + Asset Size Chunks Chunk Names + child.js 2.61 KiB 0 child + Entrypoint child = child.js + [0] ./index.js 0 bytes {0} [built] + + ERROR in forced error" +`; + +exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` +"Hash: 5d3814f1fdaba61ed71c +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + cir1.js 299 bytes 0 [emitted] cir1 + ab.js 183 bytes 1 [emitted] ab + abd.js 277 bytes 2, 1 [emitted] abd + cir2.js 299 bytes 3 [emitted] cir2 + main.js 8.07 KiB 4 [emitted] main +cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 + chunk.js 190 bytes 6, 7 [emitted] chunk + ac in ab.js 130 bytes 7 [emitted] ac in ab +Entrypoint main = main.js +chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> <{5}> >{5}< [rendered] + > [3] ./circular2.js 1:0-79 + > [3] ./circular2.js 1:0-79 + > [8] ./index.js 13:0-54 + [2] ./circular1.js 81 bytes {0} [built] +chunk {1} ab.js (ab) 0 bytes <{4}> >{7}< [rendered] + > [8] ./index.js 1:0-6:8 + [0] ./modules/a.js 0 bytes {1} {2} [built] + [1] ./modules/b.js 0 bytes {1} {2} [built] +chunk {2} abd.js (abd) 0 bytes <{4}> >{6}< [rendered] + > [8] ./index.js 8:0-11:9 + [0] ./modules/a.js 0 bytes {1} {2} [built] + [1] ./modules/b.js 0 bytes {1} {2} [built] + [6] ./modules/d.js 0 bytes {2} {6} [built] +chunk {3} cir2.js (cir2) 81 bytes <{4}> >{0}< [rendered] + > [8] ./index.js 14:0-54 + [3] ./circular2.js 81 bytes {3} {5} [built] +chunk {4} main.js (main) 523 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] + > ./index main + [4] ./modules/f.js 0 bytes {4} [built] + [8] ./index.js 523 bytes {4} [built] +chunk {5} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> >{0}< [rendered] + > [2] ./circular1.js 1:0-79 + > [2] ./circular1.js 1:0-79 + [3] ./circular2.js 81 bytes {3} {5} [built] + [7] ./modules/e.js 0 bytes {5} [built] +chunk {6} chunk.js (chunk) 0 bytes <{2}> <{7}> [rendered] + > [8] ./index.js 3:2-4:13 + > [8] ./index.js 9:1-10:12 + [5] ./modules/c.js 0 bytes {6} {7} [built] + [6] ./modules/d.js 0 bytes {2} {6} [built] +chunk {7} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] + > [8] ./index.js 2:1-5:15 + [5] ./modules/c.js 0 bytes {6} {7} [built]" +`; + +exports[`StatsTestCases should print correct stats for parse-error 1`] = ` +" Asset Size Chunks Chunk Names +main.js 3.05 KiB 0 main +Entrypoint main = main.js +[0] ./b.js 169 bytes {0} [built] [failed] [1 error] +[1] ./index.js + 1 modules 35 bytes {0} [built] + | ./index.js 15 bytes [built] + | ./a.js 15 bytes [built] + +ERROR in ./b.js +Module parse failed: Unexpected token (6:7) +You may need an appropriate loader to handle this file type. +| includes +| a +| parser ) +| error +| in + @ ./a.js 2:0-13 + @ ./index.js" +`; + +exports[`StatsTestCases should print correct stats for performance-different-mode-and-target 1`] = ` +"Hash: 36ef9589e3f3c206907d131fd32b3ce1bbf1fb07e0ec393717b117b253ba7bd80de90c69fbe1699ff5afc47fa7eaf1e7303afe2ff2a34c467b43c85c513ab90423c98ca17f51 +Child + Hash: 36ef9589e3f3c206907d + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + warning.pro-web.js 296 KiB 0 [emitted] [big] main + Entrypoint main [big] = warning.pro-web.js + [0] ./index.js 293 KiB {0} [built] + + WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). + This can impact web performance. + Assets: + warning.pro-web.js (296 KiB) + + WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. + Entrypoints: + main (296 KiB) + warning.pro-web.js + + + WARNING in webpack performance recommendations: + You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. + For more info visit https://webpack.js.org/guides/code-splitting/ +Child + Hash: 131fd32b3ce1bbf1fb07 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + warning.pro-webworker.js 296 KiB 0 [emitted] [big] main + Entrypoint main [big] = warning.pro-webworker.js + [0] ./index.js 293 KiB {0} [built] + + WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). + This can impact web performance. + Assets: + warning.pro-webworker.js (296 KiB) + + WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. + Entrypoints: + main (296 KiB) + warning.pro-webworker.js + + + WARNING in webpack performance recommendations: + You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. + For more info visit https://webpack.js.org/guides/code-splitting/ +Child + Hash: e0ec393717b117b253ba + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.pro-node.js 296 KiB 0 [emitted] main + Entrypoint main = no-warning.pro-node.js + [0] ./index.js 293 KiB {0} [built] +Child + Hash: 7bd80de90c69fbe1699f + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.dev-web.js 1.72 MiB main [emitted] main + Entrypoint main = no-warning.dev-web.js + [./index.js] 293 KiB {main} [built] +Child + Hash: f5afc47fa7eaf1e7303a + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.dev-node.js 1.72 MiB main [emitted] main + Entrypoint main = no-warning.dev-node.js + [./index.js] 293 KiB {main} [built] +Child + Hash: fe2ff2a34c467b43c85c + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.dev-web-with-limit-set.js 1.72 MiB main [emitted] [big] main + Entrypoint main [big] = no-warning.dev-web-with-limit-set.js + [./index.js] 293 KiB {main} [built] +Child + Hash: 513ab90423c98ca17f51 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + warning.pro-node-with-hints-set.js 296 KiB 0 [emitted] [big] main + Entrypoint main [big] = warning.pro-node-with-hints-set.js + [0] ./index.js 293 KiB {0} [built] + + WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). + This can impact web performance. + Assets: + warning.pro-node-with-hints-set.js (296 KiB) + + WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. + Entrypoints: + main (296 KiB) + warning.pro-node-with-hints-set.js + + + WARNING in webpack performance recommendations: + You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. + For more info visit https://webpack.js.org/guides/code-splitting/" +`; + +exports[`StatsTestCases should print correct stats for performance-disabled 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 300 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built]" +`; + +exports[`StatsTestCases should print correct stats for performance-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 300 KiB 2 [emitted] [big] main + 3.js 227 bytes 3 [emitted] +Entrypoint main [big] = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built] + +ERROR in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (300 KiB) + +ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (300 KiB) + main.js +" +`; + +exports[`StatsTestCases should print correct stats for performance-no-async-chunks-shown 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 296 KiB 0 [emitted] [big] main + sec.js 2.95 KiB 1 [emitted] sec +Entrypoint main [big] = main.js +Entrypoint sec = sec.js +[0] ./b.js 22 bytes {0} {1} [built] +[1] ./index.js 32 bytes {0} [built] +[2] ./a.js 293 KiB {0} [built] +[3] ./index2.js 48 bytes {1} [built] +[4] ./c.js 22 bytes {1} [built] +[5] ./d.js 22 bytes {1} [built] + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (296 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (296 KiB) + main.js + + +WARNING in webpack performance recommendations: +You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. +For more info visit https://webpack.js.org/guides/code-splitting/" +`; + +exports[`StatsTestCases should print correct stats for performance-no-hints 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 300 KiB 2 [emitted] [big] main + 3.js 227 bytes 3 [emitted] +Entrypoint main [big] = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built]" +`; + +exports[`StatsTestCases should print correct stats for performance-oversize-limit-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 296 KiB 0 [emitted] [big] main + sec.js 296 KiB 1 [emitted] [big] sec +Entrypoint main [big] = main.js +Entrypoint sec [big] = sec.js +[0] ./a.js 293 KiB {0} {1} [built] +[1] ./index.js 16 bytes {0} [built] +[2] ./index2.js 16 bytes {1} [built] + +ERROR in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (296 KiB) + sec.js (296 KiB) + +ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (296 KiB) + main.js + sec (296 KiB) + sec.js + + +ERROR in webpack performance recommendations: +You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. +For more info visit https://webpack.js.org/guides/code-splitting/" +`; + +exports[`StatsTestCases should print correct stats for prefetch 1`] = ` +" Asset Size Chunks Chunk Names + prefetched.js 1.03 KiB 0 [emitted] prefetched + normal.js 130 bytes 1 [emitted] normal +prefetched2.js 127 bytes 2 [emitted] prefetched2 +prefetched3.js 130 bytes 3 [emitted] prefetched3 + main.js 9.69 KiB 4 [emitted] main + inner.js 136 bytes 5 [emitted] inner + inner2.js 201 bytes 6 [emitted] inner2 +Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js) +chunk {0} prefetched.js (prefetched) 228 bytes <{4}> >{5}< >{6}< (prefetch: {6} {5}) [rendered] +chunk {1} normal.js (normal) 0 bytes <{4}> [rendered] +chunk {2} prefetched2.js (prefetched2) 0 bytes <{4}> [rendered] +chunk {3} prefetched3.js (prefetched3) 0 bytes <{4}> [rendered] +chunk {4} main.js (main) 436 bytes >{0}< >{1}< >{2}< >{3}< (prefetch: {2} {0} {3}) [entry] [rendered] +chunk {5} inner.js (inner) 0 bytes <{0}> [rendered] +chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered]" +`; + +exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` +"chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {9} {10}) [rendered] +chunk {1} b.js (b) 203 bytes <{3}> >{6}< >{7}< >{8}< (prefetch: {6} {8}) (preload: {7}) [rendered] +chunk {2} c.js (c) 134 bytes <{3}> >{4}< >{5}< (preload: {4} {5}) [rendered] +chunk {3} main.js (main) 195 bytes >{0}< >{1}< >{2}< (prefetch: {0} {1} {2}) [entry] [rendered] +chunk {4} c1.js (c1) 0 bytes <{2}> [rendered] +chunk {5} c2.js (c2) 0 bytes <{2}> [rendered] +chunk {6} b1.js (b1) 0 bytes <{1}> [rendered] +chunk {7} b2.js (b2) 0 bytes <{1}> [rendered] +chunk {8} b3.js (b3) 0 bytes <{1}> [rendered] +chunk {9} a1.js (a1) 0 bytes <{0}> [rendered] +chunk {10} a2.js (a2) 0 bytes <{0}> [rendered]" +`; + +exports[`StatsTestCases should print correct stats for preload 1`] = ` +" Asset Size Chunks Chunk Names + preloaded.js 1.03 KiB 0 [emitted] preloaded + normal.js 130 bytes 1 [emitted] normal +preloaded2.js 127 bytes 2 [emitted] preloaded2 +preloaded3.js 130 bytes 3 [emitted] preloaded3 + main.js 9.81 KiB 4 [emitted] main + inner.js 136 bytes 5 [emitted] inner + inner2.js 201 bytes 6 [emitted] inner2 +Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) +chunk {0} preloaded.js (preloaded) 226 bytes <{4}> >{5}< >{6}< (preload: {6} {5}) [rendered] +chunk {1} normal.js (normal) 0 bytes <{4}> [rendered] +chunk {2} preloaded2.js (preloaded2) 0 bytes <{4}> [rendered] +chunk {3} preloaded3.js (preloaded3) 0 bytes <{4}> [rendered] +chunk {4} main.js (main) 424 bytes >{0}< >{1}< >{2}< >{3}< (preload: {2} {0} {3}) [entry] [rendered] +chunk {5} inner.js (inner) 0 bytes <{0}> [rendered] +chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered]" +`; + +exports[`StatsTestCases should print correct stats for preset-detailed 1`] = ` +"Hash: 8abc26856f4ca9b61679 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 7.28 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +chunk {0} 0.js 22 bytes <{2}> [rendered] + > ./b [4] ./index.js 2:0-16 +chunk {1} 1.js 54 bytes <{2}> >{3}< [rendered] + > ./c [4] ./index.js 3:0-16 +chunk {2} main.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main +chunk {3} 3.js 44 bytes <{1}> [rendered] + > [3] ./c.js 1:0-52 +[0] ./d.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[1] ./e.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[2] ./b.js 22 bytes {0} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[3] ./c.js 54 bytes {1} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[4] ./index.js 51 bytes {2} [depth 0] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[5] ./a.js 22 bytes {2} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module" +`; + +exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-errors-only-error 1`] = ` +" +ERROR in ./index.js +Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/preset-errors-only-error' + @ ./index.js 1:0-25" +`; + +exports[`StatsTestCases should print correct stats for preset-minimal 1`] = `" 6 modules"`; + +exports[`StatsTestCases should print correct stats for preset-minimal-simple 1`] = `" 1 module"`; + +exports[`StatsTestCases should print correct stats for preset-mixed-array 1`] = ` +"Child minimal: + 1 module +Child verbose: + Entrypoint main = main.js + [0] ./index.js 8 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for preset-none 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-none-array 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-none-error 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-normal 1`] = ` +"Hash: 8abc26856f4ca9b61679 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 7.28 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 51 bytes {2} [built] +[5] ./a.js 22 bytes {2} [built]" +`; + +exports[`StatsTestCases should print correct stats for preset-normal-performance 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 300 KiB 2 [emitted] [big] main + 3.js 227 bytes 3 [emitted] +Entrypoint main [big] = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built] + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (300 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (300 KiB) + main.js +" +`; + +exports[`StatsTestCases should print correct stats for preset-normal-performance-ensure-filter-sourcemaps 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 182 bytes 0 [emitted] + 1.js 319 bytes 1 [emitted] + main.js 300 KiB 2 [emitted] [big] main + 3.js 257 bytes 3 [emitted] + 0.js.map 156 bytes 0 [emitted] + 1.js.map 197 bytes 1 [emitted] +main.js.map 1.72 MiB 2 [emitted] main + 3.js.map 214 bytes 3 [emitted] +Entrypoint main [big] = main.js main.js.map +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built] + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (300 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (300 KiB) + main.js +" +`; + +exports[`StatsTestCases should print correct stats for preset-verbose 1`] = ` +"Hash: 8abc26856f4ca9b61679 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 7.28 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +chunk {0} 0.js 22 bytes <{2}> [rendered] + > ./b [4] ./index.js 2:0-16 + [2] ./b.js 22 bytes {0} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + amd require ./b [4] ./index.js 2:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {1} 1.js 54 bytes <{2}> >{3}< [rendered] + > ./c [4] ./index.js 3:0-16 + [3] ./c.js 54 bytes {1} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + amd require ./c [4] ./index.js 3:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {2} main.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main + [4] ./index.js 51 bytes {2} [depth 0] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + single entry ./index main + factory:Xms building:Xms = Xms + [5] ./a.js 22 bytes {2} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + cjs require ./a [4] ./index.js 1:0-14 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {3} 3.js 44 bytes <{1}> [rendered] + > [3] ./c.js 1:0-52 + [0] ./d.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + require.ensure item ./d [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms + [1] ./e.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + require.ensure item ./e [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for resolve-plugin-context 1`] = ` +"Hash: 11a1659e0148f10e3a15 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 3.01 KiB 0 [emitted] main +Entrypoint main = bundle.js +[0] ./node_modules/xyz/index.js 0 bytes {0} [built] +[1] ./index.js 48 bytes {0} [built] +[2] ./node_modules/abc/index.js 16 bytes {0} [built] +[3] ./node_modules/def/index.js 16 bytes {0} [built] +[4] ./node_modules/def/node_modules/xyz/index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for reverse-sort-modules 1`] = ` +"Hash: 528955f6d280625ce14d +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 5.85 KiB 0 [emitted] main +Entrypoint main = main.js +[29] ./c.js?10 33 bytes {0} [built] +[27] ./c.js?9 33 bytes {0} [built] +[25] ./c.js?8 33 bytes {0} [built] +[23] ./c.js?7 33 bytes {0} [built] +[19] ./c.js?5 33 bytes {0} [built] +[17] ./c.js?4 33 bytes {0} [built] +[15] ./c.js?3 33 bytes {0} [built] +[13] ./c.js?2 33 bytes {0} [built] +[11] ./c.js?1 33 bytes {0} [built] +[10] ./index.js 181 bytes {0} [built] + [9] ./a.js?10 33 bytes {0} [built] + [8] ./a.js?9 33 bytes {0} [built] + [7] ./a.js?8 33 bytes {0} [built] + [6] ./a.js?7 33 bytes {0} [built] + [5] ./a.js?6 33 bytes {0} [built] + [4] ./a.js?5 33 bytes {0} [built] + [3] ./a.js?4 33 bytes {0} [built] + [2] ./a.js?3 33 bytes {0} [built] + [1] ./a.js?2 33 bytes {0} [built] + [0] ./a.js?1 33 bytes {0} [built] + + 11 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk 1`] = ` +"Entrypoint e1 = runtime~e1.js e1.js +Entrypoint e2 = runtime~e2.js e2.js" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk-integration 1`] = ` +"Child base: + Asset Size Chunks Chunk Names + 0.js 719 bytes 0 [emitted] + main1.js 542 bytes 1 [emitted] main1 + runtime.js 7.73 KiB 2 [emitted] runtime + Entrypoint main1 = runtime.js main1.js + [0] ./b.js 20 bytes {0} [built] + [1] ./c.js 20 bytes {0} [built] + [2] ./d.js 20 bytes {0} [built] + [3] ./main1.js 66 bytes {1} [built] +Child manifest is named entry: + Asset Size Chunks Chunk Names + 0.js 719 bytes 0 [emitted] + manifest.js 8.04 KiB 1 [emitted] manifest + main1.js 542 bytes 2 [emitted] main1 + Entrypoint main1 = manifest.js main1.js + Entrypoint manifest = manifest.js + [0] ./b.js 20 bytes {0} [built] + [1] ./c.js 20 bytes {0} [built] + [2] ./d.js 20 bytes {0} [built] + [3] ./main1.js 66 bytes {2} [built] + [4] ./f.js 20 bytes {1} [built]" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk-single 1`] = ` +"Entrypoint e1 = runtime.js e1.js +Entrypoint e2 = runtime.js e2.js" +`; + +exports[`StatsTestCases should print correct stats for scope-hoisting-bailouts 1`] = ` +"Hash: 6c000e1efebf892a7639 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT +Entrypoint index = index.js +Entrypoint entry = entry.js +[0] ./entry.js 32 bytes {1} {2} [built] + ModuleConcatenation bailout: Module is an entry point +[1] ./ref-from-cjs.js 45 bytes {1} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./cjs.js (referenced with cjs require) +[2] external \\"external\\" 42 bytes {1} [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[3] ./concatenated.js + 2 modules 116 bytes {0} [built] + ModuleConcatenation bailout: Cannot concat with external \\"external\\" (<- Module is not an ECMAScript module) + | ./concatenated.js 26 bytes [built] + | ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./index.js (referenced with import()) + | ./concatenated1.js 37 bytes [built] + | ./concatenated2.js 48 bytes [built] +[4] ./index.js 176 bytes {1} [built] + ModuleConcatenation bailout: Module is an entry point +[5] ./cjs.js 59 bytes {1} [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[6] ./eval.js 35 bytes {1} [built] + ModuleConcatenation bailout: Module uses eval() +[7] ./injected-vars.js 40 bytes {1} [built] + ModuleConcatenation bailout: Module uses injected variables (__dirname, __filename) +[8] ./module-id.js 26 bytes {1} [built] + ModuleConcatenation bailout: Module uses module.id +[9] ./module-loaded.js 30 bytes {1} [built] + ModuleConcatenation bailout: Module uses module.loaded" +`; + +exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` +"Hash: 3354b6776c2bb6b558f4c9101316bd6316bf5251 +Child + Hash: 3354b6776c2bb6b558f4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Entrypoint first = vendor.js first.js + Entrypoint second = vendor.js second.js + [0] ./common_lazy_shared.js 25 bytes {0} {1} {2} [built] + [1] ./common2.js 25 bytes {4} {5} [built] + [2] ./common_lazy.js 25 bytes {1} {2} [built] + [3] ./common.js 37 bytes {4} {5} [built] + [4] ./lazy_shared.js 31 bytes {0} [built] + [5] ./vendor.js 25 bytes {3} [built] + [6] ./lazy_first.js 55 bytes {2} [built] + [7] ./lazy_second.js 55 bytes {1} [built] + [8] ./first.js 207 bytes {4} [built] + [9] ./module_first.js 31 bytes {4} [built] + [10] ./second.js 177 bytes {5} [built] +Child + Hash: c9101316bd6316bf5251 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Entrypoint first = vendor.js first.js + Entrypoint second = vendor.js second.js + [0] ./common_lazy_shared.js 25 bytes {0} {1} {2} [built] + [1] ./common_lazy.js 25 bytes {1} {2} [built] + [2] ./common.js + 1 modules 62 bytes {4} {5} [built] + | ./common.js 37 bytes [built] + | ./common2.js 25 bytes [built] + [3] ./vendor.js 25 bytes {3} [built] + [4] ./lazy_shared.js 31 bytes {0} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()), ./second.js (referenced with import()) + [5] ./lazy_second.js 55 bytes {1} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./second.js (referenced with import()) + [6] ./second.js 177 bytes {5} [built] + ModuleConcatenation bailout: Module is an entry point + [7] ./first.js + 1 modules 248 bytes {4} [built] + ModuleConcatenation bailout: Cannot concat with ./common.js + ModuleConcatenation bailout: Cannot concat with ./vendor.js + | ./first.js 207 bytes [built] + | ModuleConcatenation bailout: Module is an entry point + | ./module_first.js 31 bytes [built] + [8] ./lazy_first.js 55 bytes {2} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import())" +`; + +exports[`StatsTestCases should print correct stats for simple 1`] = ` +"Hash: 1843cc9aed8366594774 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 2.78 KiB main [emitted] main +Entrypoint main = bundle.js +[./index.js] 0 bytes {main} [built]" +`; + +exports[`StatsTestCases should print correct stats for simple-more-info 1`] = ` +"Hash: c4097b5edb272ec4b73c +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 2.61 KiB 0 [emitted] main +Entrypoint main = bundle.js +[0] ./index.js 0 bytes {0} [built] + single entry ./index main + factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` +"Child default: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/b.js + Entrypoint c = default/c.js + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {4} [built] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + > ./a [8] ./index.js 1:0-47 + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [5] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + > ./c [8] ./index.js 3:0-47 + [6] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) + > ./c [8] ./index.js 3:0-47 + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [5] ./b.js 72 bytes {6} {11} [built] + chunk {12} default/c.js (c) 152 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + [6] ./c.js 72 bytes {7} {12} [built] +Child all-chunks: + Entrypoint main = default/main.js + Entrypoint a = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a.js + Entrypoint b = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/b.js + Entrypoint c = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js + chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built] +Child manual: + Entrypoint main = default/main.js + Entrypoint a = default/vendors.js default/a.js + Entrypoint b = default/vendors.js default/b.js + Entrypoint c = default/vendors.js default/c.js + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + [3] ./node_modules/y.js 20 bytes {0} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [10] multi x y z 52 bytes {0} [built] + chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [9] ./g.js 34 bytes {1} [built] + chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} default/a.js (a) 176 bytes ={0}= >{1}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built] +Child name-too-long: + Entrypoint main = main.js + Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js + Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js + Entrypoint cccccccccccccccccccccccccccccc = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~async-c~cccccccccccccccccccccccccccccc.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js cccccccccccccccccccccccccccccc.js + chunk {0} vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js (vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={7}= ={8}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + > ./a [7] ./index.js 1:0-47 + > ./b [7] ./index.js 2:0-47 + > ./c [7] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={7}= ={8}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: default) (name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + > ./a [7] ./index.js 1:0-47 + > ./b [7] ./index.js 2:0-47 + > ./c [7] ./index.js 3:0-47 + [1] ./d.js 20 bytes {1} [built] + chunk {2} async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js (async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={11}= ={12}= ={3}= ={4}= ={6}= ={7}= ={8}= [initial] [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + > ./b [7] ./index.js 2:0-47 + > ./c [7] ./index.js 3:0-47 + [0] ./f.js 20 bytes {2} [built] + chunk {3} vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={7}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./a [7] ./index.js 1:0-47 + > ./b [7] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} vendors~async-c~cccccccccccccccccccccccccccccc.js (vendors~async-c~cccccccccccccccccccccccccccccc) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~cccccccccccccccccccccccccccccc) + > ./c cccccccccccccccccccccccccccccc + > ./c [7] ./index.js 3:0-47 + [6] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a) 156 bytes <{9}> ={0}= ={1}= ={10}= ={3}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: default) (name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./a [7] ./index.js 1:0-47 + [8] ./a.js + 1 modules 156 bytes {5} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {6} [built] + chunk {7} async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [7] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [7] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{7}< >{8}< [entry] [rendered] + > ./ main + [7] ./index.js 147 bytes {9} [built] + chunk {10} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 0 bytes ={0}= ={1}= ={3}= ={5}= >{2}< >{6}< [entry] [rendered] + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + chunk {11} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 72 bytes ={0}= ={1}= ={2}= ={3}= [entry] [rendered] + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 72 bytes ={0}= ={1}= ={2}= ={4}= [entry] [rendered] + > ./c cccccccccccccccccccccccccccccc + [5] ./c.js 72 bytes {8} {12} [built] +Child custom-chunks-filter: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-a~async-b~b.js default/b.js + Entrypoint c = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js + chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c~b~c) + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} {10} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~b) + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} [built] + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [2] ./node_modules/x.js 20 bytes {0} {10} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built] +Child custom-chunks-filter-in-cache-groups: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/vendors.js default/b.js + Entrypoint c = default/vendors.js default/c.js + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} {6} [built] + [3] ./node_modules/y.js 20 bytes {0} {6} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [10] multi x y z 52 bytes {0} [built] + chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [9] ./g.js 34 bytes {1} [built] + chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} default/a.js (a) 216 bytes >{1}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [2] ./node_modules/x.js 20 bytes {0} {6} [built] + [3] ./node_modules/y.js 20 bytes {0} {6} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` +"Entrypoint main = main.js +chunk {0} async-a~async-b.js (async-a~async-b) 134 bytes <{8}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) + > ./a [9] ./index.js 1:0-47 + > ./b [9] ./index.js 2:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [1] ./y.js 67 bytes {0} [built] +chunk {1} async-a.js (async-a) 48 bytes <{8}> ={0}= [rendered] + > ./a [9] ./index.js 1:0-47 + [2] ./a.js 48 bytes {1} [built] +chunk {2} async-b.js (async-b) 48 bytes <{8}> ={0}= [rendered] + > ./b [9] ./index.js 2:0-47 + [3] ./b.js 48 bytes {2} [built] +chunk {3} async-c.js (async-c) 101 bytes <{8}> [rendered] + > ./c [9] ./index.js 3:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [4] ./c.js 34 bytes {3} [built] +chunk {4} async-d.js (async-d) 101 bytes <{8}> [rendered] + > ./d [9] ./index.js 4:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [5] ./d.js 34 bytes {4} [built] +chunk {5} async-e.js (async-e) 101 bytes <{8}> [rendered] + > ./e [9] ./index.js 5:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [6] ./e.js 34 bytes {5} [built] +chunk {6} async-f.js (async-f) 101 bytes <{8}> [rendered] + > ./f [9] ./index.js 6:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [7] ./f.js 34 bytes {6} [built] +chunk {7} async-g.js (async-g) 101 bytes <{8}> [rendered] + > ./g [9] ./index.js 7:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [8] ./g.js 34 bytes {7} [built] +chunk {8} main.js (main) 343 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] + > ./ main + [9] ./index.js 343 bytes {8} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = ` +"Entrypoint main = main.js +chunk {0} vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{5}> ={1}= ={2}= ={3}= ={4}= [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + > ./a [5] ./index.js 1:0-47 + > ./b [5] ./index.js 2:0-47 + > ./c [5] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {0} [built] +chunk {1} async-a~async-b~async-c.js (async-a~async-b~async-c) 11 bytes <{5}> ={0}= ={2}= ={3}= ={4}= [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [5] ./index.js 1:0-47 + > ./b [5] ./index.js 2:0-47 + > ./c [5] ./index.js 3:0-47 + [0] ./common.js 11 bytes {1} [built] +chunk {2} async-a.js (async-a) 19 bytes <{5}> ={0}= ={1}= [rendered] + > ./a [5] ./index.js 1:0-47 + [2] ./a.js 19 bytes {2} [built] +chunk {3} async-b.js (async-b) 19 bytes <{5}> ={0}= ={1}= [rendered] + > ./b [5] ./index.js 2:0-47 + [3] ./b.js 19 bytes {3} [built] +chunk {4} async-c.js (async-c) 19 bytes <{5}> ={0}= ={1}= [rendered] + > ./c [5] ./index.js 3:0-47 + [4] ./c.js 19 bytes {4} [built] +chunk {5} main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [5] ./index.js 147 bytes {5} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = ` +"Entrypoint main = vendors.js main.js +chunk {0} async-a.js (async-a) 32 bytes <{2}> <{3}> [rendered] + > ./a [3] ./index.js 2:0-47 + [0] ./node_modules/x.js 20 bytes {0} {1} [built] + [1] ./a.js 12 bytes {0} [built] +chunk {1} async-b.js (async-b) 32 bytes <{2}> <{3}> [rendered] + > ./b [3] ./index.js 3:0-47 + [0] ./node_modules/x.js 20 bytes {0} {1} [built] + [2] ./b.js 12 bytes {1} [built] +chunk {2} main.js (main) 110 bytes ={3}= >{0}< >{1}< [entry] [rendered] + > ./ main + [3] ./index.js 110 bytes {2} [built] +chunk {3} vendors.js (vendors) 20 bytes ={2}= >{0}< >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./ main + [4] ./node_modules/y.js 20 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-prefer-bigger-splits 1`] = ` +"Entrypoint main = default/main.js +chunk {0} default/async-b~async-c.js (async-b~async-c) 110 bytes <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) (name: async-b~async-c) + > ./b [6] ./index.js 2:0-47 + > ./c [6] ./index.js 3:0-47 + [0] ./d.js 43 bytes {0} {1} [built] + [2] ./f.js 67 bytes {0} [built] +chunk {1} default/async-a.js (async-a) 134 bytes <{4}> [rendered] + > ./a [6] ./index.js 1:0-47 + [0] ./d.js 43 bytes {0} {1} [built] + [1] ./e.js 43 bytes {1} {2} [built] + [3] ./a.js 48 bytes {1} [built] +chunk {2} default/async-b.js (async-b) 105 bytes <{4}> ={0}= [rendered] + > ./b [6] ./index.js 2:0-47 + [1] ./e.js 43 bytes {1} {2} [built] + [4] ./b.js 62 bytes {2} [built] +chunk {3} default/async-c.js (async-c) 48 bytes <{4}> ={0}= [rendered] + > ./c [6] ./index.js 3:0-47 + [5] ./c.js 48 bytes {3} [built] +chunk {4} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [6] ./index.js 147 bytes {4} [built]" +`; + +exports[`StatsTestCases should print correct stats for tree-shaking 1`] = ` +"Hash: 9470b99b4586c4006572 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 7.27 KiB 0 [emitted] main +Entrypoint main = bundle.js + [0] ./a.js 13 bytes {0} [built] + [exports: a] + [all exports used] + [1] ./b.js 13 bytes {0} [built] + [exports: b] + [no exports used] + [2] ./unknown.js 0 bytes {0} [built] + [only some exports used: c] + [3] ./unknown2.js 0 bytes {0} [built] + [only some exports used: y] + [4] ./index.js 315 bytes {0} [built] + [no exports] + [5] ./require.include.js 36 bytes {0} [built] + [exports: a, default] + [no exports used] + [6] ./reexport-known.js 49 bytes {0} [built] + [exports: a, b] + [only some exports used: a] + [7] ./reexport-star-known.js 41 bytes {0} [built] + [exports: a, b] + [only some exports used: a] + [8] ./edge.js 45 bytes {0} [built] + [only some exports used: y] + [9] ./reexport-unknown.js 83 bytes {0} [built] + [exports: a, b, c, d] + [only some exports used: a, c] +[10] ./reexport-star-unknown.js 68 bytes {0} [built] + [only some exports used: a, c]" +`; + +exports[`StatsTestCases should print correct stats for warnings-uglifyjs 1`] = ` +"Hash: c0402129c5c14a0d4a19 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 2.19 KiB 0 [emitted] main +Entrypoint main = bundle.js +[0] ./index.js 299 bytes {0} [built] +[1] ./a.js 249 bytes {0} [built] +[2] (webpack)/buildin/module.js 497 bytes {0} [built] + +WARNING in bundle.js from UglifyJs +Dropping unused function someUnRemoteUsedFunction1 [./a.js:3,0] +Dropping unused function someUnRemoteUsedFunction2 [./a.js:4,0] +Dropping unused function someUnRemoteUsedFunction3 [./a.js:5,0] +Dropping unused function someUnRemoteUsedFunction4 [./a.js:6,0] +Dropping unused function someUnRemoteUsedFunction5 [./a.js:7,0]" +`; diff --git a/test/browsertest/lib/index.web.js b/test/browsertest/lib/index.web.js index fe9a593ac..f8f83fe5a 100644 --- a/test/browsertest/lib/index.web.js +++ b/test/browsertest/lib/index.web.js @@ -9,27 +9,24 @@ require("script-loader!../js/library1.js"); require("./stylesheet.css"); require("./stylesheet.less"); -var should = require("should"); -if(!should.exist) should.exist = function(x) { should.strictEqual(x === undefined, false); should.strictEqual(x === null, false); } - describe("main", function() { it("should load library1 with script-loader", function() { - should.exist(window.library1); - window.library1.should.be.eql(true); + expect(window.library1).toEqual(expect.anything()); + expect(window.library1).toBe(true); }); it("should load library2 exported as global", function() { - should.exist(window.library2common); - should.exist(window.library2common.ok2); - window.library2common.ok2.should.be.eql(true); - should.exist(window.library2); - should.exist(window.library2.ok); - window.library2.ok.should.be.eql(true); + expect(window.library2common).toEqual(expect.anything()); + expect(window.library2common.ok2).toEqual(expect.anything()); + expect(window.library2common.ok2).toBe(true); + expect(window.library2).toEqual(expect.anything()); + expect(window.library2.ok).toEqual(expect.anything()); + expect(window.library2.ok).toBe(true); }); describe("web resolving", function() { it("should load index.web.js instead of index.js", function() { - true.should.be.eql(true); + expect(true).toBe(true); }); it("should load correct replacements for files", function(done) { @@ -43,8 +40,8 @@ describe("main", function() { }); after(function() { - should.exist(exports.ok); - exports.ok.should.be.eql(true); + expect(exports.ok).toEqual(expect.anything()); + expect(exports.ok).toBe(true); }); }); @@ -52,8 +49,8 @@ describe("main", function() { it("should have support for require.main", function() { var value = require.main === module; var otherModuleValue = require("./testRequireMain"); - value.should.be.eql(true); - otherModuleValue.should.be.eql(false); + expect(value).toBe(true); + expect(otherModuleValue).toBe(false); }); }); @@ -65,12 +62,12 @@ describe("main", function() { }); it("should polyfill process and module", function(done) { - module.id.should.have.type("number"); + expect(typeof module.id).toBe("number"); require.ensure([], function(require) { test(Array.isArray(process.argv), "process.argv should be an array"); process.nextTick(function() { sum2++; - sum2.should.be.eql(2); + expect(sum2).toBe(2); done(); }); sum2++; @@ -81,7 +78,7 @@ describe("main", function() { describe("web loaders", function() { it("should handle the file loader correctly", function() { - require("!file-loader!../img/image.png").should.match(/js\/.+\.png$/); + expect(require("!file-loader!../img/image.png")).toMatch(/js\/.+\.png$/); document.getElementById("image").src = require("file-loader?prefix=img/!../img/image.png"); }); }); @@ -93,10 +90,10 @@ describe("main", function() { import("./three").then(function() { done(new Error("Chunk shouldn't be loaded")); }).catch(function(err) { - err.should.be.instanceOf(Error); + expect(err).toBeInstanceOf(Error); __webpack_public_path__ = old; import("./three").then(function(three) { - three.should.be.eql(3); + expect(three).toBe(3); done(); }).catch(function(err) { done(new Error("Shouldn't result in an chunk loading error")); diff --git a/test/browsertest/library2config.coffee b/test/browsertest/library2config.coffee index 8e946bc36..254425bb6 100644 --- a/test/browsertest/library2config.coffee +++ b/test/browsertest/library2config.coffee @@ -12,11 +12,6 @@ exports.default = new Promise (resolve, reject) -> ] amd: fromOptions: true - resolve: - # cannot resolve should outside the outermost node_modules - # so it is injected here - alias: - should: require.resolve "should" plugins: [ new webpack.optimize.LimitChunkCountPlugin maxChunks: 3 diff --git a/test/browsertest/node_modules/library1/index.js b/test/browsertest/node_modules/library1/index.js index 9b10f4d5b..4292aaf55 100644 --- a/test/browsertest/node_modules/library1/index.js +++ b/test/browsertest/node_modules/library1/index.js @@ -2,22 +2,22 @@ var loadTimelibrary1 = typeof window.library1 === "undefined" describe("library1", function() { it("should load library1 only once", function() { - loadTimelibrary1.should.be.ok; + expect(loadTimelibrary1).toBe(true); }); it("should load a component", function() { - require("./lib/component").should.be.eql("lib1 component"); + expect(require("./lib/component")).toBe("lib1 component"); }); it("should load async submodules with require.ensure even if single == true", function(done) { var sameTick = true; require.ensure(["submodule1", "submodule2"], function(require) { - sameTick.should.be.eql(true); - require("submodule1").should.be.eql("submodule1"); - require("submodule2").should.be.eql("submodule2"); - require("submodule3")().should.be.eql("submodule3"); + expect(sameTick).toBe(true); + expect(require("submodule1")).toBe("submodule1"); + expect(require("submodule2")).toBe("submodule2"); + expect(require("submodule3")()).toBe("submodule3"); require.ensure([], function(require) { - sameTick.should.be.eql(true); + expect(sameTick).toBe(true); done(); }); }); @@ -26,4 +26,4 @@ describe("library1", function() { }); }); }); -module.exports = true; \ No newline at end of file +module.exports = true; diff --git a/test/browsertest/node_modules/library2/lib/common.js b/test/browsertest/node_modules/library2/lib/common.js index 0544ae974..fc5d83771 100644 --- a/test/browsertest/node_modules/library2/lib/common.js +++ b/test/browsertest/node_modules/library2/lib/common.js @@ -1,10 +1,8 @@ -var should = require("should"); - var typeofLibrary2 = typeof library2; describe("library2", function() { it("should run before main", function() { - typeofLibrary2.should.be.eql("undefined"); + expect(typeofLibrary2).toBe("undefined"); }); }); -exports.library2common = { ok2: true }; \ No newline at end of file +exports.library2common = { ok2: true }; diff --git a/test/browsertest/node_modules/library2/lib/main.js b/test/browsertest/node_modules/library2/lib/main.js index 0fee7cfe7..d026078f4 100644 --- a/test/browsertest/node_modules/library2/lib/main.js +++ b/test/browsertest/node_modules/library2/lib/main.js @@ -1,13 +1,11 @@ // Chunked File library -var should = require("should"); - var library2commonValue = library2common; describe("library2", function() { var tickExtra, tickEmpty, tickMerged; var extraValue, testValue; - before(function(done) { + beforeAll(function(done) { var asnycOk = false, asnycOk2 = false; var sameTick1 = true; require.ensure(["./extra"], function(require) { @@ -35,25 +33,25 @@ describe("library2", function() { it("should run after common", function() { - library2commonValue.should.be.eql({ok2: true}); + expect(library2commonValue).toEqual({ok2: true}); }); it("should load stuff with require.ensure asynchron", function() { - should.strictEqual(tickExtra, false); + expect(tickExtra).toBe(false); }); it("should load not include stuff from parent, remove empty chunks and apply a post loader", function() { - should.strictEqual(tickEmpty, true); - extraValue.should.be.eql("Lib2 extra2 with post loader"); + expect(tickEmpty).toBe(true); + expect(extraValue).toBe("Lib2 extra2 with post loader"); }); it("should merge chunks if maxChunks specified", function() { - should.strictEqual(tickEmpty, true); - testValue.should.be.eql("test module"); + expect(tickEmpty).toBe(true); + expect(testValue).toBe("test module"); }); it("should load require.amd from options", function() { - require.amd.should.have.property("fromOptions").be.eql(true); + expect(require.amd.fromOptions).toBe(true); }); it("should run empty AMD require", function(done) { @@ -62,36 +60,36 @@ describe("library2", function() { emptyRequire = true; }); Promise.resolve().then(function() {}).then(function() {}).then(function() { - emptyRequire.should.be.eql(true); + expect(emptyRequire).toBe(true); done(); }); }); it("should provide free variables", function() { - s3().should.be.eql("submodule3"); + expect(s3()).toBe("submodule3"); }); it("should define values", function() { - (CONST_UNDEFINED === undefined).should.be.eql(true); - (CONST_NULL === null).should.be.eql(true); - CONST_TRUE.should.be.eql(true); - CONST_FALSE.should.be.eql(false); - (CONST_FUNCTION()).should.be.eql("ok"); - (CONST_NUMBER).should.be.eql(123); - CONST_NUMBER_EXPR.should.be.eql(123); - (typeof CONST_TYPEOF).should.be.eql("typeof"); + expect(CONST_UNDEFINED === undefined).toBe(true); + expect(CONST_NULL === null).toBe(true); + expect(CONST_TRUE).toBe(true); + expect(CONST_FALSE).toBe(false); + expect(CONST_FUNCTION()).toBe("ok"); + expect(CONST_NUMBER).toBe(123); + expect(CONST_NUMBER_EXPR).toBe(123); + expect(typeof CONST_TYPEOF).toBe("typeof"); var o = CONST_OBJECT; - (CONST_OBJECT.A).should.be.eql(1); - CONST_OBJECT.B.should.be.eql("B"); - CONST_OBJECT.C().should.be.eql("C"); - o.A.should.be.eql(1); - o.B.should.be.eql("B"); - o.C().should.be.eql("C"); + expect(CONST_OBJECT.A).toBe(1); + expect(CONST_OBJECT.B).toBe("B"); + expect(CONST_OBJECT.C()).toBe("C"); + expect(o.A).toBe(1); + expect(o.B).toBe("B"); + expect(o.C()).toBe("C"); (function(o) { - o.A.should.be.eql(1); - o.B.should.be.eql("B"); - o.C().should.be.eql("C"); + expect(o.A).toBe(1); + expect(o.B).toBe("B"); + expect(o.C()).toBe("C"); }(CONST_OBJECT)); if(CONST_FALSE) require("fail"); @@ -108,4 +106,4 @@ describe("library2", function() { }); exports.library2 = {ok: true}; -// it should not fail if comment in last line \ No newline at end of file +// it should not fail if comment in last line diff --git a/test/browsertest/node_modules/library2b.js b/test/browsertest/node_modules/library2b.js index 56f800447..64d1a8eac 100644 --- a/test/browsertest/node_modules/library2b.js +++ b/test/browsertest/node_modules/library2b.js @@ -1,5 +1,5 @@ describe("library2b", function() { it("should load this library", function() { - true.should.be.ok; + expect(true).toBe(true); }); }); diff --git a/test/cases/amd/namedModules/index.js b/test/cases/amd/namedModules/index.js index 51313a514..0084e7348 100644 --- a/test/cases/amd/namedModules/index.js +++ b/test/cases/amd/namedModules/index.js @@ -16,14 +16,14 @@ define("named4", [], function() { define(["named1", "named2"], function(named1, named2) { it("should load the named modules in defined dependencies", function() { - named1.should.be.eql("named1"); - named2.should.be.eql("named2"); + expect(named1).toBe("named1"); + expect(named2).toBe("named2"); }); it("should load the named modules in require dependencies", function(done) { require(["named3", "named4"], function (named3, named4) { - named3.should.be.eql("named3"); - named4.should.be.eql("named4"); + expect(named3).toBe("named3"); + expect(named4).toBe("named4"); done(); }); }); diff --git a/test/cases/amd/namedModulesConstArrayDep/index.js b/test/cases/amd/namedModulesConstArrayDep/index.js index e6dc0eb10..e8b0995cd 100644 --- a/test/cases/amd/namedModulesConstArrayDep/index.js +++ b/test/cases/amd/namedModulesConstArrayDep/index.js @@ -16,14 +16,14 @@ define("named4", [], function() { define("named1,named2".split(","), function(named1, named2) { it("should load the named modules in const array defined dependencies", function() { - named1.should.be.eql("named1"); - named2.should.be.eql("named2"); + expect(named1).toBe("named1"); + expect(named2).toBe("named2"); }); it("should load the named modules in const array require dependencies", function(done) { require("named3,named4".split(","), function (named3, named4) { - named3.should.be.eql("named3"); - named4.should.be.eql("named4"); + expect(named3).toBe("named3"); + expect(named4).toBe("named4"); done(); }); }); diff --git a/test/cases/chunks/circular-correctness/index.js b/test/cases/chunks/circular-correctness/index.js index 5db11228d..e9878a8d5 100644 --- a/test/cases/chunks/circular-correctness/index.js +++ b/test/cases/chunks/circular-correctness/index.js @@ -2,7 +2,7 @@ it("should handle circular chunks correctly", function(done) { import(/* webpackChunkName: "a" */"./module-a").then(function(result) { return result.default(); }).then(function(result2) { - result2.default().should.be.eql("x"); + expect(result2.default()).toBe("x"); done(); }).catch(function(e) { done(e); diff --git a/test/cases/chunks/context-weak/index.js b/test/cases/chunks/context-weak/index.js index dbcdef64c..65aa0c58c 100644 --- a/test/cases/chunks/context-weak/index.js +++ b/test/cases/chunks/context-weak/index.js @@ -1,18 +1,18 @@ it("should not bundle context requires with asyncMode === 'weak'", function() { var contextRequire = require.context(".", false, /two/, "weak"); - (function() { + expect(function() { contextRequire("./two") - }).should.throw(/not available/); + }).toThrowError(/not available/); }); it("should find module with asyncMode === 'weak' when required elsewhere", function() { var contextRequire = require.context(".", false, /.+/, "weak"); - contextRequire("./three").should.be.eql(3); + expect(contextRequire("./three")).toBe(3); require("./three"); // in a real app would be served as a separate chunk }); it("should find module with asyncMode === 'weak' when required elsewhere (recursive)", function() { var contextRequire = require.context(".", true, /.+/, "weak"); - contextRequire("./dir/four").should.be.eql(4); + expect(contextRequire("./dir/four")).toBe(4); require("./dir/four"); // in a real app would be served as a separate chunk }); diff --git a/test/cases/chunks/context/index.js b/test/cases/chunks/context/index.js index 37a6e7ac1..7658b1a0e 100644 --- a/test/cases/chunks/context/index.js +++ b/test/cases/chunks/context/index.js @@ -1,9 +1,9 @@ it("should also work in a chunk", function(done) { require.ensure([], function(require) { var contextRequire = require.context(".", false, /two/); - contextRequire("./two").should.be.eql(2); + expect(contextRequire("./two")).toBe(2); var tw = "tw"; - require("." + "/" + tw + "o").should.be.eql(2); + expect(require("." + "/" + tw + "o")).toBe(2); done(); }); }); diff --git a/test/cases/chunks/import-context/index.js b/test/cases/chunks/import-context/index.js index ae1da48a9..b6feb3586 100644 --- a/test/cases/chunks/import-context/index.js +++ b/test/cases/chunks/import-context/index.js @@ -2,11 +2,11 @@ function testCase(load, done) { load("two", 2, function() { var sync = true; load("one", 1, function() { - sync.should.be.eql(false); + expect(sync).toBe(false); load("three", 3, function() { var sync = true; load("two", 2, function() { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); }); Promise.resolve().then(function() {}).then(function() {}).then(function() { @@ -23,7 +23,7 @@ function testCase(load, done) { it("should be able to use expressions in import", function(done) { function load(name, expected, callback) { import("./dir/" + name).then(function(result) { - result.should.be.eql({ default: expected }); + expect(result).toEqual({ default: expected }); callback(); }).catch(function(err) { done(err); diff --git a/test/cases/chunks/import/index.js b/test/cases/chunks/import/index.js index 8dd0f33ba..cf1293edd 100644 --- a/test/cases/chunks/import/index.js +++ b/test/cases/chunks/import/index.js @@ -1,6 +1,6 @@ it("should be able to use import", function(done) { import("./two").then(function(two) { - two.should.be.eql({ default: 2 }); + expect(two).toEqual({ default: 2 }); done(); }).catch(function(err) { done(err); diff --git a/test/cases/chunks/inline-options/index.js b/test/cases/chunks/inline-options/index.js index f5249e659..7f9a4a9a3 100644 --- a/test/cases/chunks/inline-options/index.js +++ b/test/cases/chunks/inline-options/index.js @@ -91,31 +91,31 @@ it("should not find module when mode is weak and chunk not served elsewhere", fu var name = "a"; return import(/* webpackMode: "weak" */ "./dir10/" + name) .catch(function(e) { - e.should.match({ message: /not available/, code: /MODULE_NOT_FOUND/ }); - }) + expect(e).toMatchObject({ message: /not available/, code: /MODULE_NOT_FOUND/ }); + }); }); it("should not find module when mode is weak and chunk not served elsewhere (without context)", function() { return import(/* webpackMode: "weak" */ "./dir11/a") .catch(function(e) { - e.should.match({ message: /not available/, code: /MODULE_NOT_FOUND/ }); - }) + expect(e).toMatchObject({ message: /not available/, code: /MODULE_NOT_FOUND/ }); + }); }); function testChunkLoading(load, expectedSyncInitial, expectedSyncRequested) { var sync = false; var syncInitial = true; var p = Promise.all([load("a"), load("b")]).then(function() { - syncInitial.should.be.eql(expectedSyncInitial); + expect(syncInitial).toBe(expectedSyncInitial); sync = true; var p = Promise.all([ load("a").then(function(a) { - a.should.be.eql({ default: "a" }); - sync.should.be.eql(true); + expect(a).toEqual({ default: "a" }); + expect(sync).toBe(true); }), load("c").then(function(c) { - c.should.be.eql({ default: "c" }); - sync.should.be.eql(expectedSyncRequested); + expect(c).toEqual({ default: "c" }); + expect(sync).toBe(expectedSyncRequested); }) ]); Promise.resolve().then(function(){}).then(function(){}).then(function(){}).then(function(){ diff --git a/test/cases/chunks/issue-2443/index.js b/test/cases/chunks/issue-2443/index.js index 299e99d7f..a70e5e03e 100644 --- a/test/cases/chunks/issue-2443/index.js +++ b/test/cases/chunks/issue-2443/index.js @@ -1,7 +1,7 @@ it("should be able to use expressions in import (directory)", function(done) { function load(name, expected, callback) { import("./dir/" + name + "/file.js").then(function(result) { - result.should.be.eql({ default: expected }); + expect(result).toEqual({ default: expected }); callback(); }).catch(function(err) { done(err); diff --git a/test/cases/chunks/named-chunks/index.js b/test/cases/chunks/named-chunks/index.js index f3a814619..1897b9a0b 100644 --- a/test/cases/chunks/named-chunks/index.js +++ b/test/cases/chunks/named-chunks/index.js @@ -13,7 +13,7 @@ it("should handle named chunks", function(done) { require.ensure([], function(require) { require("./empty?c"); require("./empty?d"); - sync.should.be.ok(); + expect(sync).toBeTruthy(); done(); }, "named-chunk"); } @@ -22,10 +22,10 @@ it("should handle named chunks", function(done) { it("should handle empty named chunks", function(done) { var sync = false; require.ensure([], function(require) { - sync.should.be.ok(); + expect(sync).toBeTruthy(); }, "empty-named-chunk"); require.ensure([], function(require) { - sync.should.be.ok(); + expect(sync).toBeTruthy(); done(); }, "empty-named-chunk"); sync = true; @@ -49,7 +49,7 @@ it("should handle named chunks when there is an error callback", function(done) require.ensure([], function(require) { require("./empty?g"); require("./empty?h"); - sync.should.be.ok(); + expect(sync).toBeTruthy(); done(); }, function(error) {}, "named-chunk-for-error-callback"); } @@ -58,10 +58,10 @@ it("should handle named chunks when there is an error callback", function(done) it("should handle empty named chunks when there is an error callback", function(done) { var sync = false; require.ensure([], function(require) { - sync.should.be.ok(); + expect(sync).toBeTruthy(); }, function(error) {}, "empty-named-chunk-for-error-callback"); require.ensure([], function(require) { - sync.should.be.ok(); + expect(sync).toBeTruthy(); done(); }, function(error) {}, "empty-named-chunk-for-error-callback"); sync = true; @@ -75,13 +75,13 @@ it("should be able to use named chunks in import()", function(done) { import("./empty?import1-in-chunk1" /* webpackChunkName: "import-named-chunk-1" */).then(function(result){ var i = 0; import("./empty?import2-in-chunk1" /* webpackChunkName: "import-named-chunk-1" */).then(function(result){ - sync.should.be.ok(); + expect(sync).toBeTruthy(); if(i++ > 0) done(); }).catch(function(err){ done(err); }); import("./empty?import3-in-chunk2" /* webpackChunkName: "import-named-chunk-2" */).then(function(result){ - sync.should.not.be.ok(); + expect(sync).toBeFalsy(); if(i++ > 0) done(); }).catch(function(err){ done(err); @@ -99,13 +99,13 @@ it("should be able to use named chunk in context import()", function(done) { import("./e" + mpty + "2" /* webpackChunkName: "context-named-chunk" */).then(function(result) { var i = 0; import("./e" + mpty + "3" /* webpackChunkName: "context-named-chunk" */).then(function(result){ - sync.should.be.ok(); + expect(sync).toBeTruthy(); if(i++ > 0) done(); }).catch(function(err){ done(err); }); import("./e" + mpty + "4" /* webpackChunkName: "context-named-chunk-2" */).then(function(result){ - sync.should.not.be.ok(); + expect(sync).toBeFalsy(); if(i++ > 0) done(); }).catch(function(err){ done(err); diff --git a/test/cases/chunks/parsing/index.js b/test/cases/chunks/parsing/index.js index edefaf296..f3a376a5b 100644 --- a/test/cases/chunks/parsing/index.js +++ b/test/cases/chunks/parsing/index.js @@ -1,12 +1,10 @@ -var should = require("should"); - it("should handle bound function expressions", function(done) { require.ensure([], function(require) { - this.should.be.eql({ test: true }); + expect(this).toEqual({ test: true }); require("./empty?test"); - process.nextTick.should.have.type("function"); // check if injection still works + expect(process.nextTick).toBeTypeOf("function"); // check if injection still works require.ensure([], function(require) { - this.should.be.eql({ test: true }); + expect(this).toEqual({ test: true }); done(); }.bind(this)); }.bind({test: true})); @@ -21,7 +19,7 @@ it("should handle require.ensure without function expression", function(done) { it("should parse expression in require.ensure, which isn't a function expression", function(done) { require.ensure([], (function() { - require("./empty?require.ensure:test").should.be.eql({}); + expect(require("./empty?require.ensure:test")).toEqual({}); return function f() { done(); }; @@ -35,8 +33,8 @@ it("should accept a require.include call", function(done) { value = require("./require.include"); }); setImmediate(function() { - should.strictEqual(value, "require.include"); - value.should.be.eql("require.include"); + expect(value).toBe("require.include"); + expect(value).toBe("require.include"); done(); }); }); diff --git a/test/cases/chunks/runtime/duplicate.js b/test/cases/chunks/runtime/duplicate.js index 9867c8106..354829318 100644 --- a/test/cases/chunks/runtime/duplicate.js +++ b/test/cases/chunks/runtime/duplicate.js @@ -1,3 +1,3 @@ require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./a")).toBe("a"); +}) diff --git a/test/cases/chunks/runtime/duplicate2.js b/test/cases/chunks/runtime/duplicate2.js index e6ab3c768..37b0f6b4d 100644 --- a/test/cases/chunks/runtime/duplicate2.js +++ b/test/cases/chunks/runtime/duplicate2.js @@ -1,3 +1,3 @@ require.ensure(["./b"], function(require) { - require("./b").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./b")).toBe("a"); +}) diff --git a/test/cases/chunks/runtime/index.js b/test/cases/chunks/runtime/index.js index 30b8e1dfa..a07031653 100644 --- a/test/cases/chunks/runtime/index.js +++ b/test/cases/chunks/runtime/index.js @@ -21,7 +21,7 @@ it("should not load a chunk which is included in a already loaded one", function var asyncFlag = false; require.ensure(["./empty?x", "./empty?y", "./empty?z"], function(require) { try { - asyncFlag.should.be.eql(true); + expect(asyncFlag).toBe(true); loadChunk(); } catch(e) { done(e); @@ -34,7 +34,7 @@ it("should not load a chunk which is included in a already loaded one", function var sync = true; require.ensure(["./empty?x", "./empty?y"], function(require) { try { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); } catch(e) { done(e); diff --git a/test/cases/chunks/weak-dependencies-context/index.js b/test/cases/chunks/weak-dependencies-context/index.js index 96477ab2f..c6290bd7e 100644 --- a/test/cases/chunks/weak-dependencies-context/index.js +++ b/test/cases/chunks/weak-dependencies-context/index.js @@ -14,11 +14,11 @@ it("should not include a module with a weak dependency using context", function( require(["./b"]); require("./c"); - resolveWeakA.should.exist; - resolveWeakB.should.exist; - resolveWeakC.should.exist; + expect(resolveWeakA).toBeDefined(); + expect(resolveWeakB).toBeDefined(); + expect(resolveWeakC).toBeDefined(); - a.should.be.eql(false); - b.should.be.eql(false); - c.should.be.eql(true); + expect(a).toBe(false); + expect(b).toBe(false); + expect(c).toBe(true); }); diff --git a/test/cases/chunks/weak-dependencies/index.js b/test/cases/chunks/weak-dependencies/index.js index bde0c7db0..d293d17f5 100644 --- a/test/cases/chunks/weak-dependencies/index.js +++ b/test/cases/chunks/weak-dependencies/index.js @@ -5,9 +5,9 @@ it("should not include a module with a weak dependency", function() { var d = !!__webpack_modules__[require.resolveWeak("./d")]; require(["./c"]); require("./d"); - - a.should.be.eql(false); - b.should.be.eql(true); - c.should.be.eql(false); - d.should.be.eql(true); -}); \ No newline at end of file + + expect(a).toBe(false); + expect(b).toBe(true); + expect(c).toBe(false); + expect(d).toBe(true); +}); diff --git a/test/cases/chunks/weird-reference-to-entry/index.js b/test/cases/chunks/weird-reference-to-entry/index.js index ea307b7e9..d22953e46 100644 --- a/test/cases/chunks/weird-reference-to-entry/index.js +++ b/test/cases/chunks/weird-reference-to-entry/index.js @@ -1,6 +1,6 @@ it("should handle reference to entry chunk correctly", function(done) { import(/* webpackChunkName: "main" */"./module-a").then(function(result) { - result.default.should.be.eql("ok"); + expect(result.default).toBe("ok"); done(); }).catch(function(e) { done(e); diff --git a/test/cases/compile/deduplication-bundle-loader/index.js b/test/cases/compile/deduplication-bundle-loader/index.js index e713c6063..7b5adeae0 100644 --- a/test/cases/compile/deduplication-bundle-loader/index.js +++ b/test/cases/compile/deduplication-bundle-loader/index.js @@ -1,12 +1,12 @@ it("should load a duplicate module with different dependencies correctly", function(done) { var a = require("bundle-loader!./a/file"); var b = require("bundle-loader!./b/file"); - (typeof a).should.be.eql("function"); - (typeof b).should.be.eql("function"); + expect((typeof a)).toBe("function"); + expect((typeof b)).toBe("function"); a(function(ra) { - ra.should.be.eql("a"); + expect(ra).toBe("a"); b(function(rb) { - rb.should.be.eql("b"); + expect(rb).toBe("b"); done(); }) }); diff --git a/test/cases/compile/deduplication/index.js b/test/cases/compile/deduplication/index.js index dfe4dba1c..df4bdbee7 100644 --- a/test/cases/compile/deduplication/index.js +++ b/test/cases/compile/deduplication/index.js @@ -1,6 +1,6 @@ it("should load a duplicate module with different dependencies correctly", function() { var dedupe1 = require("./dedupe1"); var dedupe2 = require("./dedupe2"); - dedupe1.should.be.eql("dedupe1"); - dedupe2.should.be.eql("dedupe2"); + expect(dedupe1).toBe("dedupe1"); + expect(dedupe2).toBe("dedupe2"); }); diff --git a/test/cases/compile/error-hide-stack/index.js b/test/cases/compile/error-hide-stack/index.js index 89bae46ad..e73a65df4 100644 --- a/test/cases/compile/error-hide-stack/index.js +++ b/test/cases/compile/error-hide-stack/index.js @@ -1,5 +1,5 @@ it("should hide stack in details", function() { - (function f() { + expect(function f() { require("./loader!"); - }).should.throw(); + }).toThrowError(); }); diff --git a/test/cases/concord/inner-modules-and-extensions/index.js b/test/cases/concord/inner-modules-and-extensions/index.js index b35fdaacb..4a2f7000f 100644 --- a/test/cases/concord/inner-modules-and-extensions/index.js +++ b/test/cases/concord/inner-modules-and-extensions/index.js @@ -1,12 +1,12 @@ it("should resolve the alias in package.json", function() { - require("app/file").default.should.be.eql("file"); + expect(require("app/file").default).toBe("file"); }); it("should resolve the alias and extensions in package.json", function() { - require("app/file2").default.should.be.eql("correct file2"); + expect(require("app/file2").default).toBe("correct file2"); }); it("should resolve the alias in package.json", function() { - require("thing").default.should.be.eql("the thing"); + expect(require("thing").default).toBe("the thing"); }); diff --git a/test/cases/context/ignore-hidden-files/index.js b/test/cases/context/ignore-hidden-files/index.js index 4f13adedb..83313cd16 100644 --- a/test/cases/context/ignore-hidden-files/index.js +++ b/test/cases/context/ignore-hidden-files/index.js @@ -1,6 +1,6 @@ it("should ignore hidden files", function() { - (function() { + expect(function() { var name = "./file.js"; require("./folder/" + name); - }).should.throw(); + }).toThrowError(); }); \ No newline at end of file diff --git a/test/cases/context/issue-1769/index.js b/test/cases/context/issue-1769/index.js index 76305733c..504862c37 100644 --- a/test/cases/context/issue-1769/index.js +++ b/test/cases/context/issue-1769/index.js @@ -3,7 +3,7 @@ it("should be able the catch a incorrect import", function(done) { import("./folder/" + expr).then(function() { done(new Error("should not be called")); }).catch(function(err) { - err.should.be.instanceof(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); diff --git a/test/cases/context/issue-3873/index.js b/test/cases/context/issue-3873/index.js index 8135a5a73..01f49fbd7 100644 --- a/test/cases/context/issue-3873/index.js +++ b/test/cases/context/issue-3873/index.js @@ -3,5 +3,5 @@ function get(name) { } it("should automatically infer the index.js file", function() { - get("module").should.be.eql("module"); + expect(get("module")).toBe("module"); }); diff --git a/test/cases/context/issue-524/index.js b/test/cases/context/issue-524/index.js index 8c42102a7..4c0c7721c 100644 --- a/test/cases/context/issue-524/index.js +++ b/test/cases/context/issue-524/index.js @@ -1,25 +1,11 @@ it("should support an empty context", function() { var c = require.context(".", true, /^nothing$/); - (typeof c.id).should.be.oneOf(["number", "string"]); - (function() { + expect(typeof c.id === "number" || typeof c.id === "string").toBeTruthy(); + expect(function() { c.resolve(""); - }).should.throw(); - (function() { + }).toThrowError(); + expect(function() { c(""); - }).should.throw(); - c.keys().should.be.eql([]); + }).toThrowError(); + expect(c.keys()).toEqual([]); }); - -// This would be a useful testcase, but it requires an (really) empty directory. -// **but** you cannot commit empty directories into git -/*it("should support an empty context (empty dir)", function() { - var c = require.context("./empty", true, /^nothing$/); - c.id.should.be.type("number"); - (function() { - c.resolve(""); - }).should.throw(); - (function() { - c(""); - }).should.throw(); - c.keys().should.be.eql([]); -});*/ diff --git a/test/cases/context/issue-5750/index.js b/test/cases/context/issue-5750/index.js index 09b525ab0..92b55ac84 100644 --- a/test/cases/context/issue-5750/index.js +++ b/test/cases/context/issue-5750/index.js @@ -1,4 +1,4 @@ it("should not use regexps with the g flag", function() { - require.context("./folder", true, /a/).keys().length.should.be.eql(1); - require.context("./folder", true, /a/g).keys().length.should.be.eql(0); + expect(require.context("./folder", true, /a/).keys().length).toBe(1); + expect(require.context("./folder", true, /a/g).keys().length).toBe(0); }); diff --git a/test/cases/context/issue-801/index.js b/test/cases/context/issue-801/index.js index bacd8cc43..c96532006 100644 --- a/test/cases/context/issue-801/index.js +++ b/test/cases/context/issue-801/index.js @@ -1,7 +1,7 @@ it("should emit valid code for dynamic require string with expr", function() { var test = require("./folder/file"); - test("file").should.be.eql({ a: false, b: false, c: true, d: true }); - test("file.js").should.be.eql({ a: false, b: false, c: false, d: true }); - test("./file").should.be.eql({ a: true, b: true, c: false, d: false }); - test("./file.js").should.be.eql({ a: false, b: false, c: false, d: false }); -}); \ No newline at end of file + expect(test("file")).toEqual({ a: false, b: false, c: true, d: true }); + expect(test("file.js")).toEqual({ a: false, b: false, c: false, d: true }); + expect(test("./file")).toEqual({ a: true, b: true, c: false, d: false }); + expect(test("./file.js")).toEqual({ a: false, b: false, c: false, d: false }); +}); diff --git a/test/cases/errors/case-sensitive/index.js b/test/cases/errors/case-sensitive/index.js index f107f0160..c42f65350 100644 --- a/test/cases/errors/case-sensitive/index.js +++ b/test/cases/errors/case-sensitive/index.js @@ -3,6 +3,6 @@ it("should return different modules with different casing", function() { var A = require("./A"); var b = require("./b/file.js"); var B = require("./B/file.js"); - a.should.not.be.equal(A); - b.should.not.be.equal(B); + expect(a).not.toBe(A); + expect(b).not.toBe(B); }); diff --git a/test/cases/errors/harmony-import-missing/index.js b/test/cases/errors/harmony-import-missing/index.js index 2ee1bcc33..14db16769 100644 --- a/test/cases/errors/harmony-import-missing/index.js +++ b/test/cases/errors/harmony-import-missing/index.js @@ -1,5 +1,5 @@ it("should not crash on importing missing modules", function() { - (function() { + expect(function() { require("./module"); - }).should.throw(); + }).toThrowError(); }); diff --git a/test/cases/json/data/index.js b/test/cases/json/data/index.js index b4e30016b..eb3a9a730 100644 --- a/test/cases/json/data/index.js +++ b/test/cases/json/data/index.js @@ -1,8 +1,8 @@ it("should require json via require", function() { - ({ data: require("./a.json") }).should.be.eql({ data: null }); - ({ data: require("./b.json") }).should.be.eql({ data: 123 }); - ({ data: require("./c.json") }).should.be.eql({ data: [1, 2, 3, 4] }); - ({ data: require("./e.json") }).should.be.eql({ data: { + expect({ data: require("./a.json") }).toEqual({ data: null }); + expect({ data: require("./b.json") }).toEqual({ data: 123 }); + expect({ data: require("./c.json") }).toEqual({ data: [1, 2, 3, 4] }); + expect({ data: require("./e.json") }).toEqual({ data: { "aa": 1, "bb": 2, "1": "x" diff --git a/test/cases/json/import-by-name/index.js b/test/cases/json/import-by-name/index.js index 589170057..20993afb5 100644 --- a/test/cases/json/import-by-name/index.js +++ b/test/cases/json/import-by-name/index.js @@ -5,17 +5,17 @@ import f, { named } from "../data/f.json"; import g, { named as gnamed } from "../data/g.json"; it("should be possible to import json data", function() { - c[2].should.be.eql(3); - Object.keys(d).should.be.eql(["default"]); - aa.should.be.eql(1); - bb.should.be.eql(2); - named.should.be.eql("named"); - ({ f }).should.be.eql({ + expect(c[2]).toBe(3); + expect(Object.keys(d)).toEqual(["default"]); + expect(aa).toBe(1); + expect(bb).toBe(2); + expect(named).toBe("named"); + (expect({ f })).toEqual({ f: { __esModule: true, default: "default", named: "named" } }); - g.named.should.be.equal(gnamed); + expect(g.named).toBe(gnamed); }); diff --git a/test/cases/json/import-with-default/index.js b/test/cases/json/import-with-default/index.js index e138d294e..80fde51fa 100644 --- a/test/cases/json/import-with-default/index.js +++ b/test/cases/json/import-with-default/index.js @@ -6,16 +6,16 @@ import e from "../data/e.json"; import f from "../data/f.json"; it("should be possible to import json data", function() { - ({a}).should.be.eql({a: null}); - b.should.be.eql(123); - c.should.be.eql([1, 2, 3, 4]); - d.should.be.eql({}); - e.should.be.eql({ + expect({a}).toEqual({a: null}); + expect(b).toBe(123); + expect(c).toEqual([1, 2, 3, 4]); + expect(d).toEqual({}); + expect(e).toEqual({ aa: 1, bb: 2, "1": "x" }); - f.should.be.eql({ + expect(f).toEqual({ named: "named", "default": "default", __esModule: true diff --git a/test/cases/loaders/_resources/included.jade b/test/cases/loaders/_resources/included.pug similarity index 100% rename from test/cases/loaders/_resources/included.jade rename to test/cases/loaders/_resources/included.pug diff --git a/test/cases/loaders/_resources/parent.jade b/test/cases/loaders/_resources/parent.pug similarity index 100% rename from test/cases/loaders/_resources/parent.jade rename to test/cases/loaders/_resources/parent.pug diff --git a/test/cases/loaders/_resources/template.jade b/test/cases/loaders/_resources/template.pug similarity index 100% rename from test/cases/loaders/_resources/template.jade rename to test/cases/loaders/_resources/template.pug diff --git a/test/cases/loaders/async/index.js b/test/cases/loaders/async/index.js index 0c3a7cb0f..8d7a8628b 100644 --- a/test/cases/loaders/async/index.js +++ b/test/cases/loaders/async/index.js @@ -1,14 +1,14 @@ it("should allow combinations of async and sync loaders", function() { - require("./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./a").should.be.eql("a"); + expect(require("./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./a")).toBe("a"); - require("./loaders/syncloader!./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/syncloader!./loaders/asyncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./loaders/asyncloader!./a").should.be.eql("a"); + expect(require("./loaders/syncloader!./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/syncloader!./loaders/asyncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./loaders/asyncloader!./a")).toBe("a"); - require("./loaders/asyncloader!./loaders/asyncloader!./loaders/asyncloader!./a").should.be.eql("a"); - require("./loaders/asyncloader!./loaders/syncloader!./loaders/asyncloader!./a").should.be.eql("a"); - require("./loaders/syncloader!./loaders/asyncloader!./loaders/syncloader!./a").should.be.eql("a"); - require("./loaders/syncloader!./loaders/syncloader!./loaders/syncloader!./a").should.be.eql("a"); + expect(require("./loaders/asyncloader!./loaders/asyncloader!./loaders/asyncloader!./a")).toBe("a"); + expect(require("./loaders/asyncloader!./loaders/syncloader!./loaders/asyncloader!./a")).toBe("a"); + expect(require("./loaders/syncloader!./loaders/asyncloader!./loaders/syncloader!./a")).toBe("a"); + expect(require("./loaders/syncloader!./loaders/syncloader!./loaders/syncloader!./a")).toBe("a"); }); diff --git a/test/cases/loaders/coffee-loader/index.js b/test/cases/loaders/coffee-loader/index.js index 2e0012214..be3924f1e 100644 --- a/test/cases/loaders/coffee-loader/index.js +++ b/test/cases/loaders/coffee-loader/index.js @@ -1,10 +1,10 @@ it("should handle the coffee loader correctly", function() { - require("!coffee-loader!../_resources/script.coffee").should.be.eql("coffee test"); - require("../_resources/script.coffee").should.be.eql("coffee test"); + expect(require("!coffee-loader!../_resources/script.coffee")).toBe("coffee test"); + expect(require("../_resources/script.coffee")).toBe("coffee test"); }); it("should handle literate coffee script correctly", function() { - require("!coffee-loader?literate!./script.coffee.md").should.be.eql("literate coffee test"); + expect(require("!coffee-loader?literate!./script.coffee.md")).toBe("literate coffee test"); }); it("should generate valid code with cheap-source-map", function() { diff --git a/test/cases/loaders/context/index.js b/test/cases/loaders/context/index.js index 833bebb10..9105d7d6f 100644 --- a/test/cases/loaders/context/index.js +++ b/test/cases/loaders/context/index.js @@ -1,5 +1,5 @@ it("should be able to use a context with a loader", function() { var abc = "abc", scr = "script.coffee"; - require("../_resources/" + scr).should.be.eql("coffee test"); - require("raw-loader!../_resources/" + abc + ".txt").should.be.eql("abc"); + expect(require("../_resources/" + scr)).toBe("coffee test"); + expect(require("raw-loader!../_resources/" + abc + ".txt")).toBe("abc"); }); diff --git a/test/cases/loaders/css-loader/index.js b/test/cases/loaders/css-loader/index.js index 2ecc75395..b6484574f 100644 --- a/test/cases/loaders/css-loader/index.js +++ b/test/cases/loaders/css-loader/index.js @@ -1,5 +1,11 @@ it("should handle the css loader correctly", function() { - (require("!css-loader!../_css/stylesheet.css") + "").indexOf(".rule-direct").should.not.be.eql(-1); - (require("!css-loader!../_css/stylesheet.css") + "").indexOf(".rule-import1").should.not.be.eql(-1); - (require("!css-loader!../_css/stylesheet.css") + "").indexOf(".rule-import2").should.not.be.eql(-1); + expect( + (require("!css-loader!../_css/stylesheet.css") + "").indexOf(".rule-direct") + ).not.toEqual(-1); + expect( + (require("!css-loader!../_css/stylesheet.css") + "").indexOf(".rule-import1") + ).not.toEqual(-1); + expect( + (require("!css-loader!../_css/stylesheet.css") + "").indexOf(".rule-import2") + ).not.toEqual(-1); }); diff --git a/test/cases/loaders/issue-2299/index.js b/test/cases/loaders/issue-2299/index.js index 29e632e62..0a97e0c92 100644 --- a/test/cases/loaders/issue-2299/index.js +++ b/test/cases/loaders/issue-2299/index.js @@ -1,3 +1,6 @@ it("should be able to use loadModule multiple times within a loader, on files in different directories", function() { - require('!./loader/index.js!./a.data').should.have.properties(['a', 'b', 'c']); + const data = require("!./loader/index.js!./a.data"); + expect(data).toHaveProperty("a"); + expect(data).toHaveProperty("b"); + expect(data).toHaveProperty("c"); }); diff --git a/test/cases/loaders/issue-4959/index.js b/test/cases/loaders/issue-4959/index.js index 8e0c51797..8f360d4b8 100644 --- a/test/cases/loaders/issue-4959/index.js +++ b/test/cases/loaders/issue-4959/index.js @@ -1,3 +1,3 @@ it("should resolve module dependencies recursively", function() { - require("!./loaders/index!a").should.be.eql("c"); + expect(require("!./loaders/index!a")).toBe("c"); }); diff --git a/test/cases/loaders/jade-loader/index.js b/test/cases/loaders/jade-loader/index.js deleted file mode 100644 index a30c1f92e..000000000 --- a/test/cases/loaders/jade-loader/index.js +++ /dev/null @@ -1,4 +0,0 @@ -it("should handle the jade loader correctly", function() { - require("!jade-loader?self!../_resources/template.jade")({abc: "abc"}).should.be.eql("

selfabc

included

"); - require("../_resources/template.jade")({abc: "abc"}).should.be.eql("

abc

included

"); -}); diff --git a/test/cases/loaders/json-loader/index.js b/test/cases/loaders/json-loader/index.js index e2e75edf4..97de45506 100644 --- a/test/cases/loaders/json-loader/index.js +++ b/test/cases/loaders/json-loader/index.js @@ -1,13 +1,11 @@ -var should = require("should"); - it("should be able to load JSON files without loader", function() { var someJson = require("./some.json"); - someJson.should.have.property("it", "works"); - someJson.should.have.property("number", 42); + expect(someJson).toHaveProperty("it", "works"); + expect(someJson).toHaveProperty("number", 42); }); it("should also work when the json extension is omitted", function() { var someJson = require("./some"); - someJson.should.have.property("it", "works"); - someJson.should.have.property("number", 42); + expect(someJson).toHaveProperty("it", "works"); + expect(someJson).toHaveProperty("number", 42); }); diff --git a/test/cases/loaders/less-loader/index.js b/test/cases/loaders/less-loader/index.js index 936d89c61..fc94245fb 100644 --- a/test/cases/loaders/less-loader/index.js +++ b/test/cases/loaders/less-loader/index.js @@ -1,5 +1,11 @@ it("should handle the less loader (piped with raw loader) correctly", function() { - require("!raw-loader!less-loader!./less/stylesheet.less").indexOf(".less-rule-direct").should.not.be.eql(-1); - require("!raw-loader!less-loader!./less/stylesheet.less").indexOf(".less-rule-import1").should.not.be.eql(-1); - require("!raw-loader!less-loader!./less/stylesheet.less").indexOf(".less-rule-import2").should.not.be.eql(-1); + expect( + require("!raw-loader!less-loader!./less/stylesheet.less").indexOf(".less-rule-direct") + ).not.toEqual(-1); + expect( + require("!raw-loader!less-loader!./less/stylesheet.less").indexOf(".less-rule-import1") + ).not.toEqual(-1); + expect( + require("!raw-loader!less-loader!./less/stylesheet.less").indexOf(".less-rule-import2") + ).not.toEqual(-1); }); diff --git a/test/cases/loaders/module-description-file/index.js b/test/cases/loaders/module-description-file/index.js index 385187584..ce5b36996 100644 --- a/test/cases/loaders/module-description-file/index.js +++ b/test/cases/loaders/module-description-file/index.js @@ -1,12 +1,12 @@ it("should run a loader from package.json", function() { - require("testloader!../_resources/abc.txt").should.be.eql("abcwebpack"); - require("testloader/lib/loader2!../_resources/abc.txt").should.be.eql("abcweb"); - require("testloader/lib/loader3!../_resources/abc.txt").should.be.eql("abcloader"); - require("testloader/lib/loader-indirect!../_resources/abc.txt").should.be.eql("abcwebpack"); + expect(require("testloader!../_resources/abc.txt")).toBe("abcwebpack"); + expect(require("testloader/lib/loader2!../_resources/abc.txt")).toBe("abcweb"); + expect(require("testloader/lib/loader3!../_resources/abc.txt")).toBe("abcloader"); + expect(require("testloader/lib/loader-indirect!../_resources/abc.txt")).toBe("abcwebpack"); }); it("should run a loader from .webpack-loader.js extension", function() { - require("testloader/lib/loader!../_resources/abc.txt").should.be.eql("abcwebpack"); + expect(require("testloader/lib/loader!../_resources/abc.txt")).toBe("abcwebpack"); }); it("should be able to pipe loaders", function() { - require("testloader!./reverseloader!../_resources/abc.txt").should.be.eql("cbawebpack"); + expect(require("testloader!./reverseloader!../_resources/abc.txt")).toBe("cbawebpack"); }); diff --git a/test/cases/loaders/pug-loader/index.js b/test/cases/loaders/pug-loader/index.js new file mode 100644 index 000000000..7348ae7df --- /dev/null +++ b/test/cases/loaders/pug-loader/index.js @@ -0,0 +1,4 @@ +it("should handle the pug loader correctly", function() { + expect(require("!pug-loader?self!../_resources/template.pug")({ abc: "abc" })).toBe("

selfabc

included

"); + expect(require("../_resources/template.pug")({ abc: "abc" })).toBe("

abc

included

"); +}); diff --git a/test/cases/loaders/query/index.js b/test/cases/loaders/query/index.js index 5ce94909a..260f9287c 100644 --- a/test/cases/loaders/query/index.js +++ b/test/cases/loaders/query/index.js @@ -1,6 +1,6 @@ it("should pass query to loader", function() { var result = require("./loaders/queryloader?query!./a?resourcequery"); - result.should.be.eql({ + expect(result).toEqual({ resourceQuery: "?resourcequery", query: "?query", prev: "module.exports = \"a\";" @@ -9,7 +9,7 @@ it("should pass query to loader", function() { it("should pass query to loader without resource with resource query", function() { var result = require("./loaders/queryloader?query!?resourcequery"); - result.should.be.eql({ + expect(result).toEqual({ resourceQuery: "?resourcequery", query: "?query", prev: null @@ -18,7 +18,7 @@ it("should pass query to loader without resource with resource query", function( it("should pass query to loader without resource", function() { var result = require("./loaders/queryloader?query!"); - result.should.be.eql({ + expect(result).toEqual({ query: "?query", prev: null }); @@ -26,10 +26,10 @@ it("should pass query to loader without resource", function() { it("should pass query to multiple loaders", function() { var result = require("./loaders/queryloader?query1!./loaders/queryloader?query2!./a?resourcequery"); - result.should.have.type("object"); - result.should.have.property("resourceQuery").be.eql("?resourcequery"); - result.should.have.property("query").be.eql("?query1"); - result.should.have.property("prev").be.eql("module.exports = " + JSON.stringify({ + expect(result).toBeTypeOf("object"); + expect(result).toHaveProperty("resourceQuery", "?resourcequery"); + expect(result).toHaveProperty("query", "?query1"); + expect(result).toHaveProperty("prev", "module.exports = " + JSON.stringify({ resourceQuery: "?resourcequery", query: "?query2", prev: "module.exports = \"a\";" @@ -39,7 +39,7 @@ it("should pass query to multiple loaders", function() { it("should pass query to loader over context", function() { var test = "test"; var result = require("./loaders/queryloader?query!./context-query-test/" + test); - result.should.be.eql({ + expect(result).toEqual({ resourceQuery: "", query: "?query", prev: "test content" diff --git a/test/cases/loaders/raw-loader/index.js b/test/cases/loaders/raw-loader/index.js index eb82ae080..5367de4e8 100644 --- a/test/cases/loaders/raw-loader/index.js +++ b/test/cases/loaders/raw-loader/index.js @@ -1,3 +1,3 @@ it("should handle the raw loader correctly", function() { - require("raw-loader!../_resources/abc.txt").should.be.eql("abc"); + expect(require("raw-loader!../_resources/abc.txt")).toBe("abc"); }); diff --git a/test/cases/loaders/val-loader/index.js b/test/cases/loaders/val-loader/index.js index 34d6c914e..29a56b6aa 100644 --- a/test/cases/loaders/val-loader/index.js +++ b/test/cases/loaders/val-loader/index.js @@ -1,5 +1,11 @@ it("should handle the val loader (piped with css loader) correctly", function() { - (require("!css-loader!val-loader!../_css/generateCss") + "").indexOf("generated").should.not.be.eql(-1); - (require("!css-loader!val-loader!../_css/generateCss") + "").indexOf(".rule-import2").should.not.be.eql(-1); - (require("!raw-loader!val-loader!../_css/generateCss") + "").indexOf("generated").should.not.be.eql(-1); + expect( + (require("!css-loader!val-loader!../_css/generateCss") + "").indexOf("generated") + ).not.toEqual(-1); + expect( + (require("!css-loader!val-loader!../_css/generateCss") + "").indexOf(".rule-import2") + ).not.toEqual(-1); + expect( + (require("!raw-loader!val-loader!../_css/generateCss") + "").indexOf("generated") + ).not.toEqual(-1); }); diff --git a/test/cases/mjs/cjs-import-default/index.mjs b/test/cases/mjs/cjs-import-default/index.mjs index 2e95cbb3a..591ab6214 100644 --- a/test/cases/mjs/cjs-import-default/index.mjs +++ b/test/cases/mjs/cjs-import-default/index.mjs @@ -5,26 +5,26 @@ import { ns, default as def1, def as def2, data as data2 } from "./reexport.mjs" import * as reexport from "./reexport.mjs"; it("should get correct values when importing named exports from a CommonJs module from mjs", function() { - (typeof data).should.be.eql("undefined"); - ({ data }).should.be.eql({ data: undefined }); - def.should.be.eql({ + expect(typeof data).toBe("undefined"); + expect({ data }).toEqual({ data: undefined }); + expect(def).toEqual({ data: "ok", default: "default" }); - ({ def }).should.be.eql({ + expect({ def }).toEqual({ def: { data: "ok", default: "default" } }); const valueOf = "valueOf"; - star[valueOf]().should.be.eql({ + expect(star[valueOf]()).toEqual({ default: { data: "ok", default: "default" } }); - ({ star }).should.be.eql({ + expect({ star }).toEqual({ star: { default: { data: "ok", @@ -32,26 +32,26 @@ it("should get correct values when importing named exports from a CommonJs modul } } }); - star.default.should.be.eql({ + expect(star.default).toEqual({ data: "ok", default: "default" }); - ns.should.be.eql({ + expect(ns).toEqual({ default: { data: "ok", default: "default" } }); - def1.should.be.eql({ + expect(def1).toEqual({ data: "ok", default: "default" }); - def2.should.be.eql({ + expect(def2).toEqual({ data: "ok", default: "default" }); - (typeof data2).should.be.eql("undefined"); - reexport[valueOf]().should.be.eql({ + expect((typeof data2)).toBe("undefined"); + expect(reexport[valueOf]()).toEqual({ ns: { default: { data: "ok", diff --git a/test/cases/mjs/esm-by-default/index.mjs b/test/cases/mjs/esm-by-default/index.mjs index 839b81030..701d602ab 100644 --- a/test/cases/mjs/esm-by-default/index.mjs +++ b/test/cases/mjs/esm-by-default/index.mjs @@ -1,8 +1,8 @@ it("should not have commonjs stuff available", function() { if(typeof module !== "undefined") { // If module is available - module.should.have.property("webpackTestSuiteModule"); // it must be the node.js module + expect(module).toHaveProperty("webpackTestSuiteModule"); // it must be the node.js module } if(typeof require !== "undefined") { // If require is available - require.should.have.property("webpackTestSuiteRequire"); // it must be the node.js require + expect(require).toHaveProperty("webpackTestSuiteRequire"); // it must be the node.js require } }); diff --git a/test/cases/mjs/namespace-object-lazy/index.mjs b/test/cases/mjs/namespace-object-lazy/index.mjs index eafa15939..ca85ba72c 100644 --- a/test/cases/mjs/namespace-object-lazy/index.mjs +++ b/test/cases/mjs/namespace-object-lazy/index.mjs @@ -1,13 +1,13 @@ it("should receive a namespace object when importing commonjs", function(done) { import("./cjs.js").then(function(result) { - result.should.be.eql({ default: { named: "named", default: "default" } }); + expect(result).toEqual({ default: { named: "named", default: "default" } }); done(); }).catch(done); }); it("should receive a namespace object when importing commonjs with __esModule", function(done) { import("./cjs-esmodule.js").then(function(result) { - result.should.be.eql({ default: { __esModule: true, named: "named", default: "default" } }); + expect(result).toEqual({ default: { __esModule: true, named: "named", default: "default" } }); done(); }).catch(done); }); @@ -54,7 +54,7 @@ function contextMixed(name) { function promiseTest(promise, equalsTo) { return promise.then(function(results) { for(const result of results) - result.should.be.eql(equalsTo); + expect(result).toEqual(equalsTo); }); } diff --git a/test/cases/mjs/no-module-main-field/index.mjs b/test/cases/mjs/no-module-main-field/index.mjs index 0870957cc..323db4cee 100644 --- a/test/cases/mjs/no-module-main-field/index.mjs +++ b/test/cases/mjs/no-module-main-field/index.mjs @@ -1,5 +1,5 @@ import result from "m"; it("should use the correct entry point", function() { - result.should.be.eql("yep"); + expect(result).toBe("yep"); }); diff --git a/test/cases/mjs/non-mjs-namespace-object-lazy/index.js b/test/cases/mjs/non-mjs-namespace-object-lazy/index.js index c9c6d829c..d2e29bfed 100644 --- a/test/cases/mjs/non-mjs-namespace-object-lazy/index.js +++ b/test/cases/mjs/non-mjs-namespace-object-lazy/index.js @@ -1,13 +1,13 @@ it("should receive a namespace object when importing commonjs", function(done) { import("./cjs").then(function(result) { - result.should.be.eql({ named: "named", default: { named: "named", default: "default" } }); + expect(result).toEqual({ named: "named", default: { named: "named", default: "default" } }); done(); }).catch(done); }); it("should receive a namespace object when importing commonjs with __esModule", function(done) { import("./cjs-esmodule").then(function(result) { - result.should.be.eql({ __esModule: true, named: "named", default: "default" }); + expect(result).toEqual({ __esModule: true, named: "named", default: "default" }); done(); }).catch(done); }); @@ -54,7 +54,7 @@ function contextMixed(name) { function promiseTest(promise, equalsTo) { return promise.then(function(results) { for(const result of results) - result.should.be.eql(equalsTo); + expect(result).toEqual(equalsTo); }); } diff --git a/test/cases/nonce/set-nonce/index.js b/test/cases/nonce/set-nonce/index.js index 5d742671f..9607ec97b 100644 --- a/test/cases/nonce/set-nonce/index.js +++ b/test/cases/nonce/set-nonce/index.js @@ -7,7 +7,7 @@ it("should load script with nonce 'nonce1234'", function(done) { // if in browser context, test that nonce was added. if (typeof document !== 'undefined') { var script = document.querySelector('script[src="js/chunk-with-nonce.web.js"]'); - script.getAttribute('nonce').should.be.eql('nonce1234'); + expect(script.getAttribute('nonce')).toBe('nonce1234'); } __webpack_nonce__ = undefined; done(); @@ -21,8 +21,8 @@ it("should load script without nonce", function(done) { // if in browser context, test that nonce was added. if (typeof document !== 'undefined') { var script = document.querySelector('script[src="js/chunk-without-nonce.web.js"]'); - script.hasAttribute('nonce').should.be.eql(false); + expect(script.hasAttribute('nonce')).toBe(false); } __webpack_nonce__ = undefined; done(); -}); \ No newline at end of file +}); diff --git a/test/cases/optimize/side-effects-all-chain-unused/index.js b/test/cases/optimize/side-effects-all-chain-unused/index.js index f4132b006..38a67a0eb 100644 --- a/test/cases/optimize/side-effects-all-chain-unused/index.js +++ b/test/cases/optimize/side-effects-all-chain-unused/index.js @@ -2,6 +2,6 @@ import { log } from "pmodule/tracker"; import { a } from "pmodule"; it("should not evaluate a chain of modules", function() { - a.should.be.eql("a"); - log.should.be.eql(["a.js"]); + expect(a).toBe("a"); + expect(log).toEqual(["a.js"]); }); diff --git a/test/cases/optimize/side-effects-all-used/index.js b/test/cases/optimize/side-effects-all-used/index.js index c5f6c2ffc..8838b9948 100644 --- a/test/cases/optimize/side-effects-all-used/index.js +++ b/test/cases/optimize/side-effects-all-used/index.js @@ -3,9 +3,9 @@ import { a, x, z } from "pmodule"; import def from "pmodule"; it("should evaluate all modules", function() { - def.should.be.eql("def"); - a.should.be.eql("a"); - x.should.be.eql("x"); - z.should.be.eql("z"); - log.should.be.eql(["a.js", "b.js", "c.js", "index.js"]); + expect(def).toBe("def"); + expect(a).toBe("a"); + expect(x).toBe("x"); + expect(z).toBe("z"); + expect(log).toEqual(["a.js", "b.js", "c.js", "index.js"]); }); diff --git a/test/cases/optimize/side-effects-immediate-unused/index.js b/test/cases/optimize/side-effects-immediate-unused/index.js index 65b5c767a..4a9b783c9 100644 --- a/test/cases/optimize/side-effects-immediate-unused/index.js +++ b/test/cases/optimize/side-effects-immediate-unused/index.js @@ -2,7 +2,7 @@ import { log } from "pmodule/tracker"; import { a, z } from "pmodule"; it("should not evaluate an immediate module", function() { - a.should.be.eql("a"); - z.should.be.eql("z"); - log.should.be.eql(["a.js", "c.js"]); + expect(a).toBe("a"); + expect(z).toBe("z"); + expect(log).toEqual(["a.js", "c.js"]); }); diff --git a/test/cases/optimize/side-effects-reexport-start-unknown/index.js b/test/cases/optimize/side-effects-reexport-start-unknown/index.js index e23690e91..6dfb96eaa 100644 --- a/test/cases/optimize/side-effects-reexport-start-unknown/index.js +++ b/test/cases/optimize/side-effects-reexport-start-unknown/index.js @@ -2,5 +2,5 @@ import * as m from "m"; it("should handle unknown exports fine", function() { var x = m; - x.should.be.eql({ foo: "foo" }); + expect(x).toEqual({ foo: "foo" }); }); diff --git a/test/cases/optimize/side-effects-root-unused/index.js b/test/cases/optimize/side-effects-root-unused/index.js index 36980ebab..22e4427cb 100644 --- a/test/cases/optimize/side-effects-root-unused/index.js +++ b/test/cases/optimize/side-effects-root-unused/index.js @@ -2,8 +2,8 @@ import { log } from "pmodule/tracker"; import { a, x, z } from "pmodule"; it("should evaluate all modules", function() { - a.should.be.eql("a"); - x.should.be.eql("x"); - z.should.be.eql("z"); - log.should.be.eql(["a.js", "b.js", "c.js"]); + expect(a).toBe("a"); + expect(x).toBe("x"); + expect(z).toBe("z"); + expect(log).toEqual(["a.js", "b.js", "c.js"]); }); diff --git a/test/cases/optimize/side-effects-simple-unused/index.js b/test/cases/optimize/side-effects-simple-unused/index.js index 70de17426..6e14a2b1a 100644 --- a/test/cases/optimize/side-effects-simple-unused/index.js +++ b/test/cases/optimize/side-effects-simple-unused/index.js @@ -3,8 +3,8 @@ import { x, z } from "pmodule"; import def from "pmodule"; it("should not evaluate a simple unused module", function() { - def.should.be.eql("def"); - x.should.be.eql("x"); - z.should.be.eql("z"); - log.should.be.eql(["b.js", "c.js", "index.js"]); + expect(def).toBe("def"); + expect(x).toBe("x"); + expect(z).toBe("z"); + expect(log).toEqual(["b.js", "c.js", "index.js"]); }); diff --git a/test/cases/optimize/side-effects-transitive-unused/index.js b/test/cases/optimize/side-effects-transitive-unused/index.js index 5da932f05..007064fbf 100644 --- a/test/cases/optimize/side-effects-transitive-unused/index.js +++ b/test/cases/optimize/side-effects-transitive-unused/index.js @@ -2,7 +2,7 @@ import { log } from "pmodule/tracker"; import { a, y } from "pmodule"; it("should not evaluate a reexporting transitive module", function() { - a.should.be.eql("a"); - y.should.be.eql("y"); - log.should.be.eql(["a.js", "b.js"]); + expect(a).toBe("a"); + expect(y).toBe("y"); + expect(log).toEqual(["a.js", "b.js"]); }); diff --git a/test/cases/optimize/tree-shaking-commonjs/index.js b/test/cases/optimize/tree-shaking-commonjs/index.js index e7cee8bee..0340d09aa 100644 --- a/test/cases/optimize/tree-shaking-commonjs/index.js +++ b/test/cases/optimize/tree-shaking-commonjs/index.js @@ -1,5 +1,5 @@ import { test } from "./a"; it("should correctly tree shake star exports", function() { - test.should.be.eql(123); + expect(test).toBe(123); }); diff --git a/test/cases/optimize/tree-shaking-star/index.js b/test/cases/optimize/tree-shaking-star/index.js index 231747efb..479be1363 100644 --- a/test/cases/optimize/tree-shaking-star/index.js +++ b/test/cases/optimize/tree-shaking-star/index.js @@ -2,7 +2,7 @@ import { test } from "./a"; import { func1, func3 } from "./x"; it("should correctly tree shake star exports", function() { - test.should.be.eql(123); - func1().should.be.eql("func1"); - func3().should.be.eql("func3"); + expect(test).toBe(123); + expect(func1()).toBe("func1"); + expect(func3()).toBe("func3"); }); diff --git a/test/cases/optimize/tree-shaking-star2/index.js b/test/cases/optimize/tree-shaking-star2/index.js index b8bb5764b..7b516994a 100644 --- a/test/cases/optimize/tree-shaking-star2/index.js +++ b/test/cases/optimize/tree-shaking-star2/index.js @@ -3,10 +3,10 @@ import { aa as aa2, d } from "./root3"; var root6 = require("./root6"); it("should correctly tree shake star exports", function() { - aa.should.be.eql("aa"); - aa2.should.be.eql("aa"); - d.should.be.eql("d"); - root6.should.be.eql({ + expect(aa).toBe("aa"); + expect(aa2).toBe("aa"); + expect(d).toBe("d"); + expect(root6).toEqual({ aa: "aa", c: "c" }); diff --git a/test/cases/parsing/amd-rename/index.js b/test/cases/parsing/amd-rename/index.js index 42658e5be..be0d7347a 100644 --- a/test/cases/parsing/amd-rename/index.js +++ b/test/cases/parsing/amd-rename/index.js @@ -1,5 +1,5 @@ it("should name require in define correctly", function() { define(["require"], function(require) { - (typeof require).should.be.eql("function"); + expect((typeof require)).toBe("function"); }); }); diff --git a/test/cases/parsing/bom/index.js b/test/cases/parsing/bom/index.js index f10161634..a2bbda8ee 100644 --- a/test/cases/parsing/bom/index.js +++ b/test/cases/parsing/bom/index.js @@ -1,9 +1,9 @@ it("should load a utf-8 file with BOM", function() { var result = require("./bomfile"); - result.should.be.eql("ok"); + expect(result).toEqual("ok"); }); it("should load a css file with BOM", function() { var css = require("!css-loader!./bomfile.css") + ""; - css.should.be.eql("body{color:#abc}"); + expect(css).toBe("body{color:#abc}"); }); diff --git a/test/cases/parsing/browserify/index.js b/test/cases/parsing/browserify/index.js index a1c656ae4..835558569 100644 --- a/test/cases/parsing/browserify/index.js +++ b/test/cases/parsing/browserify/index.js @@ -10,5 +10,5 @@ it("should be able to parse browserified modules (UMD)", function() { },{}]},{},[1]) (1) }); - module.exports.should.be.eql(1234); -}); \ No newline at end of file + expect(module.exports).toBe(1234); +}); diff --git a/test/cases/parsing/chunks/index.js b/test/cases/parsing/chunks/index.js index 8a1afd3ac..641660b86 100644 --- a/test/cases/parsing/chunks/index.js +++ b/test/cases/parsing/chunks/index.js @@ -1,7 +1,7 @@ it("should parse a Coffeescript style function expression in require.ensure", function(done) { require.ensure([], (function(_this) { return function(require) { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }; }(this))); @@ -9,28 +9,28 @@ it("should parse a Coffeescript style function expression in require.ensure", fu it("should parse a bound function expression in require.ensure", function(done) { require.ensure([], function(require) { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }.bind(this)); }); it("should parse a string in require.ensure", function(done) { require.ensure("./file", function(require) { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }); }); it("should parse a string in require.ensure with arrow function expression", function(done) { require.ensure("./file", require => { - require("./file").should.be.eql("ok"); + expect(require("./file")).toBe("ok"); done(); }); }); it("should parse a string in require.ensure with arrow function array expression", function(done) { - require.ensure("./file", require => (require("./file").should.be.eql("ok"), done())); + require.ensure("./file", require => (expect(require("./file")).toBe("ok"), done())); }); diff --git a/test/cases/parsing/class/index.js b/test/cases/parsing/class/index.js index 74e55e418..c58c505fc 100644 --- a/test/cases/parsing/class/index.js +++ b/test/cases/parsing/class/index.js @@ -1,12 +1,12 @@ import X, { A, B } from "./module"; it("should parse classes", function() { - new X().a.should.be.eql("ok"); - new A().a.should.be.eql("ok"); - new B().a.should.be.eql("ok"); + expect(new X().a).toBe("ok"); + expect(new A().a).toBe("ok"); + expect(new B().a).toBe("ok"); }); it("should parse methods", function() { - new X().b().should.be.eql("ok"); - X.c().should.be.eql("ok"); + expect(new X().b()).toBe("ok"); + expect(X.c()).toBe("ok"); }); diff --git a/test/cases/parsing/complex-require/amd.js b/test/cases/parsing/complex-require/amd.js index 020717142..9972aba66 100644 --- a/test/cases/parsing/complex-require/amd.js +++ b/test/cases/parsing/complex-require/amd.js @@ -12,7 +12,7 @@ it("should parse template strings in amd requires", function(done) { ].length; function test (result) { - result.default.should.eql("ok") + expect(result.default).toEqual("ok") if (--pending <= 0) { done() } @@ -31,7 +31,7 @@ it("should parse .concat strings in amd requires", function(done) { ].length; function test (result) { - result.default.should.eql("ok") + expect(result.default).toEqual("ok") if (--pending <= 0) { done() } diff --git a/test/cases/parsing/complex-require/cjs.js b/test/cases/parsing/complex-require/cjs.js index b33adad38..71113b976 100644 --- a/test/cases/parsing/complex-require/cjs.js +++ b/test/cases/parsing/complex-require/cjs.js @@ -12,7 +12,7 @@ it("should parse template strings in require.ensure requires", function(done) { ]; for (var i = 0; i < imports.length; i++) { - imports[i].default.should.eql("ok"); + expect(imports[i].default).toEqual("ok"); } done() }) @@ -31,7 +31,7 @@ it("should parse template strings in sync requires", function() { ]; for (var i = 0; i < imports.length; i++) { - imports[i].default.should.eql("sync"); + expect(imports[i].default).toEqual("sync"); } }) @@ -40,7 +40,7 @@ it("should parse template strings in require.resolve", function() { // Arbitrary assertion; can't use .ok() as it could be 0, // can't use typeof as that depends on webpack config. - require.resolve(`./sync/${name}Test`).should.not.be.undefined(); + expect(require.resolve(`./sync/${name}Test`)).toBeDefined(); }) it("should parse .concat strings in require.ensure requires", function(done) { @@ -55,7 +55,7 @@ it("should parse .concat strings in require.ensure requires", function(done) { ]; for (var i = 0; i < imports.length; i++) { - imports[i].default.should.eql("ok"); + expect(imports[i].default).toEqual("ok"); } done() }) @@ -72,7 +72,7 @@ it("should parse .concat strings in sync requires", function() { ]; for (var i = 0; i < imports.length; i++) { - imports[i].default.should.eql("sync"); + expect(imports[i].default).toEqual("sync"); } }) @@ -81,5 +81,5 @@ it("should parse .concat strings in require.resolve", function() { // Arbitrary assertion; can't use .ok() as it could be 0, // can't use typeof as that depends on webpack config. - require.resolve("./sync/".concat(name, "Test")).should.not.be.undefined(); + expect(require.resolve("./sync/".concat(name, "Test"))).toBeDefined(); }) diff --git a/test/cases/parsing/complex-require/index.js b/test/cases/parsing/complex-require/index.js index c2cb97e48..b93a4e4c1 100644 --- a/test/cases/parsing/complex-require/index.js +++ b/test/cases/parsing/complex-require/index.js @@ -1,5 +1,3 @@ -var should = require('should') - it("should parse template strings in import", function(done) { var name = "abc".split(""); var suffix = "Test"; @@ -10,7 +8,7 @@ it("should parse template strings in import", function(done) { ]) .then(function (imports) { for (var i = 0; i < imports.length; i++) { - imports[i].default.should.eql("ok"); + expect(imports[i].default).toEqual("ok"); } }) .then(function () { done(); }, done) @@ -21,7 +19,7 @@ it("should parse .concat strings in import", function(done) { var suffix = "Test"; import("./abc/".concat(name[0]).concat(name[1]).concat(name[2], "Test")) .then(function (imported) { - imported.default.should.eql("ok"); + expect(imported.default).toEqual("ok"); }) .then(function () { done(); }, done) }); diff --git a/test/cases/parsing/context/index.js b/test/cases/parsing/context/index.js index 6c6c3bf6e..59d7ff966 100644 --- a/test/cases/parsing/context/index.js +++ b/test/cases/parsing/context/index.js @@ -1,28 +1,28 @@ it("should be able to load a file with the require.context method", function() { - require.context("./templates")("./tmpl").should.be.eql("test template"); - (require.context("./././templates"))("./tmpl").should.be.eql("test template"); - (require.context("././templates/.")("./tmpl")).should.be.eql("test template"); - require.context("./loaders/queryloader?dog=bark!./templates?cat=meow")("./tmpl").should.be.eql({ + expect(require.context("./templates")("./tmpl")).toBe("test template"); + expect((require.context("./././templates"))("./tmpl")).toBe("test template"); + expect((require.context("././templates/.")("./tmpl"))).toBe("test template"); + expect(require.context("./loaders/queryloader?dog=bark!./templates?cat=meow")("./tmpl")).toEqual({ resourceQuery: "?cat=meow", query: "?dog=bark", prev: "module.exports = \"test template\";" }); - require . context ( "." + "/." + "/" + "templ" + "ates" ) ( "./subdir/tmpl.js" ).should.be.eql("subdir test template"); - require.context("./templates", true, /./)("xyz").should.be.eql("xyz"); + expect(require . context ( "." + "/." + "/" + "templ" + "ates" ) ( "./subdir/tmpl.js" )).toBe("subdir test template"); + expect(require.context("./templates", true, /./)("xyz")).toBe("xyz"); }); it("should automatically create contexts", function() { var template = "tmpl", templateFull = "./tmpl.js"; var mp = "mp", tmp = "tmp", mpl = "mpl"; - require("./templates/" + template).should.be.eql("test template"); - require("./templates/" + tmp + "l").should.be.eql("test template"); - require("./templates/t" + mpl).should.be.eql("test template"); - require("./templates/t" + mp + "l").should.be.eql("test template"); + expect(require("./templates/" + template)).toBe("test template"); + expect(require("./templates/" + tmp + "l")).toBe("test template"); + expect(require("./templates/t" + mpl)).toBe("test template"); + expect(require("./templates/t" + mp + "l")).toBe("test template"); }); it("should be able to require.resolve with automatical context", function() { var template = "tmpl"; - require.resolve("./templates/" + template).should.be.eql(require.resolve("./templates/tmpl")); + expect(require.resolve("./templates/" + template)).toBe(require.resolve("./templates/tmpl")); }); it("should be able to use renaming combined with a context", function() { @@ -30,22 +30,22 @@ it("should be able to use renaming combined with a context", function() { require = function () {}; require("fail"); var template = "tmpl"; - renamedRequire("./templates/" + template).should.be.eql("test template"); + expect(renamedRequire("./templates/" + template)).toBe("test template"); }); it("should compile an empty context", function() { var x = "xxx"; - (function() { + expect(function() { require("./templates/notExisting" + x); - }).should.throw(/xxx/); + }).toThrowError(/xxx/); }); it("should execute an empty context", function() { var context; - (function() { + expect(function() { context = require.context("./templates/", true, /^\.\/notExisting/); - }).should.not.throw(); - (function() { + }).not.toThrowError(); + expect(function() { context(""); - }).should.throw(); + }).toThrowError(); }); diff --git a/test/cases/parsing/es6.nominimize/index.js b/test/cases/parsing/es6.nominimize/index.js index 8d77c7059..70031b4ca 100644 --- a/test/cases/parsing/es6.nominimize/index.js +++ b/test/cases/parsing/es6.nominimize/index.js @@ -19,21 +19,21 @@ it("should parse classes", function() { var x = new MyClass(); - x.a.should.be.eql("a"); - x.func().should.be.eql("b"); - x.c().should.be.eql("c"); + expect(x.a).toBe("a"); + expect(x.func()).toBe("b"); + expect(x.c()).toBe("c"); }); it("should parse spread operator"/*, function() { - [0, ...require("./array")].should.be.eql([0, 1, 2, 3]); - ({z: 0, ...require("./object")}).should.be.eql({z: 0, a: 1, b: 2, c: 3}); + expect([0, ...require("./array")]).toEqual([0, 1, 2, 3]); + expect(({z: 0, ...require("./object")})).toEqual({z: 0, a: 1, b: 2, c: 3}); }*/); it("should parse arrow function", function() { - (() => require("./a"))().should.be.eql("a"); - (() => { + expect((() => require("./a"))()).toBe("a"); + expect((() => { return require("./a"); - })().should.be.eql("a"); + })()).toBe("a"); require.ensure([], () => { require("./a"); }); @@ -53,8 +53,8 @@ it("should parse template literals", function() { } var x = `a${require("./b")}c`; var y = tag`a${require("./b")}c`; - x.should.be.eql("abc"); - y.should.be.eql("b"); + expect(x).toBe("abc"); + expect(y).toBe("b"); }) it("should parse generators and yield", function() { @@ -63,7 +63,7 @@ it("should parse generators and yield", function() { yield require("./b"); } var x = gen(); - x.next().value.should.be.eql("a"); - x.next().value.should.be.eql("b"); - x.next().done.should.be.eql(true); + expect(x.next().value).toBe("a"); + expect(x.next().value).toBe("b"); + expect(x.next().done).toBe(true); }) diff --git a/test/cases/parsing/evaluate/index.js b/test/cases/parsing/evaluate/index.js index 5f8cc6912..e2762e5c5 100644 --- a/test/cases/parsing/evaluate/index.js +++ b/test/cases/parsing/evaluate/index.js @@ -7,7 +7,7 @@ it("should evaluate null", function() { if("shouldn't evaluate expression", function() { var value = ""; var x = (value + "") ? "fail" : "ok"; - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); it("should short-circuit evaluating", function() { @@ -18,5 +18,5 @@ it("should short-circuit evaluating", function() { it("should evaluate __dirname and __resourceQuery with replace and substr", function() { var result = require("./resourceQuery/index?" + __dirname); - result.should.be.eql("?resourceQuery"); + expect(result).toEqual("?resourceQuery"); }); diff --git a/test/cases/parsing/extract-amd.nominimize/index.js b/test/cases/parsing/extract-amd.nominimize/index.js index a29bd7578..a79383e00 100644 --- a/test/cases/parsing/extract-amd.nominimize/index.js +++ b/test/cases/parsing/extract-amd.nominimize/index.js @@ -1,5 +1,3 @@ -var should = require("should"); - it("should parse fancy function calls with arrow functions", function() { ("function"==typeof define && define.amd ? define : @@ -7,70 +5,70 @@ it("should parse fancy function calls with arrow functions", function() { )(["./constructor"], (c) => { return new c(1324); }); - module.exports.should.have.property("value").be.eql(1324); + expect(module.exports).toHaveProperty("value", 1324); (("function"==typeof define && define.amd ? define : (e,t) => {return t()} )(["./constructor"], (c) => { return new c(4231); })); - module.exports.should.have.property("value").be.eql(4231); + expect(module.exports).toHaveProperty("value", 4231); }); it("should parse fancy AMD calls with arrow functions", function() { require("./constructor ./a".split(" ")); require("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), (require, module, exports, constructor, a) => { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); define("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), (require, module, exports, constructor, a) => { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); }); it("should be able to use AMD-style require with arrow functions", function(done) { var template = "b"; require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], (circular, testTemplate, circular2) => { - circular.should.be.eql(1); - circular2.should.be.eql(1); - testTemplate.should.be.eql("b"); + expect(circular).toBe(1); + expect(circular2).toBe(1); + expect(testTemplate).toBe("b"); done(); }); }); it("should be able to use require.js-style define with arrow functions", function(done) { define("name", ["./circular"], (circular) => { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); it("should be able to use require.js-style define, optional dependencies, not exist, with arrow function", function(done) { define("name", ["./optional"], (optional) => { - should(optional.b).not.exist; + expect(optional.b).toBeFalsy(); done(); }); }); it("should be able to use require.js-style define, special string, with arrow function", function(done) { define(["require"], (require) => { - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); done(); }); }); it("should be able to use require.js-style define, without name, with arrow function", function(done) { true && define(["./circular"], (circular) => { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); @@ -91,17 +89,17 @@ it("should offer AMD-style define for CommonJs with arrow function", function(do var _test_exports = exports; var _test_module = module; define((require, exports, module) => { - (typeof require).should.be.eql("function"); - exports.should.be.equal(_test_exports); - module.should.be.equal(_test_module); - require("./circular").should.be.eql(1); + expect((typeof require)).toBe("function"); + expect(exports).toBe(_test_exports); + expect(module).toBe(_test_module); + expect(require("./circular")).toBe(1); done(); }); }); it("should pull in all dependencies of an AMD module with arrow function", function(done) { define((require) => { - require("./amdmodule").should.be.eql("a"); + expect(require("./amdmodule")).toBe("a"); done(); }); }); @@ -109,9 +107,9 @@ it("should pull in all dependencies of an AMD module with arrow function", funct it("should create a chunk for require.js require, with arrow function", function(done) { var sameTick = true; require(["./c"], (c) => { - sameTick.should.be.eql(false); - c.should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(sameTick).toBe(false); + expect(c).toBe("c"); + expect(require("./d")).toBe("d"); done(); }); sameTick = false; diff --git a/test/cases/parsing/extract-amd/index.js b/test/cases/parsing/extract-amd/index.js index 4299ede63..13cc0d3f0 100644 --- a/test/cases/parsing/extract-amd/index.js +++ b/test/cases/parsing/extract-amd/index.js @@ -1,5 +1,3 @@ -var should = require("should"); - it("should parse fancy function calls", function() { ("function"==typeof define && define.amd ? define : @@ -7,70 +5,70 @@ it("should parse fancy function calls", function() { )(["./constructor"], function(c) { return new c(1324); }); - module.exports.should.have.property("value").be.eql(1324); + expect(module.exports).toHaveProperty("value", 1324); (("function"==typeof define && define.amd ? define : function(e,t){return t()} )(["./constructor"], function(c) { return new c(4231); })); - module.exports.should.have.property("value").be.eql(4231); + expect(module.exports).toHaveProperty("value", 4231); }); it("should parse fancy AMD calls", function() { require("./constructor ./a".split(" ")); require("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), function(require, module, exports, constructor, a) { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); define("-> module module exports *constructor *a".replace("module", "require").substr(3).replace(/\*/g, "./").split(" "), function(require, module, exports, constructor, a) { - (typeof require).should.be.eql("function"); - (typeof module).should.be.eql("object"); - (typeof exports).should.be.eql("object"); - (typeof require("./constructor")).should.be.eql("function"); - (typeof constructor).should.be.eql("function"); - a.should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect((typeof module)).toBe("object"); + expect((typeof exports)).toBe("object"); + expect((typeof require("./constructor"))).toBe("function"); + expect((typeof constructor)).toBe("function"); + expect(a).toBe("a"); }); }); it("should be able to use AMD-style require", function(done) { var template = "b"; require(["./circular", "./templates/" + template, true ? "./circular" : "fail"], function(circular, testTemplate, circular2) { - circular.should.be.eql(1); - circular2.should.be.eql(1); - testTemplate.should.be.eql("b"); + expect(circular).toBe(1); + expect(circular2).toBe(1); + expect(testTemplate).toBe("b"); done(); }); }); it("should be able to use require.js-style define", function(done) { define("name", ["./circular"], function(circular) { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); it("should be able to use require.js-style define, optional dependencies, not exist", function(done) { define("name", ["./optional"], function(optional) { - should(optional.b).not.exist; + expect(optional.b).toBeFalsy(); done(); }); }); it("should be able to use require.js-style define, special string", function(done) { define(["require"], function(require) { - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); done(); }); }); it("should be able to use require.js-style define, without name", function(done) { true && define(["./circular"], function(circular) { - circular.should.be.eql(1); + expect(circular).toBe(1); done(); }); }); @@ -107,12 +105,12 @@ it("should be able to use require.js-style define, with an object", function() { true && define("blaaa", obj); - module.exports.should.be.equal(obj); + expect(module.exports).toBe(obj); module.exports = null; define("blaaa", obj); - module.exports.should.be.equal(obj); + expect(module.exports).toBe(obj); module.exports = null; }); @@ -120,10 +118,10 @@ it("should offer AMD-style define for CommonJs", function(done) { var _test_exports = exports; var _test_module = module; define(function(require, exports, module) { - (typeof require).should.be.eql("function"); - exports.should.be.equal(_test_exports); - module.should.be.equal(_test_module); - require("./circular").should.be.eql(1); + expect((typeof require)).toBe("function"); + expect(exports).toBe(_test_exports); + expect(module).toBe(_test_module); + expect(require("./circular")).toBe(1); done(); }); }); @@ -140,7 +138,7 @@ it("should be able to use AMD require without function expression (empty array)" it("should be able to use AMD require without function expression", function(done) { require(["./circular"], fn); function fn(c) { - c.should.be.eql(1); + expect(c).toBe(1); done(); } }); @@ -148,9 +146,9 @@ it("should be able to use AMD require without function expression", function(don it("should create a chunk for require.js require", function(done) { var sameTick = true; require(["./c"], function(c) { - sameTick.should.be.eql(false); - c.should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(sameTick).toBe(false); + expect(c).toBe("c"); + expect(require("./d")).toBe("d"); done(); }); sameTick = false; @@ -170,34 +168,34 @@ it("should not fail #138", function(done) { it("should parse a bound function expression 1", function(done) { define(function(a, require, exports, module) { - a.should.be.eql(123); - (typeof require).should.be.eql("function"); - require("./a").should.be.eql("a"); + expect(a).toBe(123); + expect((typeof require)).toBe("function"); + expect(require("./a")).toBe("a"); done(); }.bind(null, 123)); }); it("should parse a bound function expression 2", function(done) { define("name", function(a, require, exports, module) { - a.should.be.eql(123); - (typeof require).should.be.eql("function"); - require("./a").should.be.eql("a"); + expect(a).toBe(123); + expect((typeof require)).toBe("function"); + expect(require("./a")).toBe("a"); done(); }.bind(null, 123)); }); it("should parse a bound function expression 3", function(done) { define(["./a"], function(number, a) { - number.should.be.eql(123); - a.should.be.eql("a"); + expect(number).toBe(123); + expect(a).toBe("a"); done(); }.bind(null, 123)); }); it("should parse a bound function expression 4", function(done) { define("name", ["./a"], function(number, a) { - number.should.be.eql(123); - a.should.be.eql("a"); + expect(number).toBe(123); + expect(a).toBe("a"); done(); }.bind(null, 123)); }); @@ -205,21 +203,21 @@ it("should parse a bound function expression 4", function(done) { it("should not fail issue #138 second", function() { (function(define, global) { 'use strict'; define(function (require) { - (typeof require).should.be.eql("function"); - require("./a").should.be.eql("a"); + expect((typeof require)).toBe("function"); + expect(require("./a")).toBe("a"); return "#138 2."; }); })(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); }, this); - module.exports.should.be.eql("#138 2."); + expect(module.exports).toBe("#138 2."); }); it("should parse an define with empty array and object", function() { var obj = {ok: 95476}; define([], obj); - module.exports.should.be.eql(obj); + expect(module.exports).toBe(obj); }); it("should parse an define with object", function() { var obj = {ok: 76243}; define(obj); - module.exports.should.be.eql(obj); + expect(module.exports).toBe(obj); }); diff --git a/test/cases/parsing/extract-require/index.js b/test/cases/parsing/extract-require/index.js index b3167f229..7550c443b 100644 --- a/test/cases/parsing/extract-require/index.js +++ b/test/cases/parsing/extract-require/index.js @@ -1,39 +1,39 @@ -var should = require("should"); - function testCase(number) { - require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule").should.be.eql("file" + number); - require( + expect(require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule")).toBe("file" + number); + expect(require( number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule" - ).should.be.eql("file" + number); + )).toBe("file" + number); } it("should parse complex require calls", function() { - should.strictEqual(new(require("./constructor"))(1234).value, 1234, "Parse require in new(…) should work"); - should.strictEqual(new ( require ( "./constructor" ) ) ( 1234 ) .value, 1234, "Parse require in new(…) should work, with spaces"); + // "Parse require in new(...) should work" + expect(new(require("./constructor"))(1234).value).toBe(1234); + // "Parse require in new(...) should work, with spaces" + expect(new ( require ( "./constructor" ) ) ( 1234 ) .value).toBe(1234); }); it("should let the user hide the require function", function() { - (function(require) { return require; }(1234)).should.be.eql(1234); + expect((function(require) { return require; })(1234)).toBe(1234); function testFunc(abc, require) { return require; } - testFunc(333, 678).should.be.eql(678); + expect(testFunc(333, 678)).toBe(678); (function() { var require = 123; - require.should.be.eql(123); + expect(require).toBe(123); }()); (function() { function require() { return 123; }; - require("error").should.be.eql(123); + expect(require("error")).toBe(123); }()); (function() { var module = 1233; - module.should.be.eql(1233); + expect(module).toBe(1233); }()); }); @@ -42,3 +42,4 @@ it("should not create a context for the ?: operator", function() { testCase(2); testCase(3); }); + diff --git a/test/cases/parsing/filename/index.js b/test/cases/parsing/filename/index.js index 71357682d..525244fe9 100644 --- a/test/cases/parsing/filename/index.js +++ b/test/cases/parsing/filename/index.js @@ -1,11 +1,11 @@ it("should be a string (__filename)", function() { - __filename.should.be.type("string"); + expect(__filename).toBeTypeOf("string"); var f = __filename; - f.should.be.type("string"); + expect(f).toBeTypeOf("string"); }); it("should be a string (__dirname)", function() { - __dirname.should.be.type("string"); + expect(__dirname).toBeTypeOf("string"); var d = __dirname; - d.should.be.type("string"); -}); \ No newline at end of file + expect(d).toBeTypeOf("string"); +}); diff --git a/test/cases/parsing/harmony-commonjs-mix/index.js b/test/cases/parsing/harmony-commonjs-mix/index.js index 6383d861f..bc390fdf5 100644 --- a/test/cases/parsing/harmony-commonjs-mix/index.js +++ b/test/cases/parsing/harmony-commonjs-mix/index.js @@ -1,4 +1,4 @@ it("should result in a warning when using module.exports in harmony module", function() { var x = require("./module1"); - x.should.be.eql({default: 1234}); + expect(x).toEqual({default: 1234}); }); diff --git a/test/cases/parsing/harmony-commonjs-mix/module1.js b/test/cases/parsing/harmony-commonjs-mix/module1.js index ab456ad0a..aa3681a49 100644 --- a/test/cases/parsing/harmony-commonjs-mix/module1.js +++ b/test/cases/parsing/harmony-commonjs-mix/module1.js @@ -1,19 +1,19 @@ import "./module"; -(function() { +expect(function() { module.exports = 1; -}).should.throw(); +}).toThrowError(); -(typeof module.exports).should.be.eql("undefined"); +expect((typeof module.exports)).toBe("undefined"); -(typeof define).should.be.eql("undefined"); -(function() { +expect((typeof define)).toBe("undefined"); +expect(function() { define(function() {}) -}).should.throw(/define is not defined/); +}).toThrowError(/define is not defined/); export default 1234; if(eval("typeof exports !== \"undefined\"")) { // exports is node.js exports and not webpacks - Object.keys(exports).should.be.eql([]); + expect(Object.keys(exports)).toEqual([]); } diff --git a/test/cases/parsing/harmony-commonjs/index.js b/test/cases/parsing/harmony-commonjs/index.js index 187eefc12..fc9dbe295 100644 --- a/test/cases/parsing/harmony-commonjs/index.js +++ b/test/cases/parsing/harmony-commonjs/index.js @@ -2,7 +2,7 @@ import { x, y } from "./b"; it("should pass when required by CommonJS module", function () { var test1 = require('./a').default; - test1().should.be.eql("OK"); + expect(test1()).toBe("OK"); }); it("should pass when use babeljs transpiler", function() { @@ -13,18 +13,18 @@ it("should pass when use babeljs transpiler", function() { var _test2 = _interopRequireDefault(_test); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var test2 = (0, _test2.default)(); - test2.should.be.eql("OK"); + expect(test2).toBe("OK"); }); it("should double reexport from non-harmony modules correctly", function() { - y.should.be.eql("y"); - x.should.be.eql("x"); + expect(y).toBe("y"); + expect(x).toBe("x"); }); import { a, b } from "./reexport" it("should be possible to reexport a module with unknown exports", function() { - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(a).toBe("a"); + expect(b).toBe("b"); }); diff --git a/test/cases/parsing/harmony-duplicate-export/index.js b/test/cases/parsing/harmony-duplicate-export/index.js index 54bbf91db..b9be967f8 100644 --- a/test/cases/parsing/harmony-duplicate-export/index.js +++ b/test/cases/parsing/harmony-duplicate-export/index.js @@ -15,21 +15,21 @@ var y6 = require("./6?b").x; var y7 = require("./7?b").x; it("should not overwrite when using star export (known exports)", function() { - x1.should.be.eql("1"); - x2.should.be.eql("1"); - x3.should.be.eql("a"); - x4.should.be.eql("b"); - x5.should.be.eql("c"); - x6.should.be.eql("a"); - x7.should.be.eql("d"); + expect(x1).toBe("1"); + expect(x2).toBe("1"); + expect(x3).toBe("a"); + expect(x4).toBe("b"); + expect(x5).toBe("c"); + expect(x6).toBe("a"); + expect(x7).toBe("d"); }); it("should not overwrite when using star export (unknown exports)", function() { - y1.should.be.eql("1"); - y2.should.be.eql("1"); - y3.should.be.eql("a"); - y4.should.be.eql("b"); - y5.should.be.eql("c"); - y6.should.be.eql("a"); - y7.should.be.eql("d"); + expect(y1).toBe("1"); + expect(y2).toBe("1"); + expect(y3).toBe("a"); + expect(y4).toBe("b"); + expect(y5).toBe("c"); + expect(y6).toBe("a"); + expect(y7).toBe("d"); }); diff --git a/test/cases/parsing/harmony-edge-cases/index.js b/test/cases/parsing/harmony-edge-cases/index.js index ff252435b..965fb3150 100644 --- a/test/cases/parsing/harmony-edge-cases/index.js +++ b/test/cases/parsing/harmony-edge-cases/index.js @@ -3,9 +3,9 @@ import x, { b } from "./b"; import { c, d } from "./fake-reexport"; it("should be able to use exported function", function() { - a.should.be.eql("ok"); - b.should.be.eql("ok"); - x().should.be.eql("ok"); - c.should.be.eql("ok"); - d.should.be.eql("ok"); + expect(a).toBe("ok"); + expect(b).toBe("ok"); + expect(x()).toBe("ok"); + expect(c).toBe("ok"); + expect(d).toBe("ok"); }); diff --git a/test/cases/parsing/harmony-export-hoist/index.js b/test/cases/parsing/harmony-export-hoist/index.js index 8ae8ff1e9..fd5748c9d 100644 --- a/test/cases/parsing/harmony-export-hoist/index.js +++ b/test/cases/parsing/harmony-export-hoist/index.js @@ -2,8 +2,8 @@ it("should hoist exports", function() { var result = require("./foo").default; - (typeof result.foo).should.have.eql("function"); - (typeof result.foo2).should.have.eql("function"); - result.foo().should.be.eql("ok"); - result.foo2().should.be.eql("ok"); + expect(typeof result.foo).toEqual("function"); + expect(typeof result.foo2).toEqual("function"); + expect(result.foo()).toBe("ok"); + expect(result.foo2()).toBe("ok"); }); diff --git a/test/cases/parsing/harmony-export-import-specifier/index.js b/test/cases/parsing/harmony-export-import-specifier/index.js index b8d8e5094..e0a4d16b1 100644 --- a/test/cases/parsing/harmony-export-import-specifier/index.js +++ b/test/cases/parsing/harmony-export-import-specifier/index.js @@ -1,8 +1,8 @@ "use strict"; -import {x, y} from "./a"; +import { x, y } from "./a"; it("namespace export as from commonjs should override named export", function() { - x.should.be.eql(1); - y.should.be.eql(3); + expect(x).toBe(1); + expect(y).toBe(3); }); diff --git a/test/cases/parsing/harmony-export-precedence/index.js b/test/cases/parsing/harmony-export-precedence/index.js index 83a1181a8..dfdaf6683 100644 --- a/test/cases/parsing/harmony-export-precedence/index.js +++ b/test/cases/parsing/harmony-export-precedence/index.js @@ -3,19 +3,19 @@ import { a, b, c, d, e } from "./a"; import defaultImport from "./a"; it("should prefer local exports", function() { - a().should.be.eql("a1"); - e.should.be.eql("e1"); + expect(a()).toBe("a1"); + expect(e).toBe("e1"); }); it("should prefer indirect exports over star exports", function() { - b.should.be.eql("b2"); - d.should.be.eql("d2"); + expect(b).toBe("b2"); + expect(d).toBe("d2"); }); it("should use star exports", function() { - c.should.be.eql("c3"); + expect(c).toBe("c3"); }); it("should not export default via star export", function() { - (typeof defaultImport).should.be.eql("undefined"); + expect((typeof defaultImport)).toBe("undefined"); }); diff --git a/test/cases/parsing/harmony-import-export-order/index.js b/test/cases/parsing/harmony-import-export-order/index.js index 3c0e34d85..4ba8b05c8 100644 --- a/test/cases/parsing/harmony-import-export-order/index.js +++ b/test/cases/parsing/harmony-import-export-order/index.js @@ -3,8 +3,8 @@ it("should process imports of star exports in the correct order", function() { tracker.list.length = 0; delete require.cache[require.resolve("./c")]; var c = require("./c"); - tracker.list.should.be.eql(["a", "b", "c"]); - c.ax.should.be.eql("ax"); - c.bx.should.be.eql("ax"); - c.cx.should.be.eql("ax"); + expect(tracker.list).toEqual(["a", "b", "c"]); + expect(c.ax).toBe("ax"); + expect(c.bx).toBe("ax"); + expect(c.cx).toBe("ax"); }); diff --git a/test/cases/parsing/harmony-import-targets/index.js b/test/cases/parsing/harmony-import-targets/index.js index 66b1a645f..c87e1952f 100644 --- a/test/cases/parsing/harmony-import-targets/index.js +++ b/test/cases/parsing/harmony-import-targets/index.js @@ -1,9 +1,9 @@ import {x, f} from "./x"; it("should import into object literal", function() { - ({ x: x }).should.be.eql({x: 1}); + (expect({ x: x })).toEqual({x: 1}); var obj = { x: x }; - obj.should.be.eql({x: 1}); + expect(obj).toEqual({x: 1}); }); function func(z) { @@ -11,21 +11,21 @@ function func(z) { } it("should import into function argument", function() { - func(x).should.be.eql(1); - f(x).should.be.eql(1); - func({x:x}).should.be.eql({x:1}); - f({x:x}).should.be.eql({x:1}); + expect(func(x)).toBe(1); + expect(f(x)).toBe(1); + expect(func({x:x})).toEqual({x:1}); + expect(f({x:x})).toEqual({x:1}); var y = f(x); - y.should.be.eql(1); + expect(y).toBe(1); y = function() { return x; }; - y().should.be.eql(1); + expect(y()).toBe(1); }); it("should import into array literal", function() { - ([x, f(2)]).should.be.eql([1, 2]); - ([{ + expect([x, f(2)]).toEqual([1, 2]); + expect([{ value: x - }]).should.be.eql([{ value: x }]); + }]).toEqual([{ value: x }]); }); diff --git a/test/cases/parsing/harmony-injecting-order/index.js b/test/cases/parsing/harmony-injecting-order/index.js index 88d344b69..e61841e8c 100644 --- a/test/cases/parsing/harmony-injecting-order/index.js +++ b/test/cases/parsing/harmony-injecting-order/index.js @@ -1,3 +1,3 @@ it("should inject variables before exporting", function() { - require("./file").f().should.be.eql({}); + expect(require("./file").f()).toEqual({}); }); diff --git a/test/cases/parsing/harmony-spec/index.js b/test/cases/parsing/harmony-spec/index.js index d4e12cddc..59a1517ab 100644 --- a/test/cases/parsing/harmony-spec/index.js +++ b/test/cases/parsing/harmony-spec/index.js @@ -6,33 +6,33 @@ import cycleValue from "./export-cycle-a"; import { data } from "./self-cycle"; it("should establish live binding of values", function() { - value.should.be.eql(0); + expect(value).toBe(0); add(2); - value.should.be.eql(2); + expect(value).toBe(2); }); it("should establish live binding of values with transpiled es5 module", function() { - value2.should.be.eql(0); + expect(value2).toBe(0); add2(5); - value2.should.be.eql(5); + expect(value2).toBe(5); }); it("should allow to use eval with exports", function() { - valueEval.should.be.eql(0); + expect(valueEval).toBe(0); evalInModule("value = 5"); - valueEval.should.be.eql(5); + expect(valueEval).toBe(5); }); it("should execute modules in the correct order", function() { - getLog().should.be.eql(["a", "b", "c"]); + expect(getLog()).toEqual(["a", "b", "c"]); }); it("should bind exports before the module executes", function() { - cycleValue.should.be.eql(true); + expect(cycleValue).toBe(true); }); it("should allow to import live variables from itself", function() { - data.should.be.eql([undefined, 1, 2]); + expect(data).toEqual([undefined, 1, 2]); }); import { value as valueEval, evalInModule } from "./eval"; diff --git a/test/cases/parsing/harmony-tdz/index.js b/test/cases/parsing/harmony-tdz/index.js index a033014f0..0f2ef06aa 100644 --- a/test/cases/parsing/harmony-tdz/index.js +++ b/test/cases/parsing/harmony-tdz/index.js @@ -1,8 +1,8 @@ import value, { exception } from "./module"; it("should have a TDZ for exported const values", function() { - (typeof exception).should.be.eql("object"); - exception.should.be.instanceof(Error); - exception.message.should.match(/ is not defined$/); - value.should.be.eql("value"); + expect((typeof exception)).toBe("object"); + expect(exception).toBeInstanceOf(Error); + expect(exception.message).toMatch(/ is not defined$/); + expect(value).toBe("value"); }); diff --git a/test/cases/parsing/harmony-this/index.js b/test/cases/parsing/harmony-this/index.js index 9a142de00..0f350bd05 100644 --- a/test/cases/parsing/harmony-this/index.js +++ b/test/cases/parsing/harmony-this/index.js @@ -7,11 +7,11 @@ import * as abc from "./abc"; function x() { throw new Error("should not be executed"); } it("should have this = undefined on imported non-strict functions", function() { x - d().should.be.eql("undefined"); + expect(d()).toBe("undefined"); x - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); x - B().should.be.eql("undefined"); + expect(B()).toBe("undefined"); }); import C2, { C } from "./new"; @@ -20,9 +20,9 @@ import * as New from "./new"; it("should be possible to use new correctly", function() { x - new C().should.match({ok: true}); + expect(new C()).toEqual({ok: true}); x - new C2().should.match({ok: true}); + expect(new C2()).toEqual({ok: true}); x - new New.C().should.match({ok: true}); + expect(new New.C()).toEqual({ok: true}); }); diff --git a/test/cases/parsing/harmony/index.js b/test/cases/parsing/harmony/index.js index 32117f23d..54a7a555d 100644 --- a/test/cases/parsing/harmony/index.js +++ b/test/cases/parsing/harmony/index.js @@ -26,89 +26,89 @@ import "unused"; it("should import a default export from a module", function() { - defaultExport.should.be.eql("def"); + expect(defaultExport).toBe("def"); }); it("should import an identifier from a module", function() { - a.should.be.eql("a"); - B.should.be.eql("b"); + expect(a).toBe("a"); + expect(B).toBe("b"); }); it("should import a whole module", function() { - abc.a.should.be.eql("a"); - abc.b.should.be.eql("b"); - abc.c.should.be.eql("c"); - abc.d.c.should.be.eql("c"); - abc.e.should.be.eql("c"); + expect(abc.a).toBe("a"); + expect(abc.b).toBe("b"); + expect(abc.c).toBe("c"); + expect(abc.d.c).toBe("c"); + expect(abc.e).toBe("c"); var copy = (function(a) { return a; }(abc)); - copy.a.should.be.eql("a"); - copy.b.should.be.eql("b"); - copy.c.should.be.eql("c"); - copy.d.c.should.be.eql("c"); - copy.e.should.be.eql("c"); - (typeof abc).should.be.eql("object"); + expect(copy.a).toBe("a"); + expect(copy.b).toBe("b"); + expect(copy.c).toBe("c"); + expect(copy.d.c).toBe("c"); + expect(copy.e).toBe("c"); + expect((typeof abc)).toBe("object"); }); it("should export functions", function() { - fn.should.have.type("function"); - fn().should.be.eql("fn"); - (fn === fn).should.be.eql(true); + expect(fn).toBeTypeOf("function"); + expect(fn()).toBe("fn"); + expect((fn === fn)).toBe(true); }); it("should multiple variables with one statement", function() { - one.should.be.eql("one"); - two.should.be.eql("two"); + expect(one).toBe("one"); + expect(two).toBe("two"); }); it("should still be able to use exported stuff", function() { - test1.should.be.eql("fn"); - test2.should.be.eql("two"); + expect(test1).toBe("fn"); + expect(test2).toBe("two"); }); it("should reexport a module", function() { - rea.should.be.eql("a"); - reb.should.be.eql("b"); - rec.should.be.eql("c"); - reo.should.be.eql("one"); - retwo.should.be.eql("two"); - rea2.should.be.eql("a"); + expect(rea).toBe("a"); + expect(reb).toBe("b"); + expect(rec).toBe("c"); + expect(reo).toBe("one"); + expect(retwo).toBe("two"); + expect(rea2).toBe("a"); }); it("should support circular dependencies", function() { - threeIsOdd.should.be.eql(true); - even(4).should.be.eql(true); + expect(threeIsOdd).toBe(true); + expect(even(4)).toBe(true); }); it("should support export specifier", function() { - specA.should.be.eql(1); - specB.should.be.eql(2); + expect(specA).toBe(1); + expect(specB).toBe(2); }); it("should be able to import commonjs", function() { function x() { throw new Error("should not be executed"); } // next line doesn't end with semicolon x - Thing.should.have.type("function"); + expect(Thing).toBeTypeOf("function"); x - Thing().should.be.eql("thing"); + expect(Thing()).toBe("thing"); x - Other.should.be.eql("other"); + expect(Other).toBe("other"); - Thing2.should.have.type("function"); - new Thing2().value.should.be.eql("thing"); - Other2.should.be.eql("other"); - Thing3().should.be.eql("thing"); + expect(Thing2).toBeTypeOf("function"); + expect(new Thing2().value).toBe("thing"); + expect(Other2).toBe("other"); + expect(Thing3()).toBe("thing"); }); it("should be able to import commonjs with star import", function() { var copyOfCommonjs = commonjs; - commonjs().should.be.eql("thing"); - commonjs.Other.should.be.eql("other"); - copyOfCommonjs().should.be.eql("thing"); - copyOfCommonjs.Other.should.be.eql("other"); + expect(commonjs()).toBe("thing"); + expect(commonjs.Other).toBe("other"); + expect(copyOfCommonjs()).toBe("thing"); + expect(copyOfCommonjs.Other).toBe("other"); var copyOfCommonjsTrans = commonjsTrans; - new commonjsTrans.default().value.should.be.eql("thing"); - commonjsTrans.Other.should.be.eql("other"); - new copyOfCommonjsTrans.default().value.should.be.eql("thing"); - copyOfCommonjsTrans.Other.should.be.eql("other"); + expect(new commonjsTrans.default().value).toBe("thing"); + expect(commonjsTrans.Other).toBe("other"); + expect(new copyOfCommonjsTrans.default().value).toBe("thing"); + expect(copyOfCommonjsTrans.Other).toBe("other"); }); diff --git a/test/cases/parsing/hot-hash/index.js b/test/cases/parsing/hot-hash/index.js index ab17273e7..c15a7483e 100644 --- a/test/cases/parsing/hot-hash/index.js +++ b/test/cases/parsing/hot-hash/index.js @@ -1,7 +1,7 @@ if(module.hot) { it("should have __webpack_hash__", function() { - (typeof __webpack_hash__).should.be.type("string"); - __webpack_hash__.should.match(/^[0-9a-f]{20}$/); + expect(typeof __webpack_hash__).toBeTypeOf("string"); + expect(__webpack_hash__).toMatch(/^[0-9a-f]{20}$/); }); } else { it("should have __webpack_hash__ (disabled)", function() { diff --git a/test/cases/parsing/inject-free-vars/index.js b/test/cases/parsing/inject-free-vars/index.js index 235dbb50f..043b3e4f3 100644 --- a/test/cases/parsing/inject-free-vars/index.js +++ b/test/cases/parsing/inject-free-vars/index.js @@ -1,18 +1,18 @@ it("should inject the module object into a chunk (AMD1)", function(done) { require([], function() { - module.webpackPolyfill.should.be.eql(1); + expect(module.webpackPolyfill).toBe(1); done(); }); }); it("should inject the module object into a chunk (AMD2)", function() { require([module.webpackPolyfill ? "./x1" : "./fail"]); - module.webpackPolyfill.should.be.eql(1); + expect(module.webpackPolyfill).toBe(1); }); it("should inject the module object into a chunk (ensure)", function(done) { require.ensure([], function(require) { - module.webpackPolyfill.should.be.eql(1); + expect(module.webpackPolyfill).toBe(1); done(); }); }); diff --git a/test/cases/parsing/issue-1600/index.js b/test/cases/parsing/issue-1600/index.js index 42d58a49c..bebd65238 100644 --- a/test/cases/parsing/issue-1600/index.js +++ b/test/cases/parsing/issue-1600/index.js @@ -1,5 +1,5 @@ import fn from './file'; it("should compile correctly", function() { - fn().should.be.eql(1); + expect(fn()).toBe(1); }); diff --git a/test/cases/parsing/issue-2019/index.js b/test/cases/parsing/issue-2019/index.js index 04c1ffaa7..186534811 100644 --- a/test/cases/parsing/issue-2019/index.js +++ b/test/cases/parsing/issue-2019/index.js @@ -1,4 +1,4 @@ it("should not fail on default export before export", function() { - require("./file").default.should.be.eql("default"); - require("./file").CONSTANT.should.be.eql("const"); -}); \ No newline at end of file + expect(require("./file").default).toBe("default"); + expect(require("./file").CONSTANT).toBe("const"); +}); diff --git a/test/cases/parsing/issue-2050/index.js b/test/cases/parsing/issue-2050/index.js index 85754b23b..640880bf3 100644 --- a/test/cases/parsing/issue-2050/index.js +++ b/test/cases/parsing/issue-2050/index.js @@ -1,5 +1,5 @@ it("should support multiple reexports", function() { - require("./x").should.be.eql({ + expect(require("./x")).toEqual({ xa: "a", xb: "b", xc: "c", diff --git a/test/cases/parsing/issue-2084/index.js b/test/cases/parsing/issue-2084/index.js index a9bc27f13..04383d5d6 100644 --- a/test/cases/parsing/issue-2084/index.js +++ b/test/cases/parsing/issue-2084/index.js @@ -7,8 +7,8 @@ it("should bind this context on require callback", function(done) { runWithThis({ok: true}, function() { require([], function() { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); @@ -19,9 +19,9 @@ it("should bind this context on require callback (loaded)", function(done) { runWithThis({ok: true}, function() { require(["./load.js"], function(load) { try { - require("./file").should.be.eql("file"); - load.should.be.eql("load"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(load).toBe("load"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); @@ -32,8 +32,8 @@ it("should bind this context on require callback (foo)", function(done) { var foo = {ok: true}; require([], function(load) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(foo)); @@ -43,9 +43,9 @@ it("should bind this context on require callback (foo, loaded)", function(done) var foo = {ok: true}; require(["./load.js"], function(load) { try { - require("./file").should.be.eql("file"); - load.should.be.eql("load"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(load).toBe("load"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(foo)); @@ -55,8 +55,8 @@ it("should bind this context on require callback (foo)", function(done) { runWithThis({ok: true}, function() { require([], function(load) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: {ok: true}}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: {ok: true}}); done(); } catch(e) { done(e); } }.bind({ok: this})); @@ -67,8 +67,8 @@ it("should bind this context on require.ensure callback", function(done) { runWithThis({ok: true}, function() { require.ensure([], function(require) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); @@ -79,8 +79,8 @@ it("should bind this context on require.ensure callback (loaded)", function(done runWithThis({ok: true}, function() { require.ensure(["./load.js"], function(require) { try { - require("./file").should.be.eql("file"); - this.should.be.eql({ok: true}); + expect(require("./file")).toBe("file"); + expect(this).toEqual({ok: true}); done(); } catch(e) { done(e); } }.bind(this)); diff --git a/test/cases/parsing/issue-2349/index.js b/test/cases/parsing/issue-2349/index.js index 277cee408..065ececb5 100644 --- a/test/cases/parsing/issue-2349/index.js +++ b/test/cases/parsing/issue-2349/index.js @@ -1,5 +1,5 @@ import {x} from './a' // named imported cases an errors it("should be able to import a named export", function() { - x.should.be.eql(1); + expect(x).toBe(1); }); diff --git a/test/cases/parsing/issue-2522/index.js b/test/cases/parsing/issue-2522/index.js index 86cb81e38..7c13dad3e 100644 --- a/test/cases/parsing/issue-2522/index.js +++ b/test/cases/parsing/issue-2522/index.js @@ -9,7 +9,7 @@ it("should import into object shorthand", function() { b, c }; - o.should.be.eql({ + expect(o).toEqual({ a: 123, aa: 123, b: 456, @@ -18,4 +18,4 @@ it("should import into object shorthand", function() { default: 456 } }); -}) \ No newline at end of file +}) diff --git a/test/cases/parsing/issue-2523/index.js b/test/cases/parsing/issue-2523/index.js index 8adb8a17a..53c08cc14 100644 --- a/test/cases/parsing/issue-2523/index.js +++ b/test/cases/parsing/issue-2523/index.js @@ -3,7 +3,7 @@ import { B } from "./module"; import { c } from "./module"; it("should allow to export a class", function() { - (typeof A).should.be.eql("function"); - (typeof B).should.be.eql("function"); - c.should.be.eql("c"); -}) \ No newline at end of file + expect((typeof A)).toBe("function"); + expect((typeof B)).toBe("function"); + expect(c).toBe("c"); +}) diff --git a/test/cases/parsing/issue-2528/index.js b/test/cases/parsing/issue-2528/index.js index 8fa0cde76..a9a6562b8 100644 --- a/test/cases/parsing/issue-2528/index.js +++ b/test/cases/parsing/issue-2528/index.js @@ -51,7 +51,7 @@ import { count } from "./module"; it("should run async functions", function() { var org = count; notExportedAsync(); - count.should.be.eql(org + 1); + expect(count).toBe(org + 1); exportedAsync(); - count.should.be.eql(org + 2); + expect(count).toBe(org + 2); }); diff --git a/test/cases/parsing/issue-2570/index.js b/test/cases/parsing/issue-2570/index.js index 700e4eaa1..3339350df 100644 --- a/test/cases/parsing/issue-2570/index.js +++ b/test/cases/parsing/issue-2570/index.js @@ -6,8 +6,8 @@ it("should generate valid code when calling a harmony import function with brack var c = fn((3), (4)); var d = fn(5, (6)); - a.should.be.eql([1]); - b.should.be.eql([2]); - c.should.be.eql([3, 4]); - d.should.be.eql([5, 6]); + expect(a).toEqual([1]); + expect(b).toEqual([2]); + expect(c).toEqual([3, 4]); + expect(d).toEqual([5, 6]); }); diff --git a/test/cases/parsing/issue-2618/index.js b/test/cases/parsing/issue-2618/index.js index 1220384df..a8716a2f8 100644 --- a/test/cases/parsing/issue-2618/index.js +++ b/test/cases/parsing/issue-2618/index.js @@ -1,9 +1,9 @@ import defaultValue, { value, value2, value3, value4 } from "./module"; it("should be possible to redefine Object in a module", function() { - value.should.be.eql(123); - value2.should.be.eql(123); - value3.should.be.eql(123); - value4.should.be.eql(123); - defaultValue.should.be.eql(123); + expect(value).toBe(123); + expect(value2).toBe(123); + expect(value3).toBe(123); + expect(value4).toBe(123); + expect(defaultValue).toBe(123); }); diff --git a/test/cases/parsing/issue-2622/index.js b/test/cases/parsing/issue-2622/index.js index 262d5332e..696ecad76 100644 --- a/test/cases/parsing/issue-2622/index.js +++ b/test/cases/parsing/issue-2622/index.js @@ -9,8 +9,8 @@ var func2 = function(x = a, y = b) { } it("should import into default parameters", function() { - func().should.be.eql(["a", "b"]); - func2().should.be.eql(["a", "b"]); - func(1).should.be.eql([1, "b"]); - func2(2).should.be.eql([2, "b"]); + expect(func()).toEqual(["a", "b"]); + expect(func2()).toEqual(["a", "b"]); + expect(func(1)).toEqual([1, "b"]); + expect(func2(2)).toEqual([2, "b"]); }); diff --git a/test/cases/parsing/issue-2641/index.js b/test/cases/parsing/issue-2641/index.js index d2155f6d4..4626a3d9c 100644 --- a/test/cases/parsing/issue-2641/index.js +++ b/test/cases/parsing/issue-2641/index.js @@ -1,7 +1,7 @@ it("should require existing module with supplied error callback", function(done) { require(['./file'], function(file){ try { - file.should.be.eql("file"); + expect(file).toBe("file"); done(); } catch(e) { done(e); } }, function(error) { done(error); }); @@ -10,8 +10,8 @@ it("should require existing module with supplied error callback", function(done) it("should call error callback on missing module", function(done) { require(['./file', './missingModule'], function(file){}, function(error) { try { - error.should.be.instanceOf(Error); - error.message.should.be.eql('Cannot find module "./missingModule"'); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe("Cannot find module './missingModule'"); done(); } catch(e) { done(e); @@ -23,8 +23,8 @@ it("should call error callback on missing module in context", function(done) { (function(module) { require(['./' + module], function(file){}, function(error) { try { - error.should.be.instanceOf(Error); - error.message.should.be.eql("Cannot find module \"./missingModule\"."); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe("Cannot find module './missingModule'"); done(); } catch(e) { done(e); } }); @@ -34,8 +34,8 @@ it("should call error callback on missing module in context", function(done) { it("should call error callback on exception thrown in loading module", function(done) { require(['./throwing'], function(){}, function(error) { try { - error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('message'); done(); } catch(e) { done(e); } }); @@ -46,8 +46,8 @@ it("should not call error callback on exception thrown in require callback", fun throw new Error('message'); }, function(error) { try { - error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('message'); done(); } catch(e) { done(e); } }); diff --git a/test/cases/parsing/issue-2895/index.js b/test/cases/parsing/issue-2895/index.js index 26fba7279..83b1aae97 100644 --- a/test/cases/parsing/issue-2895/index.js +++ b/test/cases/parsing/issue-2895/index.js @@ -1,6 +1,6 @@ import { a, b } from "./a"; it("should export a const value without semicolon", function() { - a.should.be.eql({x: 1}); - b.should.be.eql({x: 2}); + expect(a).toEqual({x: 1}); + expect(b).toEqual({x: 2}); }); diff --git a/test/cases/parsing/issue-2942/index.js b/test/cases/parsing/issue-2942/index.js index f30332b6f..dfc72823a 100644 --- a/test/cases/parsing/issue-2942/index.js +++ b/test/cases/parsing/issue-2942/index.js @@ -2,11 +2,11 @@ it("should polyfill System", function() { if (typeof System === "object" && typeof System.register === "function") { require("fail"); } - (typeof System).should.be.eql("object"); - (typeof System.register).should.be.eql("undefined"); - (typeof System.get).should.be.eql("undefined"); - (typeof System.set).should.be.eql("undefined"); - (typeof System.anyNewItem).should.be.eql("undefined"); + expect((typeof System)).toBe("object"); + expect((typeof System.register)).toBe("undefined"); + expect((typeof System.get)).toBe("undefined"); + expect((typeof System.set)).toBe("undefined"); + expect((typeof System.anyNewItem)).toBe("undefined"); var x = System.anyNewItem; - (typeof x).should.be.eql("undefined"); + expect((typeof x)).toBe("undefined"); }) diff --git a/test/cases/parsing/issue-3116/index.js b/test/cases/parsing/issue-3116/index.js index c06f80824..5d7eb70d8 100644 --- a/test/cases/parsing/issue-3116/index.js +++ b/test/cases/parsing/issue-3116/index.js @@ -2,12 +2,12 @@ import * as file from "./file"; import * as file2 from "./file2"; it("should translate indexed access to harmony import correctly", function() { - file["default"].should.be.eql("default"); - file["abc"].should.be.eql("abc"); + expect(file["default"]).toBe("default"); + expect(file["abc"]).toBe("abc"); }); it("should translate dynamic indexed access to harmony import correctly", function() { var fault = "fault"; - file2["de" + fault].should.be.eql("default"); - file2["abc"].should.be.eql("abc"); + expect(file2["de" + fault]).toBe("default"); + expect(file2["abc"]).toBe("abc"); }); diff --git a/test/cases/parsing/issue-3238/index.js b/test/cases/parsing/issue-3238/index.js index de1e9161b..66321abae 100644 --- a/test/cases/parsing/issue-3238/index.js +++ b/test/cases/parsing/issue-3238/index.js @@ -1,4 +1,4 @@ it("supports empty element in destructuring", function() { const second = ([, x]) => x; - second([1, 2]).should.eql(2); + expect(second([1, 2])).toEqual(2); }); diff --git a/test/cases/parsing/issue-3252/index.js b/test/cases/parsing/issue-3252/index.js index 29e9859e5..60c745136 100644 --- a/test/cases/parsing/issue-3252/index.js +++ b/test/cases/parsing/issue-3252/index.js @@ -6,5 +6,5 @@ function fooBar({some, bar = E.V6Engine}) { } it("supports default argument assignment in import", function () { - fooBar({some:"test"}).should.eql('V6'); + expect(fooBar({some:"test"})).toEqual('V6'); }); diff --git a/test/cases/parsing/issue-3273/index.js b/test/cases/parsing/issue-3273/index.js index 992223964..294ce89a9 100644 --- a/test/cases/parsing/issue-3273/index.js +++ b/test/cases/parsing/issue-3273/index.js @@ -2,37 +2,37 @@ import { test } from "./file"; it("should hide import by local var", function() { var test = "ok"; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by object pattern", function() { var { test } = { test: "ok" }; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by array pattern", function() { var [test] = ["ok"]; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by array pattern (nested)", function() { var [[test]] = [["ok"]]; - test.should.be.eql("ok"); + expect(test).toBe("ok"); }); it("should hide import by pattern in function", function() { (function({test}) { - test.should.be.eql("ok"); + expect(test).toBe("ok"); }({ test: "ok" })); }); it("should allow import in default (incorrect)", function() { var { other = test, test } = { test: "ok" }; - test.should.be.eql("ok"); - (typeof other).should.be.eql("undefined"); + expect(test).toBe("ok"); + expect((typeof other)).toBe("undefined"); }); it("should allow import in default", function() { var { other = test } = { test: "ok" }; - other.should.be.eql("test"); + expect(other).toBe("test"); }); diff --git a/test/cases/parsing/issue-345/index.js b/test/cases/parsing/issue-345/index.js index 9dc72a8a6..00f1b5fc6 100644 --- a/test/cases/parsing/issue-345/index.js +++ b/test/cases/parsing/issue-345/index.js @@ -1,7 +1,7 @@ it("should parse multiple expressions in a require", function(done) { var name = "abc"; require(["./" + name + "/" + name + "Test"], function(x) { - x.should.be.eql("ok"); + expect(x).toBe("ok"); done(); }); -}); \ No newline at end of file +}); diff --git a/test/cases/parsing/issue-3769/index.js b/test/cases/parsing/issue-3769/index.js index 85d022ca5..393ea08ae 100644 --- a/test/cases/parsing/issue-3769/index.js +++ b/test/cases/parsing/issue-3769/index.js @@ -1,3 +1,3 @@ it("should generate valid code", function() { - require("./module").myTest.should.be.eql("test"); + expect(require("./module").myTest).toBe("test"); }); diff --git a/test/cases/parsing/issue-387/index.js b/test/cases/parsing/issue-387/index.js index 535bbcee4..06c08883f 100644 --- a/test/cases/parsing/issue-387/index.js +++ b/test/cases/parsing/issue-387/index.js @@ -10,7 +10,7 @@ it("should parse cujojs UMD modules", function() { ? define : function (factory) { module.exports = factory(require); } )); - module.exports.should.be.eql(123); + expect(module.exports).toBe(123); }); it("should parse cujojs UMD modules with deps", function() { @@ -30,7 +30,7 @@ it("should parse cujojs UMD modules with deps", function() { module.exports = factory.apply(null, deps); } )); - module.exports.should.be.eql(1234); + expect(module.exports).toBe(1234); }); it("should parse cujojs UMD modules with inlined deps", function() { @@ -45,5 +45,5 @@ it("should parse cujojs UMD modules with inlined deps", function() { ? define : function (factory) { module.exports = factory(require); } )); - module.exports.should.be.eql(4321); -}); \ No newline at end of file + expect(module.exports).toBe(4321); +}); diff --git a/test/cases/parsing/issue-3917/index.js b/test/cases/parsing/issue-3917/index.js index 119e28bed..914aca7ff 100644 --- a/test/cases/parsing/issue-3917/index.js +++ b/test/cases/parsing/issue-3917/index.js @@ -1,14 +1,14 @@ it("should be able to compile a module with UMD", function() { var x = require("./module"); - x.default.should.be.equal(global); + expect(x.default).toBe(global); }); it("should not find a free exports", function() { var x = require("./module2"); if(typeof exports !== "undefined") - (x.default).should.be.equal(exports); + expect(x.default).toBe(exports); else - (x.default).should.be.eql(false); + expect((x.default)).toBe(false); }); export {} diff --git a/test/cases/parsing/issue-3964/index.js b/test/cases/parsing/issue-3964/index.js index f290a7fa9..90dd22f7c 100644 --- a/test/cases/parsing/issue-3964/index.js +++ b/test/cases/parsing/issue-3964/index.js @@ -1,4 +1,4 @@ it("should be possible to export default an imported name", function() { var x = require("./module"); - x.should.be.eql({ default: 1234 }); + expect(x).toEqual({ default: 1234 }); }); diff --git a/test/cases/parsing/issue-4179/index.js b/test/cases/parsing/issue-4179/index.js index 9a769bf3d..c3e7c95a7 100644 --- a/test/cases/parsing/issue-4179/index.js +++ b/test/cases/parsing/issue-4179/index.js @@ -2,7 +2,7 @@ import def from "./module?harmony"; import * as mod from "./module?harmony-start" it("should export a sequence expression correctly", function() { - require("./module?cjs").should.be.eql({ default: 2 }); - def.should.be.eql(2); - mod.default.should.be.eql(2); + expect(require("./module?cjs")).toEqual({ default: 2 }); + expect(def).toBe(2); + expect(mod.default).toBe(2); }); diff --git a/test/cases/parsing/issue-4357/index.js b/test/cases/parsing/issue-4357/index.js index 2b3f1da86..bef054d11 100644 --- a/test/cases/parsing/issue-4357/index.js +++ b/test/cases/parsing/issue-4357/index.js @@ -5,7 +5,7 @@ it("should parse dynamic property names", function() { [require("./a")]: "a", [b]: "b" }; - o.should.be.eql({ + expect(o).toEqual({ a: "a", b: "b" }); @@ -21,7 +21,7 @@ it("should match dynamic property names", function() { [b]: cc } }]] = [0, 1, {b: {b: "c"}}]; - aa.should.be.eql("a"); - bb.should.be.eql("b"); - cc.should.be.eql("c"); + expect(aa).toBe("a"); + expect(bb).toBe("b"); + expect(cc).toBe("c"); }); diff --git a/test/cases/parsing/issue-4596/index.js b/test/cases/parsing/issue-4596/index.js index a8f957c22..bb772a041 100644 --- a/test/cases/parsing/issue-4596/index.js +++ b/test/cases/parsing/issue-4596/index.js @@ -3,11 +3,11 @@ it("should evaluate require.resolve as truthy value", function() { if(require.resolve) id = require.resolve("./module.js"); - (typeof id).should.be.oneOf("number", "string"); + expect(typeof id === "number" || typeof id === "string").toBeTruthy(); }); it("should evaluate require.resolve in ?: expression", function() { var id = require.resolve ? require.resolve("./module.js") : null; - (typeof id).should.be.oneOf("number", "string"); + expect(typeof id === "number" || typeof id === "string").toBeTruthy(); }); diff --git a/test/cases/parsing/issue-4608-1/index.js b/test/cases/parsing/issue-4608-1/index.js index 5ac3cf4b6..760ccdba7 100644 --- a/test/cases/parsing/issue-4608-1/index.js +++ b/test/cases/parsing/issue-4608-1/index.js @@ -1,5 +1,5 @@ it("should find var declaration later in code", function() { - (typeof require).should.be.eql("undefined"); + expect((typeof require)).toBe("undefined"); var require; }); @@ -10,7 +10,7 @@ it("should find var declaration in same statement", function() { }), require; require = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); fn(); }); @@ -18,7 +18,7 @@ it("should find var declaration in same statement", function() { it("should find a catch block declaration", function() { try { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); throw f; } catch(require) { @@ -28,7 +28,7 @@ it("should find a catch block declaration", function() { it("should find var declaration in control statements", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { @@ -83,7 +83,7 @@ it("should find var declaration in control statements", function() { it("should find var declaration in control statements after usage", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { diff --git a/test/cases/parsing/issue-4608-2/index.js b/test/cases/parsing/issue-4608-2/index.js index 4aea99e05..f2e777a5d 100644 --- a/test/cases/parsing/issue-4608-2/index.js +++ b/test/cases/parsing/issue-4608-2/index.js @@ -2,7 +2,7 @@ it("should find var declaration in control statements", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { @@ -16,7 +16,7 @@ it("should find var declaration in control statements", function() { it("should find var declaration in control statements after usage", function() { var f = (function(x) { - x.should.be.eql("fail"); + expect(x).toBe("fail"); }); (function() { diff --git a/test/cases/parsing/issue-4870/index.js b/test/cases/parsing/issue-4870/index.js index 81774bc88..2e1700560 100644 --- a/test/cases/parsing/issue-4870/index.js +++ b/test/cases/parsing/issue-4870/index.js @@ -3,11 +3,11 @@ import { test } from "./file"; it("should allow import in array destructing", function() { var other; [other = test] = []; - other.should.be.eql("test"); + expect(other).toBe("test"); }); it("should allow import in object destructing", function() { var other; ({other = test} = {}); - other.should.be.eql("test"); + expect(other).toBe("test"); }); diff --git a/test/cases/parsing/issue-494/index.js b/test/cases/parsing/issue-494/index.js index 1013d2b8a..f50a30469 100644 --- a/test/cases/parsing/issue-494/index.js +++ b/test/cases/parsing/issue-494/index.js @@ -1,5 +1,5 @@ it("should replace a free var in a IIFE", function() { (function(md) { - md.should.be.type("function"); + expect(md).toBeTypeOf("function"); }(module.deprecate)); -}); \ No newline at end of file +}); diff --git a/test/cases/parsing/issue-4940/index.js b/test/cases/parsing/issue-4940/index.js index 927531b5d..9785bf3c2 100644 --- a/test/cases/parsing/issue-4940/index.js +++ b/test/cases/parsing/issue-4940/index.js @@ -1,58 +1,58 @@ -define("local-module-object", function () { +define("local-module-object", function() { return { foo: "bar" }; }); -define("local-side-effect", function () { +define("local-side-effect", function() { return { foo: null }; }); -define("local-module-non-object", ["local-side-effect"], function (sideEffect) { - sideEffect.foo = "bar" +define("local-module-non-object", ["local-side-effect"], function(sideEffect) { + sideEffect.foo = "bar"; return 1; }); it("should create dependency when require is called with 'new' (object export)", function() { const result = new require("./object-export"); - result.foo.should.equal("bar"); - result.should.equal(require("./object-export")); + expect(result.foo).toBe("bar"); + expect(result).toEqual(require("./object-export")); }); it("should create dependency when require is called with 'new' (non-object export)", function() { const sideEffect = require("./sideEffect"); const result = new require("./non-object-export"); - result.should.instanceof(__webpack_require__); - sideEffect.foo.should.equal("bar"); - result.should.not.equal(require("./non-object-export")); + expect(result instanceof __webpack_require__).toBe(true); + expect(sideEffect.foo).toBe("bar"); + expect(result).not.toEqual(require("./non-object-export")); }); it("should create dependency with 'new' on a local dependency (object export)", function() { const result = new require("local-module-object"); - result.foo.should.equal("bar"); - result.should.equal(require("local-module-object")); + expect(result.foo).toBe("bar"); + expect(result).toEqual(require("local-module-object")); }); it("shouldn't fail with a local dependency (non-object export)", function() { const sideEffect = require("local-side-effect"); const result = new require("local-module-non-object"); - result.should.not.equal(1); - sideEffect.foo.should.equal("bar"); - result.should.not.equal(require("local-module-non-object")); + expect(result).not.toBe(1); + expect(sideEffect.foo).toBe("bar"); + expect(result).not.toEqual(require("local-module-non-object")); }); -it("should work with 'require' in parentheses", function () { - const result = new (require)("./object-export"); - result.foo.should.equal("bar"); +it("should work with 'require' in parentheses", function() { + const result = new require("./object-export"); + expect(result.foo).toBe("bar"); }); -it("should work with local module 'require' in parentheses", function () { - const result = new (require)("local-module-object"); - result.foo.should.equal("bar"); +it("should work with local module 'require' in parentheses", function() { + const result = new require("local-module-object"); + expect(result.foo).toBe("bar"); }); -it("shouldn't fail with non-object local module 'require' in parentheses", function () { - new (require)("local-module-non-object"); +it("shouldn't fail with non-object local module 'require' in parentheses", function() { + new require("local-module-non-object"); }); diff --git a/test/cases/parsing/issue-551/index.js b/test/cases/parsing/issue-551/index.js index 6f3a39a0f..16d3208d2 100644 --- a/test/cases/parsing/issue-551/index.js +++ b/test/cases/parsing/issue-551/index.js @@ -5,20 +5,20 @@ it("should be able to set the public path", function() { global.xyz = "xyz"; __webpack_public_path__ = global.xyz; - __webpack_require__.p.should.be.eql("xyz"); + expect(__webpack_require__.p).toBe("xyz"); delete global.xyz; window.something = "something"; __webpack_public_path__ = window.something; - __webpack_require__.p.should.be.eql("something"); + expect(__webpack_require__.p).toBe("something"); delete window.something; __webpack_public_path__ = "abc"; - __webpack_require__.p.should.be.eql("abc"); + expect(__webpack_require__.p).toBe("abc"); __webpack_public_path__ = func(); - __webpack_require__.p.should.be.eql("func"); - + expect(__webpack_require__.p).toBe("func"); + __webpack_public_path__ = originalValue; function func() { diff --git a/test/cases/parsing/issue-5624/index.js b/test/cases/parsing/issue-5624/index.js index affa367d8..b230381ff 100644 --- a/test/cases/parsing/issue-5624/index.js +++ b/test/cases/parsing/issue-5624/index.js @@ -2,5 +2,5 @@ import { fn } from "./module"; it("should allow conditionals as callee", function() { var x = (true ? fn : fn)(); - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); diff --git a/test/cases/parsing/issue-627/dir/test.js b/test/cases/parsing/issue-627/dir/test.js index a71df3536..71bf06520 100644 --- a/test/cases/parsing/issue-627/dir/test.js +++ b/test/cases/parsing/issue-627/dir/test.js @@ -1,4 +1,4 @@ -(function() { +expect(function() { var expr1 = "a", expr2 = "b"; require(Math.random() < 0.5 ? expr1 : expr2); -}).should.throw(); +}).toThrowError(); diff --git a/test/cases/parsing/issue-7318/index.js b/test/cases/parsing/issue-7318/index.js new file mode 100644 index 000000000..b99c69468 --- /dev/null +++ b/test/cases/parsing/issue-7318/index.js @@ -0,0 +1,5 @@ +const type = require("./typeof"); + +it("should not output invalid code", () => { + expect(type).toBe("number"); +}); diff --git a/test/cases/parsing/issue-7318/typeof.js b/test/cases/parsing/issue-7318/typeof.js new file mode 100644 index 000000000..e48d9ea1c --- /dev/null +++ b/test/cases/parsing/issue-7318/typeof.js @@ -0,0 +1,2 @@ +typeof 1 +module.exports = "number" diff --git a/test/cases/parsing/issue-758/index.js b/test/cases/parsing/issue-758/index.js index bcae179ba..01ac1344e 100644 --- a/test/cases/parsing/issue-758/index.js +++ b/test/cases/parsing/issue-758/index.js @@ -2,7 +2,7 @@ it("should require existing module with supplied error callback", function(done) require.ensure(['./file'], function(){ try { var file = require('./file'); - file.should.be.eql("file"); + expect(file).toBe("file"); done(); } catch(e) { done(e); } }, function(error) {}); @@ -12,8 +12,8 @@ it("should call error callback on missing module", function(done) { require.ensure(['./missingModule'], function(){ require('./missingModule'); }, function(error) { - error.should.be.instanceOf(Error); - error.message.should.be.eql('Cannot find module "./missingModule"'); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe("Cannot find module './missingModule'"); done(); }); }); @@ -23,8 +23,8 @@ it("should call error callback on missing module in context", function(done) { require.ensure([], function(){ require('./' + module); }, function(error) { - error.should.be.instanceOf(Error); - error.message.should.be.eql("Cannot find module \"./missingModule\"."); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe("Cannot find module './missingModule'"); done(); }); })('missingModule'); @@ -34,8 +34,8 @@ it("should call error callback on exception thrown in loading module", function( require.ensure(['./throwing'], function(){ require('./throwing'); }, function(error) { - error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('message'); done(); }); }); @@ -44,8 +44,8 @@ it("should not call error callback on exception thrown in require callback", fun require.ensure(['./throwing'], function() { throw new Error('message'); }, function(error) { - error.should.be.instanceOf(Error); - error.message.should.be.eql('message'); + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('message'); done(); }); }); @@ -58,7 +58,7 @@ it("should call error callback when there is an error loading the chunk", functi var file = require('./file'); } catch(e) { done(e); } }, function(error) { - error.should.be.eql('fake chunk load error'); + expect(error).toBe('fake chunk load error'); done(); }); __webpack_require__.e = temp; diff --git a/test/cases/parsing/javascript/index.js b/test/cases/parsing/javascript/index.js index e9272a47b..7f59cf2ac 100644 --- a/test/cases/parsing/javascript/index.js +++ b/test/cases/parsing/javascript/index.js @@ -1,4 +1,4 @@ it("should parse sparse arrays", function() { // issue #136 - [,null].should.have.length(2); - [0,,,0].should.have.length(4); + expect([,null]).toHaveLength(2); + expect([0,,,0]).toHaveLength(4); }); diff --git a/test/cases/parsing/local-modules/index.js b/test/cases/parsing/local-modules/index.js index 1d558cc85..8eae3c396 100644 --- a/test/cases/parsing/local-modules/index.js +++ b/test/cases/parsing/local-modules/index.js @@ -3,13 +3,13 @@ it("should define and require a local module", function() { define("my-module", function() { return 1234; }); - module.exports.should.be.eql("not set"); + expect(module.exports).toBe("not set"); define(["my-module"], function(myModule) { - myModule.should.be.eql(1234); + expect(myModule).toBe(1234); return 2345; }); - module.exports.should.be.eql(2345); - require("my-module").should.be.eql(1234); + expect(module.exports).toBe(2345); + expect(require("my-module")).toBe(1234); require(["my-module"]); }); @@ -19,11 +19,11 @@ it("should not create a chunk for a AMD require to a local module", function(don }); var sync = false; require(["my-module2"], function(myModule2) { - myModule2.should.be.eql(1235); + expect(myModule2).toBe(1235); sync = true; }); setImmediate(function() { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); }); }); @@ -31,18 +31,18 @@ it("should not create a chunk for a AMD require to a local module", function(don it("should define and require a local module with deps", function() { module.exports = "not set"; define("my-module3", ["./dep"], function(dep) { - dep.should.be.eql("dep"); + expect(dep).toBe("dep"); return 1234; }); - module.exports.should.be.eql("not set"); + expect(module.exports).toBe("not set"); define("my-module4", ["my-module3", "./dep"], function(myModule, dep) { - dep.should.be.eql("dep"); - myModule.should.be.eql(1234); + expect(dep).toBe("dep"); + expect(myModule).toBe(1234); return 2345; }); - module.exports.should.be.eql("not set"); - require("my-module3").should.be.eql(1234); - require("my-module4").should.be.eql(2345); + expect(module.exports).toBe("not set"); + expect(require("my-module3")).toBe(1234); + expect(require("my-module4")).toBe(2345); }); it("should define and require a local module that is relative", function () { @@ -53,9 +53,9 @@ it("should define and require a local module that is relative", function () { return 2345; }); define("my-dir/my-other-dir/my-module5", ["./my-module4", "../my-module3"], function(myModule4, myModule3) { - myModule3.should.be.eql(1234); - myModule4.should.be.eql(2345); + expect(myModule3).toBe(1234); + expect(myModule4).toBe(2345); return 3456; }); - require("my-dir/my-other-dir/my-module5").should.be.eql(3456); + expect(require("my-dir/my-other-dir/my-module5")).toBe(3456); }) diff --git a/test/cases/parsing/pattern-in-for/index.js b/test/cases/parsing/pattern-in-for/index.js index 85786e65e..499af551c 100644 --- a/test/cases/parsing/pattern-in-for/index.js +++ b/test/cases/parsing/pattern-in-for/index.js @@ -1,15 +1,15 @@ it("should parse patterns in for in/of statements", () => { var message; for({ message = require("./module")} of [{}]) { - message.should.be.eql("ok"); + expect(message).toBe("ok"); } for({ message = require("./module") } in { "string": "value" }) { - message.should.be.eql("ok"); + expect(message).toBe("ok"); } for(var { value = require("./module")} of [{}]) { - value.should.be.eql("ok"); + expect(value).toBe("ok"); } for(var { value = require("./module") } in { "string": "value" }) { - value.should.be.eql("ok"); + expect(value).toBe("ok"); } }); diff --git a/test/cases/parsing/precreated-ast/index.js b/test/cases/parsing/precreated-ast/index.js index dbcba8820..a74dea11d 100644 --- a/test/cases/parsing/precreated-ast/index.js +++ b/test/cases/parsing/precreated-ast/index.js @@ -1,3 +1,3 @@ it("should be able to process AST from loader", function() { - require("./ast-loader!./module").should.be.eql("ok"); + expect(require("./ast-loader!./module")).toBe("ok"); }); diff --git a/test/cases/parsing/renaming/index.js b/test/cases/parsing/renaming/index.js index 22e0edde9..fea96df25 100644 --- a/test/cases/parsing/renaming/index.js +++ b/test/cases/parsing/renaming/index.js @@ -1,8 +1,8 @@ it("should be able to rename require by var", function() { var cjsRequire; // just to make it difficult var cjsRequire = require, cjsRequire2 = typeof require !== "undefined" && require; - cjsRequire("./file").should.be.eql("ok"); - cjsRequire2("./file").should.be.eql("ok"); + expect(cjsRequire("./file")).toBe("ok"); + expect(cjsRequire2("./file")).toBe("ok"); }); it("should be able to rename require by assign", function() { @@ -10,39 +10,39 @@ it("should be able to rename require by assign", function() { (function() { cjsRequire = require; cjsRequire2 = typeof require === "function" && require; - cjsRequire("./file").should.be.eql("ok"); - cjsRequire2("./file").should.be.eql("ok"); + expect(cjsRequire("./file")).toBe("ok"); + expect(cjsRequire2("./file")).toBe("ok"); }()); }); it("should be able to rename require by IIFE", function() { (function(cjsRequire) { - cjsRequire("./file").should.be.eql("ok"); + expect(cjsRequire("./file")).toBe("ok"); }(require)); }); it("should be able to rename require by IIFE call", function() { (function(somethingElse, cjsRequire) { - cjsRequire("./file").should.be.eql("ok"); - somethingElse.should.be.eql(123); + expect(cjsRequire("./file")).toBe("ok"); + expect(somethingElse).toBe(123); }.call(this, 123, typeof require === "function" ? require : "error")); }); it("should be able to rename stuff by IIFE call", function() { (function(_exports, _exports2, _module, _module2, _define, _define2, _require, _require2) { _define(function(R, E, M) { - R("./file").should.be.eql("ok"); - _require("./file").should.be.eql("ok"); - _require2("./file").should.be.eql("ok"); - E.should.be.eql(exports); - _exports.should.be.eql(exports); - _exports2.should.be.eql(exports); - M.should.be.eql(module); - _module.should.be.eql(module); - _module2.should.be.eql(module); + expect(R("./file")).toBe("ok"); + expect(_require("./file")).toBe("ok"); + expect(_require2("./file")).toBe("ok"); + expect(E).toBe(exports); + expect(_exports).toBe(exports); + expect(_exports2).toBe(exports); + expect(M).toBe(module); + expect(_module).toBe(module); + expect(_module2).toBe(module); }); _define2(["./file"], function(file) { - file.should.be.eql("ok"); + expect(file).toBe("ok"); }); }).call(this, typeof exports !== 'undefined' ? exports : null, @@ -57,8 +57,8 @@ it("should be able to rename stuff by IIFE call", function() { it("should accept less parameters in a IIFE call", function() { (function(r, require) { - r("./file").should.be.eql("ok"); - (typeof require).should.be.eql("undefined"); + expect(r("./file")).toBe("ok"); + expect((typeof require)).toBe("undefined"); }(require)); }); @@ -70,12 +70,12 @@ it("should accept more parameters in a IIFE call", function() { it("should be able to rename stuff by IIFE call", function() { (function(_exports, _module, _define, _require) { _define(function(R, E, M) { - R("./file").should.be.eql("ok"); - _require("./file").should.be.eql("ok"); - E.should.be.eql(exports); - _exports.should.be.eql(exports); - M.should.be.eql(module); - _module.should.be.eql(module); + expect(R("./file")).toBe("ok"); + expect(_require("./file")).toBe("ok"); + expect(E).toBe(exports); + expect(_exports).toBe(exports); + expect(M).toBe(module); + expect(_module).toBe(module); }); }).call(this, typeof exports !== 'undefined' ? exports : null, diff --git a/test/cases/parsing/requirejs/index.js b/test/cases/parsing/requirejs/index.js index 37ea0ef2f..93ee59899 100644 --- a/test/cases/parsing/requirejs/index.js +++ b/test/cases/parsing/requirejs/index.js @@ -7,14 +7,14 @@ it("should ignore require.config", function() { }); }); it("should have a require.version", function() { - require.version.should.be.type("string"); + expect(require.version).toBeTypeOf("string"); }); it("should have a requirejs.onError function", function() { function f(){} - requirejs.onError.should.be.type("function"); // has default handler + expect(requirejs.onError).toBeTypeOf("function"); // has default handler var org = requirejs.onError; requirejs.onError = f; - requirejs.onError.should.be.eql(f); + expect(requirejs.onError).toBe(f); requirejs.onError = org; require(["./file.js"], function() {}); }); diff --git a/test/cases/parsing/resolve-weak-context/index.js b/test/cases/parsing/resolve-weak-context/index.js index d166968e0..735c7fa49 100644 --- a/test/cases/parsing/resolve-weak-context/index.js +++ b/test/cases/parsing/resolve-weak-context/index.js @@ -1,6 +1,6 @@ it("should be able to use require.resolveWeak with expression", function() { var expr = "file"; var id = require.resolveWeak("./dir/" + expr); - id.should.be.eql(require("./dir/file.js")); + expect(id).toBe(require("./dir/file.js")); }); diff --git a/test/cases/parsing/spread/index.js b/test/cases/parsing/spread/index.js index 924a2c7e7..5a94cdea8 100644 --- a/test/cases/parsing/spread/index.js +++ b/test/cases/parsing/spread/index.js @@ -3,9 +3,9 @@ import * as M from "./module"; it("should support spread operator", function() { var o1 = { ...X }; - o1.should.be.eql({ A: "A", B: "B" }); + expect(o1).toEqual({ A: "A", B: "B" }); var o2 = { ...({ X }) }; - o2.should.be.eql({ X: { A: "A", B: "B" } }); + expect(o2).toEqual({ X: { A: "A", B: "B" } }); var o3 = { ...M }; - o3.should.be.eql({ default: { A: "A", B: "B" }, A: "A", B: "B" }); + expect(o3).toEqual({ default: { A: "A", B: "B" }, A: "A", B: "B" }); }); diff --git a/test/cases/parsing/strict-mode/index.js b/test/cases/parsing/strict-mode/index.js index 47aaab0da..d3e026f57 100644 --- a/test/cases/parsing/strict-mode/index.js +++ b/test/cases/parsing/strict-mode/index.js @@ -9,11 +9,11 @@ define(["./abc"], function(abc) { var x = (function() { return this; })(); - (typeof x).should.be.eql("undefined"); + expect((typeof x)).toBe("undefined"); }); it("should import modules in strict mode", function() { - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); }); -}); \ No newline at end of file +}); diff --git a/test/cases/parsing/typeof/index.js b/test/cases/parsing/typeof/index.js index 0425079e7..93e366595 100644 --- a/test/cases/parsing/typeof/index.js +++ b/test/cases/parsing/typeof/index.js @@ -1,33 +1,33 @@ it("should not create a context for typeof require", function() { - require("./typeof").should.be.eql("function"); + expect(require("./typeof")).toBe("function"); }); it("should answer typeof require correctly", function() { - (typeof require).should.be.eql("function"); + expect((typeof require)).toBe("function"); }); it("should answer typeof define correctly", function() { - (typeof define).should.be.eql("function"); + expect((typeof define)).toBe("function"); }); it("should answer typeof require.amd correctly", function() { - (typeof require.amd).should.be.eql("object"); + expect((typeof require.amd)).toBe("object"); }); it("should answer typeof define.amd correctly", function() { - (typeof define.amd).should.be.eql("object"); + expect((typeof define.amd)).toBe("object"); }); it("should answer typeof module correctly", function() { - (typeof module).should.be.eql("object"); + expect((typeof module)).toBe("object"); }); it("should answer typeof exports correctly", function() { - (typeof exports).should.be.eql("object"); + expect((typeof exports)).toBe("object"); }); it("should answer typeof require.include correctly", function() { - (typeof require.include).should.be.eql("function"); + expect((typeof require.include)).toBe("function"); }); it("should answer typeof require.ensure correctly", function() { - (typeof require.ensure).should.be.eql("function"); + expect((typeof require.ensure)).toBe("function"); }); it("should answer typeof require.resolve correctly", function() { - (typeof require.resolve).should.be.eql("function"); + expect((typeof require.resolve)).toBe("function"); }); it("should not parse filtered stuff", function() { diff --git a/test/cases/parsing/unsupported-amd/index.js b/test/cases/parsing/unsupported-amd/index.js index 1ba36988d..db5945578 100644 --- a/test/cases/parsing/unsupported-amd/index.js +++ b/test/cases/parsing/unsupported-amd/index.js @@ -1,14 +1,14 @@ it("should fail on unsupported use of AMD require 1", function() { - (function() { + expect(function() { var abc = ["./a", "./b"]; require(abc, function(a, b) {}); - }).should.throw(); + }).toThrowError(); }); it("should fail on unsupported use of AMD require 2", function() { - (function() { + expect(function() { var abc = ["./a", "./b"]; function f(a, b) {} require(abc, f); - }).should.throw(); + }).toThrowError(); }); diff --git a/test/cases/parsing/var-hiding/index.js b/test/cases/parsing/var-hiding/index.js index c339dee9e..095807df0 100644 --- a/test/cases/parsing/var-hiding/index.js +++ b/test/cases/parsing/var-hiding/index.js @@ -2,9 +2,9 @@ var fn = function(module) { if (typeof module !== 'number') { throw new Error("module should be a number"); } - (typeof module).should.be.eql("number"); + expect((typeof module)).toBe("number"); }; it("should hide a free var by function argument", function() { fn(1); -}); \ No newline at end of file +}); diff --git a/test/cases/resolving/browser-field/index.js b/test/cases/resolving/browser-field/index.js index 342938206..fb3dba463 100644 --- a/test/cases/resolving/browser-field/index.js +++ b/test/cases/resolving/browser-field/index.js @@ -1,37 +1,37 @@ it("should replace a module with a module", function() { - require("replacing-module1").should.be.eql("new-module"); + expect(require("replacing-module1")).toBe("new-module"); }); it("should replace a module with a file in a module", function() { - require("replacing-module2").should.be.eql("new-module/inner"); + expect(require("replacing-module2")).toBe("new-module/inner"); }); it("should replace a module with file in the same module", function() { - require("replacing-module3").should.be.eql("new-module/inner"); + expect(require("replacing-module3")).toBe("new-module/inner"); }); it("should replace a module with a file in the current module", function() { - require("replacing-module4").should.be.eql("replacing-module4/module"); + expect(require("replacing-module4")).toBe("replacing-module4/module"); }); it("should replace a file with another file", function() { - require("replacing-file1").should.be.eql("new-file"); + expect(require("replacing-file1")).toBe("new-file"); }); it("should replace a file with a module", function() { - require("replacing-file2").should.be.eql("new-module"); + expect(require("replacing-file2")).toBe("new-module"); }); it("should replace a file with a file in a module", function() { - require("replacing-file3").should.be.eql("new-module/inner"); + expect(require("replacing-file3")).toBe("new-module/inner"); }); it("should replace a file in a directory with another file", function() { - require("replacing-file4").should.be.eql("new-file"); + expect(require("replacing-file4")).toBe("new-file"); }); it("should ignore recursive module mappings", function() { - require("recursive-module").should.be.eql("new-module"); + expect(require("recursive-module")).toBe("new-module"); }); it("should use empty modules for ignored modules", function() { - require("ignoring-module").module.should.be.eql({}); - require("ignoring-module").file.should.be.eql({}); - require("ignoring-module").module.should.not.be.equal(require("ignoring-module").file); + expect(require("ignoring-module").module).toEqual({}); + expect(require("ignoring-module").file).toEqual({}); + expect(require("ignoring-module").module).not.toBe(require("ignoring-module").file); }); // Errors diff --git a/test/cases/resolving/commomjs-local-module/index.js b/test/cases/resolving/commomjs-local-module/index.js index f73c0597a..8abbf0417 100644 --- a/test/cases/resolving/commomjs-local-module/index.js +++ b/test/cases/resolving/commomjs-local-module/index.js @@ -1,5 +1,3 @@ -var should = require("should"); - define("regular", function(require, exports, module) { module.exports = "regular-module"; }); @@ -12,12 +10,11 @@ define("return-module", function(require, exports, module) { return "module is returned"; }); - it("should make different modules for query", function() { - should.strictEqual(require("regular"), "regular-module"); - should.strictEqual(require("return-module"), "module is returned"); + expect(require("regular")).toBe("regular-module"); + expect(require("return-module")).toBe("module is returned"); const overrideExports = require("override-exports"); - should(overrideExports).be.a.Object(); - should(Object.keys(overrideExports).length).be.exactly(0); + expect(typeof overrideExports).toBe("object"); + expect(Object.keys(overrideExports)).toHaveLength(0); }); diff --git a/test/cases/resolving/context/index.js b/test/cases/resolving/context/index.js index 0b4e1b9a6..207082730 100644 --- a/test/cases/resolving/context/index.js +++ b/test/cases/resolving/context/index.js @@ -1,11 +1,11 @@ it("should resolve loaders relative to require", function() { var index = "index", test = "test"; - require("./loaders/queryloader?query!!!!./node_modules/subcontent/" + index + ".js").should.be.eql({ + expect(require("./loaders/queryloader?query!!!!./node_modules/subcontent/" + index + ".js")).toEqual({ resourceQuery: "", query: "?query", prev: "module.exports = \"error\";" }); - require("!./loaders/queryloader?query!./node_modules/subcontent/" + test + ".jade").should.be.eql({ + expect(require("!./loaders/queryloader?query!./node_modules/subcontent/" + test + ".pug")).toEqual({ resourceQuery: "", query: "?query", prev: "xyz: abc" diff --git a/test/cases/resolving/context/node_modules/subcontent/test.jade b/test/cases/resolving/context/node_modules/subcontent/test.pug similarity index 100% rename from test/cases/resolving/context/node_modules/subcontent/test.jade rename to test/cases/resolving/context/node_modules/subcontent/test.pug diff --git a/test/cases/resolving/query/index.js b/test/cases/resolving/query/index.js index 8b0f8c890..197f1ccf9 100644 --- a/test/cases/resolving/query/index.js +++ b/test/cases/resolving/query/index.js @@ -1,14 +1,12 @@ -var should = require("should"); - it("should make different modules for query", function() { var a = require("./empty"); var b = require("./empty?1"); var c = require("./empty?2"); - should.strictEqual(typeof a, "object"); - should.strictEqual(typeof b, "object"); - should.strictEqual(typeof c, "object"); - a.should.be.not.equal(b); - a.should.be.not.equal(c); - b.should.be.not.equal(c); + expect(typeof a).toBe("object"); + expect(typeof b).toBe("object"); + expect(typeof c).toBe("object"); + expect(a).not.toBe(b); + expect(a).not.toBe(c); + expect(b).not.toBe(c); }); diff --git a/test/cases/resolving/single-file-module/index.js b/test/cases/resolving/single-file-module/index.js index fed4edbdd..62fffa34f 100644 --- a/test/cases/resolving/single-file-module/index.js +++ b/test/cases/resolving/single-file-module/index.js @@ -1,3 +1,3 @@ it("should load single file modules", function() { - require("subfilemodule").should.be.eql("subfilemodule"); + expect(require("subfilemodule")).toBe("subfilemodule"); }); diff --git a/test/cases/runtime/chunk-callback-order/duplicate.js b/test/cases/runtime/chunk-callback-order/duplicate.js index 9867c8106..354829318 100644 --- a/test/cases/runtime/chunk-callback-order/duplicate.js +++ b/test/cases/runtime/chunk-callback-order/duplicate.js @@ -1,3 +1,3 @@ require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./a")).toBe("a"); +}) diff --git a/test/cases/runtime/chunk-callback-order/duplicate2.js b/test/cases/runtime/chunk-callback-order/duplicate2.js index e6ab3c768..37b0f6b4d 100644 --- a/test/cases/runtime/chunk-callback-order/duplicate2.js +++ b/test/cases/runtime/chunk-callback-order/duplicate2.js @@ -1,3 +1,3 @@ require.ensure(["./b"], function(require) { - require("./b").should.be.eql("a"); -}) \ No newline at end of file + expect(require("./b")).toBe("a"); +}) diff --git a/test/cases/runtime/chunk-callback-order/index.js b/test/cases/runtime/chunk-callback-order/index.js index 3a3f2466a..bed75d0dd 100644 --- a/test/cases/runtime/chunk-callback-order/index.js +++ b/test/cases/runtime/chunk-callback-order/index.js @@ -9,7 +9,7 @@ it("should fire multiple code load callbacks in the correct order", function(don require("./duplicate"); require("./duplicate2"); calls.push(2); - calls.should.be.eql([1,2]); + expect(calls).toEqual([1,2]); done(); }); }); diff --git a/test/cases/runtime/circular-dependencies/index.js b/test/cases/runtime/circular-dependencies/index.js index 5a7df2b4c..fe6664245 100644 --- a/test/cases/runtime/circular-dependencies/index.js +++ b/test/cases/runtime/circular-dependencies/index.js @@ -1,3 +1,3 @@ it("should load circular dependencies correctly", function() { - require("./circular").should.be.eql(1); + expect(require("./circular")).toBe(1); }); diff --git a/test/cases/runtime/error-handling/index.js b/test/cases/runtime/error-handling/index.js index a8652210c..a471fbc04 100644 --- a/test/cases/runtime/error-handling/index.js +++ b/test/cases/runtime/error-handling/index.js @@ -1,11 +1,11 @@ function testCase(number) { - require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule").should.be.eql("file" + number); - require( + expect(require(number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule")).toBe("file" + number); + expect(require( number === 1 ? "./folder/file1" : number === 2 ? "./folder/file2" : number === 3 ? "./folder/file3" : "./missingModule" - ).should.be.eql("file" + number); + )).toBe("file" + number); } @@ -16,7 +16,7 @@ it("should throw an error on missing module at runtime, but not at compile time } catch(e) { error = e; } - error.should.be.instanceOf(Error); + expect(error).toBeInstanceOf(Error); error = null; try { @@ -24,5 +24,5 @@ it("should throw an error on missing module at runtime, but not at compile time } catch(e) { error = e; } - error.should.be.instanceOf(Error); + expect(error).toBeInstanceOf(Error); }); diff --git a/test/cases/runtime/issue-1650/index.js b/test/cases/runtime/issue-1650/index.js index 307fc665d..f14a6b661 100644 --- a/test/cases/runtime/issue-1650/index.js +++ b/test/cases/runtime/issue-1650/index.js @@ -1,6 +1,6 @@ it("should be able to set the public path globally", function() { var org = __webpack_public_path__; require("./file"); - __webpack_public_path__.should.be.eql("ok"); + expect(__webpack_public_path__).toBe("ok"); __webpack_public_path__ = org; }); diff --git a/test/cases/runtime/issue-1788/a.js b/test/cases/runtime/issue-1788/a.js index a15f19f71..f61f5ca91 100644 --- a/test/cases/runtime/issue-1788/a.js +++ b/test/cases/runtime/issue-1788/a.js @@ -3,5 +3,5 @@ export default 'a-default'; export { btest } from "./b"; export function atest() { - b.should.be.eql("b-default"); + expect(b).toBe("b-default"); } diff --git a/test/cases/runtime/issue-1788/b.js b/test/cases/runtime/issue-1788/b.js index d79b5e301..999009add 100644 --- a/test/cases/runtime/issue-1788/b.js +++ b/test/cases/runtime/issue-1788/b.js @@ -2,5 +2,5 @@ import a from './a'; export default 'b-default'; export function btest() { - a.should.be.eql("a-default"); + expect(a).toBe("a-default"); } diff --git a/test/cases/runtime/issue-2391-chunk/index.js b/test/cases/runtime/issue-2391-chunk/index.js index d11248e9e..7e38eadbd 100644 --- a/test/cases/runtime/issue-2391-chunk/index.js +++ b/test/cases/runtime/issue-2391-chunk/index.js @@ -1,4 +1,4 @@ it("should have a require.onError function by default", function() { - (typeof require.onError).should.be.eql("function"); + expect((typeof require.onError)).toBe("function"); require(["./file"]); -}); \ No newline at end of file +}); diff --git a/test/cases/runtime/issue-2391/index.js b/test/cases/runtime/issue-2391/index.js index c2ef272b6..c01b3c35a 100644 --- a/test/cases/runtime/issue-2391/index.js +++ b/test/cases/runtime/issue-2391/index.js @@ -1,3 +1,3 @@ it("should not have a require.onError function by default", function() { - (typeof require.onError).should.be.eql("undefined"); // expected to fail in browsertests -}); \ No newline at end of file + expect((typeof require.onError)).toBe("undefined"); // expected to fail in browsertests +}); diff --git a/test/cases/runtime/missing-module-exception/index.js b/test/cases/runtime/missing-module-exception/index.js index fa2d10d63..3351fb7a5 100644 --- a/test/cases/runtime/missing-module-exception/index.js +++ b/test/cases/runtime/missing-module-exception/index.js @@ -2,6 +2,6 @@ it("should have correct error code", function() { try { require("./fail"); } catch(e) { - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e.code).toBe("MODULE_NOT_FOUND"); } -}); \ No newline at end of file +}); diff --git a/test/cases/runtime/module-caching/index.js b/test/cases/runtime/module-caching/index.js index 34e70f3cd..2618105a4 100644 --- a/test/cases/runtime/module-caching/index.js +++ b/test/cases/runtime/module-caching/index.js @@ -1,13 +1,11 @@ -var should = require("should"); - it("should cache modules correctly", function(done) { delete require.cache[require.resolve("./singular.js")]; - require("./singular.js").value.should.be.eql(1); - (require("./singular.js")).value.should.be.eql(1); + expect(require("./singular.js").value).toBe(1); + expect((require("./singular.js")).value).toBe(1); require("./sing" + "ular.js").value = 2; - require("./singular.js").value.should.be.eql(2); + expect(require("./singular.js").value).toBe(2); require.ensure(["./two.js"], function(require) { - require("./singular.js").value.should.be.eql(2); + expect(require("./singular.js").value).toBe(2); done(); }); }); @@ -18,9 +16,9 @@ it("should be able the remove modules from cache with require.cache and require. var singularIdInConditional = require.resolve(true ? "./singular2" : "./singular"); if(typeof singularId !== "number" && typeof singularId !== "string") throw new Error("require.resolve should return a number or string"); - singularIdInConditional.should.be.eql(singularId); - (require.cache).should.have.type("object"); - (require.cache[singularId]).should.have.type("object"); + expect(singularIdInConditional).toBe(singularId); + expect(require.cache).toBeTypeOf("object"); + expect(require.cache[singularId]).toBeTypeOf("object"); delete require.cache[singularId]; - require("./singular2").should.be.not.equal(singularObj); + expect(require("./singular2")).not.toBe(singularObj); }); diff --git a/test/cases/runtime/require-function/index.js b/test/cases/runtime/require-function/index.js index 12a202531..bd6a7caf0 100644 --- a/test/cases/runtime/require-function/index.js +++ b/test/cases/runtime/require-function/index.js @@ -1,5 +1,5 @@ it("should have correct properties on the require function", function() { - __webpack_require__.c.should.have.type("object"); - __webpack_require__.m.should.have.type("object"); - __webpack_require__.p.should.have.type("string"); -}); \ No newline at end of file + expect(__webpack_require__.c).toBeTypeOf("object"); + expect(__webpack_require__.m).toBeTypeOf("object"); + expect(__webpack_require__.p).toBeTypeOf("string"); +}); diff --git a/test/cases/scope-hoisting/async-keyword-5615/index.js b/test/cases/scope-hoisting/async-keyword-5615/index.js index b2e73311b..845e64bd5 100644 --- a/test/cases/scope-hoisting/async-keyword-5615/index.js +++ b/test/cases/scope-hoisting/async-keyword-5615/index.js @@ -1,5 +1,5 @@ import value from "./async"; it("should have the correct values", function() { - value.should.be.eql("default"); + expect(value).toBe("default"); }); diff --git a/test/cases/scope-hoisting/chained-reexport/index.js b/test/cases/scope-hoisting/chained-reexport/index.js index 5ac21327b..bfc180c27 100644 --- a/test/cases/scope-hoisting/chained-reexport/index.js +++ b/test/cases/scope-hoisting/chained-reexport/index.js @@ -1,5 +1,5 @@ import { named } from "./c"; it("should have the correct values", function() { - named.should.be.eql("named"); + expect(named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/circular-namespace-object/index.js b/test/cases/scope-hoisting/circular-namespace-object/index.js index 34ccf6f64..bec400548 100644 --- a/test/cases/scope-hoisting/circular-namespace-object/index.js +++ b/test/cases/scope-hoisting/circular-namespace-object/index.js @@ -1,5 +1,5 @@ import value from "./module"; it("should have access to namespace object before evaluation", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/cases/scope-hoisting/export-namespace/index.js b/test/cases/scope-hoisting/export-namespace/index.js index 6c1b35d6f..b0d80a404 100644 --- a/test/cases/scope-hoisting/export-namespace/index.js +++ b/test/cases/scope-hoisting/export-namespace/index.js @@ -2,14 +2,14 @@ import { ns as ns1 } from "./module1"; const ns2 = require("./module2").ns; it("should allow to export a namespace object (concated)", function() { - ns1.should.be.eql({ + expect(ns1).toEqual({ a: "a", b: "b" }); }); it("should allow to export a namespace object (exposed)", function() { - ns2.should.be.eql({ + expect(ns2).toEqual({ a: "a", b: "b" }); diff --git a/test/cases/scope-hoisting/import-order/index.js b/test/cases/scope-hoisting/import-order/index.js index ce3eb1675..e4d2e75a5 100644 --- a/test/cases/scope-hoisting/import-order/index.js +++ b/test/cases/scope-hoisting/import-order/index.js @@ -3,5 +3,5 @@ import "./module"; import { log } from "./tracker"; it("should evaluate import in the correct order", function() { - log.should.be.eql(["commonjs", "module"]); + expect(log).toEqual(["commonjs", "module"]); }); diff --git a/test/cases/scope-hoisting/indirect-reexport/index.js b/test/cases/scope-hoisting/indirect-reexport/index.js index f9a31c159..44e195598 100644 --- a/test/cases/scope-hoisting/indirect-reexport/index.js +++ b/test/cases/scope-hoisting/indirect-reexport/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.named.should.be.eql("named"); + expect(c.named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/inside-class/index.js b/test/cases/scope-hoisting/inside-class/index.js index 63aa824b3..eba2d46a7 100644 --- a/test/cases/scope-hoisting/inside-class/index.js +++ b/test/cases/scope-hoisting/inside-class/index.js @@ -4,8 +4,8 @@ import { Foo as SecondFoo, Bar } from "./second" it("should renamed class reference in inner scope", function() { var a = new Foo().test(); var b = new SecondFoo().test(); - a.should.be.eql(1); - b.should.be.eql(2); - new FirstBar().test().should.be.eql(1); - new Bar().test().should.be.eql(2); + expect(a).toBe(1); + expect(b).toBe(2); + expect(new FirstBar().test()).toBe(1); + expect(new Bar().test()).toBe(2); }); diff --git a/test/cases/scope-hoisting/intra-references/index.js b/test/cases/scope-hoisting/intra-references/index.js index 371843667..b1169303c 100644 --- a/test/cases/scope-hoisting/intra-references/index.js +++ b/test/cases/scope-hoisting/intra-references/index.js @@ -1,7 +1,7 @@ import value from "./a"; it("should have the correct values", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/cases/scope-hoisting/issue-5020-minimal/index.js b/test/cases/scope-hoisting/issue-5020-minimal/index.js index b992781ad..5a6efdf17 100644 --- a/test/cases/scope-hoisting/issue-5020-minimal/index.js +++ b/test/cases/scope-hoisting/issue-5020-minimal/index.js @@ -1,7 +1,7 @@ var testData = require("./src/index.js"); it("should export the correct values", function() { - testData.should.be.eql({ + expect(testData).toEqual({ icon: { svg: { default: 1 diff --git a/test/cases/scope-hoisting/issue-5020/index.js b/test/cases/scope-hoisting/issue-5020/index.js index f2ab49e39..a989f0816 100644 --- a/test/cases/scope-hoisting/issue-5020/index.js +++ b/test/cases/scope-hoisting/issue-5020/index.js @@ -1,7 +1,7 @@ var testData = require("./src/index.js"); it("should export the correct values", function() { - testData.should.be.eql({ + expect(testData).toEqual({ svg5: { svg: { clinical1: { diff --git a/test/cases/scope-hoisting/issue-5096/index.js b/test/cases/scope-hoisting/issue-5096/index.js index 0b7a38114..5da7dc001 100644 --- a/test/cases/scope-hoisting/issue-5096/index.js +++ b/test/cases/scope-hoisting/issue-5096/index.js @@ -9,5 +9,5 @@ if(Math.random() < -1) console.log(module); it("should compile fine", function() { - b.should.be.eql("a"); + expect(b).toBe("a"); }); diff --git a/test/cases/scope-hoisting/issue-5314/index.js b/test/cases/scope-hoisting/issue-5314/index.js index 2697608c7..d35a27e91 100644 --- a/test/cases/scope-hoisting/issue-5314/index.js +++ b/test/cases/scope-hoisting/issue-5314/index.js @@ -3,7 +3,7 @@ import a from "./module"; var obj = {}; it("should allow access to the default export of the root module", function() { - a().should.be.eql(obj); + expect(a()).toBe(obj); }); export default obj; diff --git a/test/cases/scope-hoisting/issue-5443/index.js b/test/cases/scope-hoisting/issue-5443/index.js index 5ce5559b2..5edce3165 100644 --- a/test/cases/scope-hoisting/issue-5443/index.js +++ b/test/cases/scope-hoisting/issue-5443/index.js @@ -1,7 +1,7 @@ import { module } from "./reexport"; it("should have the correct values", function() { - module.should.be.eql({ + expect(module).toEqual({ default: "default", named: "named" }); diff --git a/test/cases/scope-hoisting/issue-5481/index.js b/test/cases/scope-hoisting/issue-5481/index.js index b72050107..26fb8bd25 100644 --- a/test/cases/scope-hoisting/issue-5481/index.js +++ b/test/cases/scope-hoisting/issue-5481/index.js @@ -1,5 +1,5 @@ import value from "./module"; it("should not cause name conflicts", function() { - (typeof value).should.be.eql("undefined"); + expect((typeof value)).toBe("undefined"); }); diff --git a/test/cases/scope-hoisting/issue-6407/index.js b/test/cases/scope-hoisting/issue-6407/index.js index 193213228..518972092 100644 --- a/test/cases/scope-hoisting/issue-6407/index.js +++ b/test/cases/scope-hoisting/issue-6407/index.js @@ -2,10 +2,10 @@ import importOne from './import-one'; import importTwo from './import-two'; it("should concatenate modules default exports and empty array values", function() { - importOne.length.should.be.eql(2); - (typeof importOne[0]).should.be.eql('undefined'); - (typeof importOne[1]).should.be.eql('function'); - importTwo.length.should.be.eql(2); - (typeof importTwo[0]).should.be.eql('undefined'); - (typeof importTwo[1]).should.be.eql('function'); + expect(importOne.length).toBe(2); + expect(typeof importOne[0]).toBe('undefined'); + expect(typeof importOne[1]).toBe('function'); + expect(importTwo.length).toBe(2); + expect(typeof importTwo[0]).toBe('undefined'); + expect(typeof importTwo[1]).toBe('function'); }); diff --git a/test/cases/scope-hoisting/json-reexport-6700/index.js b/test/cases/scope-hoisting/json-reexport-6700/index.js index 093e287fe..8fee46d83 100644 --- a/test/cases/scope-hoisting/json-reexport-6700/index.js +++ b/test/cases/scope-hoisting/json-reexport-6700/index.js @@ -1,9 +1,9 @@ import { a, b, aa, bb } from './json.js' it("should reexport json data correctly", () => { - aa.should.be.eql({ a: "A" }); - bb.should.be.eql({ b: "B" }); - a.should.be.eql("A"); - b.should.be.eql("B"); + expect(aa).toEqual({ a: "A" }); + expect(bb).toEqual({ b: "B" }); + expect(a).toBe("A"); + expect(b).toBe("B"); }); diff --git a/test/cases/scope-hoisting/name-conflicts/index.js b/test/cases/scope-hoisting/name-conflicts/index.js index 486777033..351cbeac4 100644 --- a/test/cases/scope-hoisting/name-conflicts/index.js +++ b/test/cases/scope-hoisting/name-conflicts/index.js @@ -6,10 +6,10 @@ import value5 from "./module?{"; import value6 from "./module?}"; it("should not break on name conflicts", function() { - value1.should.be.eql("a"); - value2.should.be.eql("a"); - value3.should.be.eql("a"); - value4.should.be.eql("a"); - value5.should.be.eql("a"); - value6.should.be.eql("a"); + expect(value1).toBe("a"); + expect(value2).toBe("a"); + expect(value3).toBe("a"); + expect(value4).toBe("a"); + expect(value5).toBe("a"); + expect(value6).toBe("a"); }); diff --git a/test/cases/scope-hoisting/reexport-cjs/index.js b/test/cases/scope-hoisting/reexport-cjs/index.js index 5ac21327b..bfc180c27 100644 --- a/test/cases/scope-hoisting/reexport-cjs/index.js +++ b/test/cases/scope-hoisting/reexport-cjs/index.js @@ -1,5 +1,5 @@ import { named } from "./c"; it("should have the correct values", function() { - named.should.be.eql("named"); + expect(named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/reexport-exposed-cjs/index.js b/test/cases/scope-hoisting/reexport-exposed-cjs/index.js index f9a31c159..44e195598 100644 --- a/test/cases/scope-hoisting/reexport-exposed-cjs/index.js +++ b/test/cases/scope-hoisting/reexport-exposed-cjs/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.named.should.be.eql("named"); + expect(c.named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js b/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js index 80958b553..1043ef8a5 100644 --- a/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js +++ b/test/cases/scope-hoisting/reexport-exposed-default-cjs/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.default.should.be.eql("default"); + expect(c.default).toBe("default"); }); diff --git a/test/cases/scope-hoisting/reexport-exposed-harmony/index.js b/test/cases/scope-hoisting/reexport-exposed-harmony/index.js index f9a31c159..44e195598 100644 --- a/test/cases/scope-hoisting/reexport-exposed-harmony/index.js +++ b/test/cases/scope-hoisting/reexport-exposed-harmony/index.js @@ -1,5 +1,5 @@ var c = require("./c"); it("should have the correct values", function() { - c.named.should.be.eql("named"); + expect(c.named).toBe("named"); }); diff --git a/test/cases/scope-hoisting/renaming-4967/index.js b/test/cases/scope-hoisting/renaming-4967/index.js index 445ebec05..bcde84c0d 100644 --- a/test/cases/scope-hoisting/renaming-4967/index.js +++ b/test/cases/scope-hoisting/renaming-4967/index.js @@ -1,5 +1,5 @@ it("should check existing variables when renaming", function() { - require("./module").d.x().should.be.eql("ok"); - require("./module").c.a().should.be.eql("ok"); - require("./module").test().should.be.eql("ok"); + expect(require("./module").d.x()).toBe("ok"); + expect(require("./module").c.a()).toBe("ok"); + expect(require("./module").test()).toBe("ok"); }); diff --git a/test/cases/scope-hoisting/renaming-shorthand-5027/index.js b/test/cases/scope-hoisting/renaming-shorthand-5027/index.js index 7a7318ea7..5b58a8401 100644 --- a/test/cases/scope-hoisting/renaming-shorthand-5027/index.js +++ b/test/cases/scope-hoisting/renaming-shorthand-5027/index.js @@ -1,7 +1,7 @@ import m from "./module"; it("should apply shorthand properties correctly when renaming", function() { - m.should.be.eql({ + expect(m).toEqual({ obj: { test: "test1", test2: "test2", diff --git a/test/cases/scope-hoisting/require-root-5604/index.js b/test/cases/scope-hoisting/require-root-5604/index.js index 0aeb495bb..040925c6b 100644 --- a/test/cases/scope-hoisting/require-root-5604/index.js +++ b/test/cases/scope-hoisting/require-root-5604/index.js @@ -2,7 +2,7 @@ import value, { self as moduleSelf } from "./module"; export var self = require("./"); it("should have the correct values", function() { - value.should.be.eql("default"); - moduleSelf.should.be.eql(self); - self.self.should.be.eql(self); + expect(value).toBe("default"); + expect(moduleSelf).toBe(self); + expect(self.self).toBe(self); }); diff --git a/test/cases/scope-hoisting/simple/index.js b/test/cases/scope-hoisting/simple/index.js index b0ca24d53..2df9c1a85 100644 --- a/test/cases/scope-hoisting/simple/index.js +++ b/test/cases/scope-hoisting/simple/index.js @@ -1,6 +1,6 @@ import value, { named } from "./module"; it("should have the correct values", function() { - value.should.be.eql("default"); - named.should.be.eql("named"); + expect(value).toBe("default"); + expect(named).toBe("named"); }); diff --git a/test/cases/wasm/decoding/index.js b/test/cases/wasm/decoding/index.js new file mode 100644 index 000000000..5951edc43 --- /dev/null +++ b/test/cases/wasm/decoding/index.js @@ -0,0 +1,15 @@ +it("should support wasm compiled from c++", function() { + return import("./memory3.wasm").then(function(wasm) { + expect(wasm._Z3getv()).toBe(0); + wasm._Z3seti(42); + expect(wasm._Z3getv()).toBe(42); + }); +}); + +it("should raw memory export without data", function() { + return import("./memory2.wasm").then(function(wasm) { + expect(wasm.memory).toBeInstanceOf(WebAssembly.Memory); + expect(wasm.memory.buffer).toBeInstanceOf(ArrayBuffer); + expect(wasm.memory.buffer.byteLength).toBe(1 << 16); + }); +}); diff --git a/test/cases/wasm/decoding/memory2.wasm b/test/cases/wasm/decoding/memory2.wasm new file mode 100644 index 000000000..654daf1d9 Binary files /dev/null and b/test/cases/wasm/decoding/memory2.wasm differ diff --git a/test/cases/wasm/decoding/memory3.wasm b/test/cases/wasm/decoding/memory3.wasm new file mode 100644 index 000000000..0c2ca20c8 Binary files /dev/null and b/test/cases/wasm/decoding/memory3.wasm differ diff --git a/test/cases/wasm/decoding/test.filter.js b/test/cases/wasm/decoding/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/cases/wasm/decoding/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/cases/wasm/import-wasm-wasm/index.js b/test/cases/wasm/import-wasm-wasm/index.js index bdc8813c3..f73e0b893 100644 --- a/test/cases/wasm/import-wasm-wasm/index.js +++ b/test/cases/wasm/import-wasm-wasm/index.js @@ -1,6 +1,6 @@ it("should allow to run a WebAssembly module with imports", function() { return import("./wasm.wasm").then(function(wasm) { const result = wasm.addNumber(20); - result.should.be.eql(42); + expect(result).toEqual(42); }); }); diff --git a/test/cases/wasm/imports-circular/index.js b/test/cases/wasm/imports-circular/index.js index c76871b00..288ab4213 100644 --- a/test/cases/wasm/imports-circular/index.js +++ b/test/cases/wasm/imports-circular/index.js @@ -1,5 +1,5 @@ it("should allow to run a WebAssembly module importing JS circular", function() { return import("./module").then(function(mod) { - mod.result.should.be.eql(42); + expect(mod.result).toBe(42); }); }); diff --git a/test/cases/wasm/imports/index.js b/test/cases/wasm/imports/index.js index d562c4a28..d71f2190c 100644 --- a/test/cases/wasm/imports/index.js +++ b/test/cases/wasm/imports/index.js @@ -1,6 +1,6 @@ it("should allow to run a WebAssembly module with imports", function() { return import("./wasm.wasm?1").then(function(wasm) { const result = wasm.addNumber(3); - result.should.be.eql(11); + expect(result).toEqual(11); }); }); diff --git a/test/cases/wasm/memory/index.js b/test/cases/wasm/memory/index.js new file mode 100644 index 000000000..7b3387ebe --- /dev/null +++ b/test/cases/wasm/memory/index.js @@ -0,0 +1,8 @@ +it("should allow direct memory connection between wasm modules", function() { + return import("./run").then(function(module) { + expect(module.x1).toBe(42); + expect(module.x2).toBe(42); + expect(module.y1).toBe(11); + expect(module.y2).toBe(11); + }); +}); diff --git a/test/cases/wasm/memory/mem-access.wasm b/test/cases/wasm/memory/mem-access.wasm new file mode 100644 index 000000000..9150b70d0 Binary files /dev/null and b/test/cases/wasm/memory/mem-access.wasm differ diff --git a/test/cases/wasm/memory/memory.wasm b/test/cases/wasm/memory/memory.wasm new file mode 100644 index 000000000..4c0947396 Binary files /dev/null and b/test/cases/wasm/memory/memory.wasm differ diff --git a/test/cases/wasm/memory/run.js b/test/cases/wasm/memory/run.js new file mode 100644 index 000000000..dd9f0136c --- /dev/null +++ b/test/cases/wasm/memory/run.js @@ -0,0 +1,9 @@ +import * as a1 from "./mem-access.wasm?1"; +import * as a2 from "./mem-access.wasm?2"; + +a1.set(42); +export const x1 = a1.get(); +export const x2 = a2.get(); +a2.set(11); +export const y1 = a1.get(); +export const y2 = a2.get(); diff --git a/test/cases/wasm/memory/test.filter.js b/test/cases/wasm/memory/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/cases/wasm/memory/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/cases/wasm/order/index.js b/test/cases/wasm/order/index.js index 9fb91d7e6..f272a9002 100644 --- a/test/cases/wasm/order/index.js +++ b/test/cases/wasm/order/index.js @@ -1,7 +1,7 @@ it("should be evaluated in the correct order", () => { return import("./a").then(({ default: results }) => { return Promise.resolve().then(() => { // wait an extra tick to get the tick from the tracker - results.should.be.eql(["b", "c", "wasm42", "a", "tick"]); + expect(results).toEqual(["b", "c", "wasm42", "a", "tick"]); }); }); }); diff --git a/test/cases/wasm/simple/index.js b/test/cases/wasm/simple/index.js index ab607d81b..b3069c705 100644 --- a/test/cases/wasm/simple/index.js +++ b/test/cases/wasm/simple/index.js @@ -1,13 +1,13 @@ it("should allow to run a WebAssembly module (indirect)", function() { return import("./module").then(function(module) { const result = module.run(); - result.should.be.eql(42); + expect(result).toEqual(42); }); }); it("should allow to run a WebAssembly module (direct)", function() { return import("./wasm.wasm?2").then(function(wasm) { const result = wasm.add(wasm.getNumber(), 2); - result.should.be.eql(42); + expect(result).toEqual(42); }); }); diff --git a/test/cases/wasm/table/index.js b/test/cases/wasm/table/index.js new file mode 100644 index 000000000..ccf56c521 --- /dev/null +++ b/test/cases/wasm/table/index.js @@ -0,0 +1,31 @@ +// the message is inconsistency between some nodejs versions +const UNKNOWN_FUNCTION_TABLE = /invalid index into function table|invalid function/; + +it("should support tables", function() { + return import("./wasm-table.wasm").then(function(wasm) { + expect(wasm.callByIndex(0)).toEqual(42); + expect(wasm.callByIndex(1)).toEqual(13); + expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE); + }); +}); + +it("should support exported tables", function() { + return import("./wasm-table-export.wasm").then(function(wasm) { + expect(wasm.table).toBeInstanceOf(WebAssembly.Table); + expect(wasm.table.length).toBe(2); + const e0 = wasm.table.get(0); + const e1 = wasm.table.get(1); + expect(e0).toBeInstanceOf(Function); + expect(e1).toBeInstanceOf(Function); + expect(e0()).toEqual(42); + expect(e1()).toEqual(13); + }); +}); + +it("should support imported tables", function() { + return import("./wasm-table-imported.wasm").then(function(wasm) { + expect(wasm.callByIndex(0)).toEqual(42); + expect(wasm.callByIndex(1)).toEqual(13); + expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE); + }); +}); diff --git a/test/cases/wasm/table/test.filter.js b/test/cases/wasm/table/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/cases/wasm/table/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/cases/wasm/table/wasm-table-export.wasm b/test/cases/wasm/table/wasm-table-export.wasm new file mode 100644 index 000000000..29dba5168 Binary files /dev/null and b/test/cases/wasm/table/wasm-table-export.wasm differ diff --git a/test/cases/wasm/table/wasm-table-imported.wasm b/test/cases/wasm/table/wasm-table-imported.wasm new file mode 100644 index 000000000..446719fd6 Binary files /dev/null and b/test/cases/wasm/table/wasm-table-imported.wasm differ diff --git a/test/cases/wasm/table/wasm-table.wasm b/test/cases/wasm/table/wasm-table.wasm new file mode 100644 index 000000000..157fe739c Binary files /dev/null and b/test/cases/wasm/table/wasm-table.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-async/Q_rsqrt.wasm b/test/cases/wasm/wasm-explorer-examples-async/Q_rsqrt.wasm new file mode 100644 index 000000000..e5c17c16d Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-async/Q_rsqrt.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-async/duff.wasm b/test/cases/wasm/wasm-explorer-examples-async/duff.wasm new file mode 100644 index 000000000..0b75ea455 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-async/duff.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-async/fact.wasm b/test/cases/wasm/wasm-explorer-examples-async/fact.wasm new file mode 100644 index 000000000..50ce8c098 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-async/fact.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-async/fast-math.wasm b/test/cases/wasm/wasm-explorer-examples-async/fast-math.wasm new file mode 100644 index 000000000..1733deb9b Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-async/fast-math.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-async/index.js b/test/cases/wasm/wasm-explorer-examples-async/index.js new file mode 100644 index 000000000..d2eed3af8 --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-async/index.js @@ -0,0 +1,55 @@ +it("Q_rsqrt should work", function() { + return import("./Q_rsqrt.wasm").then(function(wasm) { + const result = wasm._Z7Q_rsqrtf(1/1764); + expect(result).toBeGreaterThan(41.9); + expect(result).toBeLessThan(42.1); + }); +}); + +it("testFunction should work", function() { + return import("./testFunction.wasm").then(function(wasm) { + const view = new Int32Array(wasm.memory.buffer); + view[0] = 123; + view[1] = 1; + view[2] = 2; + view[3] = 3; + const result = wasm._Z12testFunctionPii(4, 3); + expect(result).toEqual(6); + }); +}); + +it("fact should work", function() { + return import("./fact.wasm").then(function(wasm) { + const result = wasm._Z4facti(11); + expect(result).toEqual(39916800); + }); +}); + +it("popcnt should work", function() { + return import("./popcnt.wasm").then(function(wasm) { + expect(wasm.main(0xF0F)).toEqual(16); + expect(wasm._Z5countj(0xF0F)).toEqual(8); + }); +}); + +it("fast-math should work", function() { + return import("./fast-math.wasm").then(function(wasm) { + expect(wasm._Z3food(42)).toEqual(14); + expect(wasm._Z9maybe_mindd(42, 24)).toEqual(24); + expect(wasm._Z8call_powd(42)).toEqual(9682651996416); + expect(wasm._Z6do_powd(42)).toEqual(9682651996416); + expect(wasm._Z6factorddd(42, 42, 42)).toEqual(3528); + }); +}); + +it("duff should work", function() { + return import("./duff.wasm").then(function(wasm) { + const view = new Uint8Array(wasm.memory.buffer); + view[0] = 123; + for(let i = 1; i < 100; i++) + view[i] = i; + const result = wasm._Z4sendPcS_m(200, 1, 100); + for(let i = 1; i < 100; i++) + expect(view[199 + i]).toEqual(i); + }); +}); diff --git a/test/cases/wasm/wasm-explorer-examples-async/node_modules/env.js b/test/cases/wasm/wasm-explorer-examples-async/node_modules/env.js new file mode 100644 index 000000000..bb82d984b --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-async/node_modules/env.js @@ -0,0 +1 @@ +export const _Z3powdd = Math.pow; diff --git a/test/cases/wasm/wasm-explorer-examples-async/popcnt.wasm b/test/cases/wasm/wasm-explorer-examples-async/popcnt.wasm new file mode 100644 index 000000000..f605a5a95 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-async/popcnt.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-async/test.filter.js b/test/cases/wasm/wasm-explorer-examples-async/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-async/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/cases/wasm/wasm-explorer-examples-async/testFunction.wasm b/test/cases/wasm/wasm-explorer-examples-async/testFunction.wasm new file mode 100644 index 000000000..3be47ce57 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-async/testFunction.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/Q_rsqrt.wasm b/test/cases/wasm/wasm-explorer-examples-sync/Q_rsqrt.wasm new file mode 100644 index 000000000..e5c17c16d Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-sync/Q_rsqrt.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/duff.wasm b/test/cases/wasm/wasm-explorer-examples-sync/duff.wasm new file mode 100644 index 000000000..0b75ea455 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-sync/duff.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/fact.wasm b/test/cases/wasm/wasm-explorer-examples-sync/fact.wasm new file mode 100644 index 000000000..50ce8c098 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-sync/fact.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/fast-math.wasm b/test/cases/wasm/wasm-explorer-examples-sync/fast-math.wasm new file mode 100644 index 000000000..1733deb9b Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-sync/fast-math.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/index.js b/test/cases/wasm/wasm-explorer-examples-sync/index.js new file mode 100644 index 000000000..a9cfd3a36 --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-sync/index.js @@ -0,0 +1,23 @@ +it("Q_rsqrt should work", function() { + return import("./tests").then(t => t.run_Q_rsqrt()); +}); + +it("testFunction should work", function() { + return import("./tests").then(t => t.run_testFunction()); +}); + +it("fact should work", function() { + return import("./tests").then(t => t.run_fact()); +}); + +it("popcnt should work", function() { + return import("./tests").then(t => t.run_popcnt()); +}); + +it("fast-math should work", function() { + return import("./tests").then(t => t.run_fastMath()); +}); + +it("duff should work", function() { + return import("./tests").then(t => t.run_duff()); +}); diff --git a/test/cases/wasm/wasm-explorer-examples-sync/node_modules/env.js b/test/cases/wasm/wasm-explorer-examples-sync/node_modules/env.js new file mode 100644 index 000000000..bb82d984b --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-sync/node_modules/env.js @@ -0,0 +1 @@ +export const _Z3powdd = Math.pow; diff --git a/test/cases/wasm/wasm-explorer-examples-sync/popcnt.wasm b/test/cases/wasm/wasm-explorer-examples-sync/popcnt.wasm new file mode 100644 index 000000000..f605a5a95 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-sync/popcnt.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js b/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-sync/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/cases/wasm/wasm-explorer-examples-sync/testFunction.wasm b/test/cases/wasm/wasm-explorer-examples-sync/testFunction.wasm new file mode 100644 index 000000000..3be47ce57 Binary files /dev/null and b/test/cases/wasm/wasm-explorer-examples-sync/testFunction.wasm differ diff --git a/test/cases/wasm/wasm-explorer-examples-sync/tests.js b/test/cases/wasm/wasm-explorer-examples-sync/tests.js new file mode 100644 index 000000000..c957248a9 --- /dev/null +++ b/test/cases/wasm/wasm-explorer-examples-sync/tests.js @@ -0,0 +1,50 @@ +import * as Q_rsqrt from "./Q_rsqrt.wasm"; +import * as testFunction from "./testFunction.wasm"; +import * as fact from "./fact.wasm"; +import * as popcnt from "./popcnt.wasm"; +import * as fastMath from "./fast-math.wasm"; +import * as duff from "./duff.wasm"; + +export function run_Q_rsqrt() { + const result = Q_rsqrt._Z7Q_rsqrtf(1/1764); + expect(result).toBeGreaterThan(41.9); + expect(result).toBeLessThan(42.1); +} + +export function run_testFunction() { + const view = new Int32Array(testFunction.memory.buffer); + view[0] = 123; + view[1] = 1; + view[2] = 2; + view[3] = 3; + const result = testFunction._Z12testFunctionPii(4, 3); + expect(result).toEqual(6); +} + +export function run_fact() { + const result = fact._Z4facti(11); + expect(result).toEqual(39916800); +} + +export function run_popcnt() { + expect(popcnt.main(0xF0F)).toEqual(16); + expect(popcnt._Z5countj(0xF0F)).toEqual(8); +} + +export function run_fastMath() { + expect(fastMath._Z3food(42)).toEqual(14); + expect(fastMath._Z9maybe_mindd(42, 24)).toEqual(24); + expect(fastMath._Z8call_powd(42)).toEqual(9682651996416); + expect(fastMath._Z6do_powd(42)).toEqual(9682651996416); + expect(fastMath._Z6factorddd(42, 42, 42)).toEqual(3528); +} + +export function run_duff() { + const view = new Uint8Array(duff.memory.buffer); + view[0] = 123; + for(let i = 1; i < 100; i++) + view[i] = i; + const result = duff._Z4sendPcS_m(200, 1, 100); + for(let i = 1; i < 100; i++) + expect(view[199 + i]).toEqual(i); +} diff --git a/test/compareLocations.unittest.js b/test/compareLocations.unittest.js index 4572fd5cf..53d68daf5 100644 --- a/test/compareLocations.unittest.js +++ b/test/compareLocations.unittest.js @@ -1,8 +1,7 @@ "use strict"; -const should = require("should"); const compareLocations = require("../lib/compareLocations"); -const createPosition = function(overrides) { +const createPosition = overrides => { return Object.assign( { line: 10, @@ -12,7 +11,7 @@ const createPosition = function(overrides) { ); }; -const createLocation = function(start, end, index) { +const createLocation = (start, end, index) => { return { start: createPosition(start), end: createPosition(end), @@ -22,14 +21,17 @@ const createLocation = function(start, end, index) { describe("compareLocations", () => { describe("string location comparison", () => { - it("returns -1 when the first string comes before the second string", () => - compareLocations("alpha", "beta").should.be.exactly(-1)); + it("returns -1 when the first string comes before the second string", () => { + expect(compareLocations("alpha", "beta")).toBe(-1); + }); - it("returns 1 when the first string comes after the second string", () => - compareLocations("beta", "alpha").should.be.exactly(1)); + it("returns 1 when the first string comes after the second string", () => { + expect(compareLocations("beta", "alpha")).toBe(1); + }); - it("returns 0 when the first string is the same as the second string", () => - compareLocations("charlie", "charlie").should.be.exactly(0)); + it("returns 0 when the first string is the same as the second string", () => { + expect(compareLocations("charlie", "charlie")).toBe(0); + }); }); describe("object location comparison", () => { @@ -46,11 +48,12 @@ describe("compareLocations", () => { }); it("returns -1 when the first location line number comes before the second location line number", () => { - return compareLocations(a, b).should.be.exactly(-1); + expect(compareLocations(a, b)).toBe(-1); }); - it("returns 1 when the first location line number comes after the second location line number", () => - compareLocations(b, a).should.be.exactly(1)); + it("returns 1 when the first location line number comes after the second location line number", () => { + expect(compareLocations(b, a)).toBe(1); + }); }); describe("location column number", () => { @@ -63,11 +66,13 @@ describe("compareLocations", () => { }); }); - it("returns -1 when the first location column number comes before the second location column number", () => - compareLocations(a, b).should.be.exactly(-1)); + it("returns -1 when the first location column number comes before the second location column number", () => { + expect(compareLocations(a, b)).toBe(-1); + }); - it("returns 1 when the first location column number comes after the second location column number", () => - compareLocations(b, a).should.be.exactly(1)); + it("returns 1 when the first location column number comes after the second location column number", () => { + expect(compareLocations(b, a)).toBe(1); + }); }); describe("location index number", () => { @@ -76,11 +81,13 @@ describe("compareLocations", () => { b = createLocation(null, null, 20); }); - it("returns -1 when the first location index number comes before the second location index number", () => - compareLocations(a, b).should.be.exactly(-1)); + it("returns -1 when the first location index number comes before the second location index number", () => { + expect(compareLocations(a, b)).toBe(-1); + }); - it("returns 1 when the first location index number comes after the second location index number", () => - compareLocations(b, a).should.be.exactly(1)); + it("returns 1 when the first location index number comes after the second location index number", () => { + expect(compareLocations(b, a)).toBe(1); + }); }); describe("same location", () => { @@ -90,33 +97,40 @@ describe("compareLocations", () => { }); it("returns 0", () => { - compareLocations(a, b).should.be.exactly(0); + expect(compareLocations(a, b)).toBe(0); }); }); }); describe("string and object location comparison", () => { - it("returns 1 when the first parameter is a string and the second parameter is an object", () => - compareLocations("alpha", createLocation()).should.be.exactly(1)); + it("returns 1 when the first parameter is a string and the second parameter is an object", () => { + expect(compareLocations("alpha", createLocation())).toBe(1); + }); - it("returns -1 when the first parameter is an object and the second parameter is a string", () => - compareLocations(createLocation(), "alpha").should.be.exactly(-1)); + it("returns -1 when the first parameter is an object and the second parameter is a string", () => { + expect(compareLocations(createLocation(), "alpha")).toBe(-1); + }); }); describe("unknown location type comparison", () => { - it("returns 0 when the first parameter is an object and the second parameter is a number", () => - compareLocations(createLocation(), 123).should.be.exactly(0)); + it("returns 0 when the first parameter is an object and the second parameter is a number", () => { + expect(compareLocations(createLocation(), 123)).toBe(0); + }); - it("returns undefined when the first parameter is a number and the second parameter is an object", () => - should(compareLocations(123, createLocation())).be.undefined()); + it("returns undefined when the first parameter is a number and the second parameter is an object", () => { + expect(compareLocations(123, createLocation())).toBe(undefined); + }); - it("returns 0 when the first parameter is a string and the second parameter is a number", () => - compareLocations("alpha", 123).should.be.exactly(0)); + it("returns 0 when the first parameter is a string and the second parameter is a number", () => { + expect(compareLocations("alpha", 123)).toBe(0); + }); - it("returns undefined when the first parameter is a number and the second parameter is a string", () => - should(compareLocations(123, "alpha")).be.undefined()); + it("returns undefined when the first parameter is a number and the second parameter is a string", () => { + expect(compareLocations(123, "alpha")).toBe(undefined); + }); - it("returns undefined when both the first parameter and the second parameter is a number", () => - should(compareLocations(123, 456)).be.undefined()); + it("returns undefined when both the first parameter and the second parameter is a number", () => { + expect(compareLocations(123, 456)).toBe(undefined); + }); }); }); diff --git a/test/configCases/async-commons-chunk/all-selected/index.js b/test/configCases/async-commons-chunk/all-selected/index.js index 474da4c16..cfc15c09e 100644 --- a/test/configCases/async-commons-chunk/all-selected/index.js +++ b/test/configCases/async-commons-chunk/all-selected/index.js @@ -1,22 +1,22 @@ it("should load the full async commons", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); done(); }); }); it("should load a chunk with async commons (AMD)", function(done) { require(["./a", "./b"], function(a, b) { - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(a).toBe("a"); + expect(b).toBe("b"); done(); }); }); it("should load a chunk with async commons (require.ensure)", function(done) { require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./c")).toBe("c"); done(); }); }); diff --git a/test/configCases/async-commons-chunk/duplicate/index.js b/test/configCases/async-commons-chunk/duplicate/index.js index 8209ce099..7370a4064 100644 --- a/test/configCases/async-commons-chunk/duplicate/index.js +++ b/test/configCases/async-commons-chunk/duplicate/index.js @@ -1,28 +1,28 @@ it("should load nested commons chunk", function(done) { var counter = 0; require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); require.ensure(["./c", "./d"], function(require) { - require("./c").should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(require("./c")).toBe("c"); + expect(require("./d")).toBe("d"); if(++counter == 4) done(); }); require.ensure(["./c", "./e"], function(require) { - require("./c").should.be.eql("c"); - require("./e").should.be.eql("e"); + expect(require("./c")).toBe("c"); + expect(require("./e")).toBe("e"); if(++counter == 4) done(); }); }); require.ensure(["./b"], function(require) { - require("./b").should.be.eql("b"); + expect(require("./b")).toBe("b"); require.ensure(["./c", "./d"], function(require) { - require("./c").should.be.eql("c"); - require("./d").should.be.eql("d"); + expect(require("./c")).toBe("c"); + expect(require("./d")).toBe("d"); if(++counter == 4) done(); }); require.ensure(["./c", "./e"], function(require) { - require("./c").should.be.eql("c"); - require("./e").should.be.eql("e"); + expect(require("./c")).toBe("c"); + expect(require("./e")).toBe("e"); if(++counter == 4) done(); }); }); diff --git a/test/configCases/async-commons-chunk/existing-name/index.js b/test/configCases/async-commons-chunk/existing-name/index.js index 3166ba893..5a65f392d 100644 --- a/test/configCases/async-commons-chunk/existing-name/index.js +++ b/test/configCases/async-commons-chunk/existing-name/index.js @@ -1,33 +1,31 @@ -require("should"); -const sinon = require("sinon"); -const chunkLoadingSpy = sinon.spy(__webpack_require__, "e"); +const chunkLoadingSpy = jest.spyOn(__webpack_require__, "e"); it("should not have duplicate chunks in blocks", function(done) { // This split point should contain: a require.ensure([], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); }, "a"); // This split point should contain: a and b - we use CommonsChunksPlugin to // have it only contain b and make chunk a be an async dependency. require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./b").should.be.eql("b"); + expect(require("./a")).toBe("a"); + expect(require("./b")).toBe("b"); }, "a+b"); // This split point should contain: a, b and c - we use CommonsChunksPlugin to // have it only contain c and make chunks a and a+b be async dependencies. require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./b").should.be.eql("b"); - require("./c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./b")).toBe("b"); + expect(require("./c")).toBe("c"); }, "a+b+c"); // Each of the require.ensures above should end up resolving chunks: // - a // - a, a+b // - a, a+b, a+b+c - chunkLoadingSpy.callCount.should.be.eql(6); - chunkLoadingSpy.args.should.be.eql([["a"], ["a"], ["a+b~a+b+c" /* == b */], ["a"], ["a+b~a+b+c" /* == b */], ["a+b+c"]]); + expect(chunkLoadingSpy.mock.calls.length).toBe(6); + expect(chunkLoadingSpy.mock.calls).toEqual([["a"], ["a"], ["a+b~a+b+c" /* == b */], ["a"], ["a+b~a+b+c" /* == b */], ["a+b+c"]]); done(); }); diff --git a/test/configCases/async-commons-chunk/nested/index.js b/test/configCases/async-commons-chunk/nested/index.js index 374a2cca8..255659c5c 100644 --- a/test/configCases/async-commons-chunk/nested/index.js +++ b/test/configCases/async-commons-chunk/nested/index.js @@ -1,19 +1,19 @@ it("should load nested commons chunk", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); var counter = 0; require.ensure(["./b", "./c"], function(require) { - require("./b").should.be.eql("b"); - require("./c").should.be.eql("c"); + expect(require("./b")).toBe("b"); + expect(require("./c")).toBe("c"); if(++counter == 3) done(); }); require.ensure(["./b", "./d"], function(require) { - require("./b").should.be.eql("b"); - require("./d").should.be.eql("d"); + expect(require("./b")).toBe("b"); + expect(require("./d")).toBe("d"); if(++counter == 3) done(); }); require.ensure(["./b"], function(require) { - require("./b").should.be.eql("b"); + expect(require("./b")).toBe("b"); if(++counter == 3) done(); }); }); diff --git a/test/configCases/async-commons-chunk/simple/index.js b/test/configCases/async-commons-chunk/simple/index.js index 474da4c16..cfc15c09e 100644 --- a/test/configCases/async-commons-chunk/simple/index.js +++ b/test/configCases/async-commons-chunk/simple/index.js @@ -1,22 +1,22 @@ it("should load the full async commons", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); done(); }); }); it("should load a chunk with async commons (AMD)", function(done) { require(["./a", "./b"], function(a, b) { - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(a).toBe("a"); + expect(b).toBe("b"); done(); }); }); it("should load a chunk with async commons (require.ensure)", function(done) { require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./c")).toBe("c"); done(); }); }); diff --git a/test/configCases/code-generation/require-context-id/index.js b/test/configCases/code-generation/require-context-id/index.js index a3002be89..6dc75d007 100644 --- a/test/configCases/code-generation/require-context-id/index.js +++ b/test/configCases/code-generation/require-context-id/index.js @@ -1,5 +1,5 @@ it("should escape require.context id correctly", function() { var context = require.context("./folder"); - context("./a").should.be.eql("a"); - context.id.should.be.type("string"); + expect(context("./a")).toBe("a"); + expect(context.id).toBeTypeOf("string"); }); diff --git a/test/configCases/code-generation/use-strict/index.js b/test/configCases/code-generation/use-strict/index.js index ff811c676..cf05674be 100644 --- a/test/configCases/code-generation/use-strict/index.js +++ b/test/configCases/code-generation/use-strict/index.js @@ -15,7 +15,7 @@ it("should include only one use strict per module", function() { match = regExp.exec(source); } - matches.should.be.eql([ + expect(matches).toEqual([ "__webpack_require__.r(__webpack_exports__);", "/* unused harmony default export */ var _unused_webpack_default_export = (\"a\");", "__webpack_require__.r(__webpack_exports__);", diff --git a/test/configCases/commons-chunk-plugin/correct-order/index.js b/test/configCases/commons-chunk-plugin/correct-order/index.js index 10d9a9900..112e38a78 100644 --- a/test/configCases/commons-chunk-plugin/correct-order/index.js +++ b/test/configCases/commons-chunk-plugin/correct-order/index.js @@ -1,13 +1,11 @@ -require("should"); - var a = require("./a"); it("should run", function() { - a.should.be.eql("a"); + expect(a).toBe("a"); }); var mainModule = require.main; it("should be main", function() { - mainModule.should.be.eql(module); + expect(mainModule).toBe(module); }); diff --git a/test/configCases/commons-chunk-plugin/extract-async-from-entry/index.js b/test/configCases/commons-chunk-plugin/extract-async-from-entry/index.js index f53987e50..cbab26b2d 100644 --- a/test/configCases/commons-chunk-plugin/extract-async-from-entry/index.js +++ b/test/configCases/commons-chunk-plugin/extract-async-from-entry/index.js @@ -1,4 +1 @@ -require("should"); - -it("should run successful", function() { -}); +it("should run successful", function() {}); diff --git a/test/configCases/commons-chunk-plugin/hot-multi/first.js b/test/configCases/commons-chunk-plugin/hot-multi/first.js index 0775bfc22..751a8042f 100644 --- a/test/configCases/commons-chunk-plugin/hot-multi/first.js +++ b/test/configCases/commons-chunk-plugin/hot-multi/first.js @@ -1,8 +1,6 @@ -require("should"); - require("./common"); it("should have the correct main flag for multi first module", function() { var multiModule = __webpack_require__.c[module.parents[0]]; - multiModule.hot._main.should.be.eql(true); + expect(multiModule.hot._main).toBe(true); }); diff --git a/test/configCases/commons-chunk-plugin/hot-multi/second.js b/test/configCases/commons-chunk-plugin/hot-multi/second.js index facb4a27e..fd42f8148 100644 --- a/test/configCases/commons-chunk-plugin/hot-multi/second.js +++ b/test/configCases/commons-chunk-plugin/hot-multi/second.js @@ -1,8 +1,6 @@ -require("should"); - require("./common"); it("should have the correct main flag for multi second module", function() { var multiModule = __webpack_require__.c[module.parents[0]]; - multiModule.hot._main.should.be.eql(true); + expect(multiModule.hot._main).toBe(true); }); diff --git a/test/configCases/commons-chunk-plugin/hot-multi/vendor.js b/test/configCases/commons-chunk-plugin/hot-multi/vendor.js index b2c70c298..abba7de3a 100644 --- a/test/configCases/commons-chunk-plugin/hot-multi/vendor.js +++ b/test/configCases/commons-chunk-plugin/hot-multi/vendor.js @@ -4,5 +4,5 @@ module.exports = "vendor"; it("should have the correct main flag for multi vendor module", function() { var multiModule = __webpack_require__.c[module.parents[0]]; - multiModule.hot._main.should.be.eql(true); + expect(multiModule.hot._main).toBe(true); }); diff --git a/test/configCases/commons-chunk-plugin/hot/index.js b/test/configCases/commons-chunk-plugin/hot/index.js index affedf39c..105978c4e 100644 --- a/test/configCases/commons-chunk-plugin/hot/index.js +++ b/test/configCases/commons-chunk-plugin/hot/index.js @@ -1,11 +1,9 @@ -require("should"); - it("should have the correct main flag", function() { var a = require("./vendor"); - a._main.should.be.eql(false); - module.hot._main.should.be.eql(true); + expect(a._main).toBe(false); + expect(module.hot._main).toBe(true); }); it("should be main", function() { - require.main.should.be.eql(module); + expect(require.main).toBe(module); }); diff --git a/test/configCases/commons-chunk-plugin/inverted-order/index.js b/test/configCases/commons-chunk-plugin/inverted-order/index.js index 10d9a9900..112e38a78 100644 --- a/test/configCases/commons-chunk-plugin/inverted-order/index.js +++ b/test/configCases/commons-chunk-plugin/inverted-order/index.js @@ -1,13 +1,11 @@ -require("should"); - var a = require("./a"); it("should run", function() { - a.should.be.eql("a"); + expect(a).toBe("a"); }); var mainModule = require.main; it("should be main", function() { - mainModule.should.be.eql(module); + expect(mainModule).toBe(module); }); diff --git a/test/configCases/commons-chunk-plugin/library/index.js b/test/configCases/commons-chunk-plugin/library/index.js index 6bef6f166..02d3fa5c3 100644 --- a/test/configCases/commons-chunk-plugin/library/index.js +++ b/test/configCases/commons-chunk-plugin/library/index.js @@ -1,4 +1,3 @@ -require("should"); require.include("external1"); require.ensure([], function() { require.include("external2"); @@ -6,7 +5,7 @@ require.ensure([], function() { it("should have externals in main file", function() { var a = require("./a"); - a.vendor.should.containEql("require(\"external0\")"); - a.main.should.containEql("require(\"external1\")"); - a.main.should.containEql("require(\"external2\")"); + expect(a.vendor).toMatch("require(\"external0\")"); + expect(a.main).toMatch("require(\"external1\")"); + expect(a.main).toMatch("require(\"external2\")"); }); diff --git a/test/configCases/commons-chunk-plugin/move-entry/index.js b/test/configCases/commons-chunk-plugin/move-entry/index.js index 0263082b9..36b4da6e9 100644 --- a/test/configCases/commons-chunk-plugin/move-entry/index.js +++ b/test/configCases/commons-chunk-plugin/move-entry/index.js @@ -1,5 +1,3 @@ -require("should"); - it("should not be moved", function() { - new Error().stack.should.not.match(/webpackBootstrap/); + expect(new Error().stack).not.toMatch(/webpackBootstrap/); }); diff --git a/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js b/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js index 5c459f215..abee1e85c 100644 --- a/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js +++ b/test/configCases/commons-chunk-plugin/move-to-grandparent/index.js @@ -3,8 +3,8 @@ it("should correctly include indirect children in common chunk", function(done) import('./pageA'), import('./pageB').then(m => m.default) ]).then((imports) => { - imports[0].default.should.be.eql("reuse"); - imports[1].default.should.be.eql("reuse"); + expect(imports[0].default).toBe("reuse"); + expect(imports[1].default).toBe("reuse"); done(); }).catch(e => { done(e); diff --git a/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js b/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js index c661ef828..750ace95c 100644 --- a/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js +++ b/test/configCases/commons-chunk-plugin/move-to-grandparent/second.js @@ -1,6 +1,6 @@ it("should handle indirect children with multiple parents correctly", function(done) { import('./pageB').then(b => { - b.default.should.be.eql("reuse"); + expect(b.default).toBe("reuse"); done() }).catch(e => { done(); diff --git a/test/configCases/commons-chunk-plugin/simple/index.js b/test/configCases/commons-chunk-plugin/simple/index.js index 60fcce8a7..ca28fa41f 100644 --- a/test/configCases/commons-chunk-plugin/simple/index.js +++ b/test/configCases/commons-chunk-plugin/simple/index.js @@ -1,10 +1,8 @@ -require("should"); - it("should run", function() { var a = require("./a"); - a.should.be.eql("a"); + expect(a).toBe("a"); }); it("should be main", function() { - require.main.should.be.eql(module); -}); \ No newline at end of file + expect(require.main).toBe(module); +}); diff --git a/test/configCases/context-exclusion/simple/index.js b/test/configCases/context-exclusion/simple/index.js index 90ea02744..47eb9afe0 100644 --- a/test/configCases/context-exclusion/simple/index.js +++ b/test/configCases/context-exclusion/simple/index.js @@ -3,18 +3,15 @@ function requireInContext(someVariable) { } it("should not exclude paths not matching the exclusion pattern", function() { - requireInContext("file").should.be.eql("thats good"); - requireInContext("check-here/file").should.be.eql("thats good"); - requireInContext("check-here/check-here/file").should.be.eql("thats good"); + expect(requireInContext("file")).toBe("thats good"); + expect(requireInContext("check-here/file")).toBe("thats good"); + expect(requireInContext("check-here/check-here/file")).toBe("thats good"); }); it("should exclude paths/files matching the exclusion pattern", function() { - (() => requireInContext("dont")). - should.throw(/Cannot find module ".\/dont"/); + expect(() => requireInContext("dont")).toThrowError(/Cannot find module '.\/dont'/); - (() => requireInContext("dont-check-here/file")). - should.throw(/Cannot find module ".\/dont-check-here\/file"/); + expect(() => requireInContext("dont-check-here/file")).toThrowError(/Cannot find module '.\/dont-check-here\/file'/); - (() => requireInContext("check-here/dont-check-here/file")). - should.throw(/Cannot find module ".\/check-here\/dont-check-here\/file"/); + expect(() => requireInContext("check-here/dont-check-here/file")).toThrowError(/Cannot find module '.\/check-here\/dont-check-here\/file'/); }); diff --git a/test/configCases/context-replacement/System.import/index.js b/test/configCases/context-replacement/System.import/index.js index b50ae4885..1c1cae849 100644 --- a/test/configCases/context-replacement/System.import/index.js +++ b/test/configCases/context-replacement/System.import/index.js @@ -1,6 +1,6 @@ it("should replace a async context with a manual map", function() { var a = "a"; return import(a).then(function(a) { - a.should.be.eql({ default: "b" }); + expect(a).toEqual({ default: "b" }); }); }); diff --git a/test/configCases/context-replacement/a/index.js b/test/configCases/context-replacement/a/index.js index a46ac19f2..ec1eba1a8 100644 --- a/test/configCases/context-replacement/a/index.js +++ b/test/configCases/context-replacement/a/index.js @@ -5,7 +5,7 @@ it("should replace a context with a new resource and reqExp", function(done) { }); } rqInContext("replaced", function(r) { - r.should.be.eql("ok"); + expect(r).toBe("ok"); done(); }); -}); \ No newline at end of file +}); diff --git a/test/configCases/context-replacement/b/index.js b/test/configCases/context-replacement/b/index.js index fb4221a4f..b01b43bec 100644 --- a/test/configCases/context-replacement/b/index.js +++ b/test/configCases/context-replacement/b/index.js @@ -2,5 +2,5 @@ it("should replace a context with a new regExp", function() { function rqInContext(x) { return require(x); } - rqInContext("./only-this").should.be.eql("ok"); -}); \ No newline at end of file + expect(rqInContext("./only-this")).toBe("ok"); +}); diff --git a/test/configCases/context-replacement/c/index.js b/test/configCases/context-replacement/c/index.js index 7f1b1afe4..5ee5fb8bb 100644 --- a/test/configCases/context-replacement/c/index.js +++ b/test/configCases/context-replacement/c/index.js @@ -2,12 +2,12 @@ it("should replace a context with a manual map", function() { function rqInContext(x) { return require(x); } - rqInContext("a").should.be.eql("a"); - rqInContext("b").should.be.eql("b"); - rqInContext("./c").should.be.eql("b"); - rqInContext("d").should.be.eql("d"); - rqInContext("./d").should.be.eql("d"); - (function() { + expect(rqInContext("a")).toBe("a"); + expect(rqInContext("b")).toBe("b"); + expect(rqInContext("./c")).toBe("b"); + expect(rqInContext("d")).toBe("d"); + expect(rqInContext("./d")).toBe("d"); + (expect(function() { rqInContext("module-b") - }.should.throw()); + }).toThrowError()); }); diff --git a/test/configCases/context-replacement/d/index.js b/test/configCases/context-replacement/d/index.js index e8a4f576f..325fd05f2 100644 --- a/test/configCases/context-replacement/d/index.js +++ b/test/configCases/context-replacement/d/index.js @@ -2,7 +2,7 @@ it("should replace a context with resource query and manual map", function() { function rqInContext(x) { return require(x); } - rqInContext("a").should.be.eql({ + expect(rqInContext("a")).toEqual({ resourceQuery: "?cats=meow", query: "?lions=roar", prev: "module.exports = \"a\";\n", diff --git a/test/configCases/custom-hash-function/xxhash/index.js b/test/configCases/custom-hash-function/xxhash/index.js index 903df73bd..9a989c6c4 100644 --- a/test/configCases/custom-hash-function/xxhash/index.js +++ b/test/configCases/custom-hash-function/xxhash/index.js @@ -2,7 +2,7 @@ it("should have unique ids", function () { var ids = []; for(var i = 1; i <= 15; i++) { var id = require("./files/file" + i + ".js"); - ids.indexOf(id).should.be.eql(-1); + expect(ids.indexOf(id)).toBe(-1); ids.push(id); } }); diff --git a/test/configCases/delegated-hash/simple/index.js b/test/configCases/delegated-hash/simple/index.js index 683240689..4a11393ae 100644 --- a/test/configCases/delegated-hash/simple/index.js +++ b/test/configCases/delegated-hash/simple/index.js @@ -1,7 +1,7 @@ it("should delegate the modules", function() { - require("./a").should.be.eql("a"); - require("./loader!./b").should.be.eql("b"); - require("./dir/c").should.be.eql("c"); - require("./d").should.be.eql("d"); - require("./e").should.be.eql("e"); + expect(require("./a")).toBe("a"); + expect(require("./loader!./b")).toBe("b"); + expect(require("./dir/c")).toBe("c"); + expect(require("./d")).toBe("d"); + expect(require("./e")).toBe("e"); }); diff --git a/test/configCases/delegated/simple/index.js b/test/configCases/delegated/simple/index.js index 43353216c..d918d437c 100644 --- a/test/configCases/delegated/simple/index.js +++ b/test/configCases/delegated/simple/index.js @@ -1,5 +1,5 @@ it("should delegate the modules", function() { - require("./a").should.be.eql("a"); - require("./loader!./b").should.be.eql("b"); - require("./dir/c").should.be.eql("c"); + expect(require("./a")).toBe("a"); + expect(require("./loader!./b")).toBe("b"); + expect(require("./dir/c")).toBe("c"); }); diff --git a/test/configCases/dll-plugin/1-use-dll/index.js b/test/configCases/dll-plugin/1-use-dll/index.js index 942617dbc..a98f68d5e 100644 --- a/test/configCases/dll-plugin/1-use-dll/index.js +++ b/test/configCases/dll-plugin/1-use-dll/index.js @@ -1,40 +1,39 @@ -var should = require("should"); import d from "dll/d"; import { x1, y2 } from "./e"; import { x2, y1 } from "dll/e"; it("should load a module from dll", function() { - require("dll/a").should.be.eql("a"); + expect(require("dll/a")).toBe("a"); }); it("should load a module of non-default type without extension from dll", function() { - require("dll/f").should.be.eql("f"); + expect(require("dll/f")).toBe("f"); }); it("should load an async module from dll", function(done) { require("dll/b")().then(function(c) { - c.should.be.eql({ default: "c" }); + expect(c).toEqual({ default: "c" }); done(); }).catch(done); }); it("should load an harmony module from dll (default export)", function() { - d.should.be.eql("d"); + expect(d).toBe("d"); }); it("should load an harmony module from dll (star export)", function() { - x1.should.be.eql(123); - x2.should.be.eql(123); - y1.should.be.eql(456); - y2.should.be.eql(456); + expect(x1).toBe(123); + expect(x2).toBe(123); + expect(y1).toBe(456); + expect(y2).toBe(456); }); it("should load a module with loader applied", function() { - require("dll/g.abc.js").should.be.eql("number"); + expect(require("dll/g.abc.js")).toBe("number"); }); it("should give modules the correct ids", function() { - Object.keys(__webpack_modules__).filter(m => !m.startsWith("../..")).should.be.eql([ + expect(Object.keys(__webpack_modules__).filter(m => !m.startsWith("../.."))).toEqual([ "./index.js", "dll-reference ../0-create-dll/dll.js", "dll/a.js", diff --git a/test/configCases/dll-plugin/2-use-dll-without-scope/index.js b/test/configCases/dll-plugin/2-use-dll-without-scope/index.js index fe5086064..f89624fd3 100644 --- a/test/configCases/dll-plugin/2-use-dll-without-scope/index.js +++ b/test/configCases/dll-plugin/2-use-dll-without-scope/index.js @@ -1,40 +1,39 @@ -var should = require("should"); import d from "../0-create-dll/d"; import { x1, y2 } from "./e"; import { x2, y1 } from "../0-create-dll/e"; it("should load a module from dll", function() { - require("../0-create-dll/a").should.be.eql("a"); + expect(require("../0-create-dll/a")).toBe("a"); }); it("should load a module of non-default type without extension from dll", function() { - require("../0-create-dll/f").should.be.eql("f"); + expect(require("../0-create-dll/f")).toBe("f"); }); it("should load an async module from dll", function(done) { require("../0-create-dll/b")().then(function(c) { - c.should.be.eql({ default: "c" }); + expect(c).toEqual({ default: "c" }); done(); }).catch(done); }); it("should load an harmony module from dll (default export)", function() { - d.should.be.eql("d"); + expect(d).toBe("d"); }); it("should load an harmony module from dll (star export)", function() { - x1.should.be.eql(123); - x2.should.be.eql(123); - y1.should.be.eql(456); - y2.should.be.eql(456); + expect(x1).toBe(123); + expect(x2).toBe(123); + expect(y1).toBe(456); + expect(y2).toBe(456); }); it("should load a module with loader applied", function() { - require("../0-create-dll/g.abc.js").should.be.eql("number"); + expect(require("../0-create-dll/g.abc.js")).toBe("number"); }); it("should give modules the correct ids", function() { - Object.keys(__webpack_modules__).filter(m => !m.startsWith("../..")).should.be.eql([ + expect(Object.keys(__webpack_modules__).filter(m => !m.startsWith("../.."))).toEqual([ "../0-create-dll/a.js", "../0-create-dll/b.js", "../0-create-dll/d.js", diff --git a/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js b/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js index 06b1d222a..e3779fe1e 100644 --- a/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js +++ b/test/configCases/dll-plugin/3-use-dll-with-hashid/index.js @@ -1,32 +1,29 @@ -var should = require("should"); import d from "../0-create-dll/d"; import { x1, y2 } from "./e"; import { x2, y1 } from "../0-create-dll/e"; it("should load a module from dll", function() { - require("../0-create-dll/a").should.be.eql("a"); + expect(require("../0-create-dll/a")).toBe("a"); }); it("should load an async module from dll", function(done) { require("../0-create-dll/b")().then(function(c) { - c.should.be.eql({ default: "c" }); + expect(c).toEqual({ default: "c" }); done(); }).catch(done); }); it("should load an harmony module from dll (default export)", function() { - d.should.be.eql("d"); + expect(d).toBe("d"); }); it("should load an harmony module from dll (star export)", function() { - x1.should.be.eql(123); - x2.should.be.eql(123); - y1.should.be.eql(456); - y2.should.be.eql(456); + expect(x1).toBe(123); + expect(x2).toBe(123); + expect(y1).toBe(456); + expect(y2).toBe(456); }); it("should load a module with loader applied", function() { - require("../0-create-dll/g.abc.js").should.be.eql("number"); + expect(require("../0-create-dll/g.abc.js")).toBe("number"); }); - - diff --git a/test/configCases/entry/issue-1068/test.js b/test/configCases/entry/issue-1068/test.js index 8eb9b5d02..5c5e3570f 100644 --- a/test/configCases/entry/issue-1068/test.js +++ b/test/configCases/entry/issue-1068/test.js @@ -1,7 +1,7 @@ var order = global.order; delete global.order; it("should run the modules in the correct order", function() { - order.should.be.eql([ + expect(order).toEqual([ "a", "b", "c", diff --git a/test/configCases/errors/multi-entry-missing-module/index.js b/test/configCases/errors/multi-entry-missing-module/index.js index 1c088a209..e4dec7f22 100644 --- a/test/configCases/errors/multi-entry-missing-module/index.js +++ b/test/configCases/errors/multi-entry-missing-module/index.js @@ -2,9 +2,9 @@ it("Should use WebpackMissingModule when module is missing with multiple entry s var fs = require("fs"); var path = require("path"); var source = fs.readFileSync(path.join(__dirname, "b.js"), "utf-8"); - source.should.containEql("!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"./intentionally-missing-module.js\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }());"); + expect(source).toMatch("!(function webpackMissingModule() { var e = new Error(\"Cannot find module './intentionally-missing-module.js'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }());"); - (function() { + expect(function() { require("./intentionally-missing-module"); - }).should.throw("Cannot find module \"./intentionally-missing-module\""); + }).toThrowError("Cannot find module './intentionally-missing-module'"); }); diff --git a/test/configCases/externals/externals-in-chunk/index.js b/test/configCases/externals/externals-in-chunk/index.js index 7dcfdcf9f..f6b3a7c1f 100644 --- a/test/configCases/externals/externals-in-chunk/index.js +++ b/test/configCases/externals/externals-in-chunk/index.js @@ -1,16 +1,16 @@ it("should move externals in chunks into entry chunk", function(done) { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); - source.should.containEql("1+" + (1+1)); - source.should.containEql("3+" + (2+2)); - source.should.containEql("5+" + (3+3)); + expect(source).toMatch("1+" + (1+1)); + expect(source).toMatch("3+" + (2+2)); + expect(source).toMatch("5+" + (3+3)); import("./chunk").then(function(chunk) { - chunk.default.a.should.be.eql(3); + expect(chunk.default.a).toBe(3); chunk.default.b.then(function(chunk2) { - chunk2.default.should.be.eql(7); + expect(chunk2.default).toBe(7); import("external3").then(function(ex) { - ex.default.should.be.eql(11); + expect(ex.default).toBe(11); done(); }); }); diff --git a/test/configCases/externals/externals-in-commons-chunk/index.js b/test/configCases/externals/externals-in-commons-chunk/index.js index b49eb2c23..9eaec4bc7 100644 --- a/test/configCases/externals/externals-in-commons-chunk/index.js +++ b/test/configCases/externals/externals-in-commons-chunk/index.js @@ -1,18 +1,17 @@ it("should not move externals into the commons chunk", function() { - require("should"); - var fs = require("fs"); - var source1 = fs.readFileSync(__dirname + "/main.js", "utf-8"); - var source2 = fs.readFileSync(__dirname + "/other.js", "utf-8"); - var source3 = fs.readFileSync(__dirname + "/common.js", "utf-8"); - source1.should.containEql("1+" + (1+1)); - source1.should.containEql("3+" + (2+2)); - source2.should.containEql("1+" + (1+1)); - source2.should.containEql("5+" + (3+3)); - source3.should.not.containEql("1+" + (1+1)); - source3.should.not.containEql("3+" + (2+2)); - source3.should.not.containEql("5+" + (3+3)); + var fs = require("fs"); + var source1 = fs.readFileSync(__dirname + "/main.js", "utf-8"); + var source2 = fs.readFileSync(__dirname + "/other.js", "utf-8"); + var source3 = fs.readFileSync(__dirname + "/common.js", "utf-8"); + expect(source1).toMatch("1+" + (1+1)); + expect(source1).toMatch("3+" + (2+2)); + expect(source2).toMatch("1+" + (1+1)); + expect(source2).toMatch("5+" + (3+3)); + expect(source3).not.toMatch("1+" + (1+1)); + expect(source3).not.toMatch("3+" + (2+2)); + expect(source3).not.toMatch("5+" + (3+3)); - require("external"); - require("external2"); - require("./module"); + require("external"); + require("external2"); + require("./module"); }); diff --git a/test/configCases/externals/harmony/index.js b/test/configCases/externals/harmony/index.js index 904a2a0d1..c0e029c99 100644 --- a/test/configCases/externals/harmony/index.js +++ b/test/configCases/externals/harmony/index.js @@ -1,5 +1,5 @@ import external from "external"; it("should harmony import a dependency", function() { - external.should.be.eql("abc"); + expect(external).toBe("abc"); }); diff --git a/test/configCases/externals/non-umd-externals-umd/index.js b/test/configCases/externals/non-umd-externals-umd/index.js index 9ef058ee9..fc0b3fc10 100644 --- a/test/configCases/externals/non-umd-externals-umd/index.js +++ b/test/configCases/externals/non-umd-externals-umd/index.js @@ -1,23 +1,22 @@ -require("should"); var fs = require("fs"); var path = require("path"); it("should correctly import a UMD external", function() { var external = require("external0"); - external.should.be.eql("module 0"); + expect(external).toBe("module 0"); }); it("should contain `require()` statements for the UMD external", function() { var source = fs.readFileSync(path.join(__dirname, "bundle0.js"), "utf-8"); - source.should.containEql("require(\"external0\")"); + expect(source).toMatch("require(\"external0\")"); }); it("should correctly import a non-UMD external", function() { var external = require("external1"); - external.should.be.eql("abc"); + expect(external).toBe("abc"); }); it("should not contain `require()` statements for the non-UMD external", function() { var source = fs.readFileSync(path.join(__dirname, "bundle0.js"), "utf-8"); - source.should.not.containEql("require(\"'abc'\")"); + expect(source).not.toMatch("require(\"'abc'\")"); }); diff --git a/test/configCases/externals/non-umd-externals-umd2/index.js b/test/configCases/externals/non-umd-externals-umd2/index.js index fdb4a1f50..dac36a05a 100644 --- a/test/configCases/externals/non-umd-externals-umd2/index.js +++ b/test/configCases/externals/non-umd-externals-umd2/index.js @@ -1,23 +1,22 @@ -require("should"); var fs = require("fs"); var path = require("path"); it("should correctly import a UMD2 external", function() { var external = require("external0"); - external.should.be.eql("module 0"); + expect(external).toBe("module 0"); }); it("should contain `require()` statements for the UMD2 external", function() { var source = fs.readFileSync(path.join(__dirname, "bundle0.js"), "utf-8"); - source.should.containEql("require(\"external0\")"); + expect(source).toMatch("require(\"external0\")"); }); it("should correctly import a non-UMD2 external", function() { var external = require("external1"); - external.should.be.eql("abc"); + expect(external).toBe("abc"); }); it("should not contain `require()` statements for the non-UMD2 external", function() { var source = fs.readFileSync(path.join(__dirname, "bundle0.js"), "utf-8"); - source.should.not.containEql("require(\"'abc'\")"); + expect(source).not.toMatch("require(\"'abc'\")"); }); diff --git a/test/configCases/externals/optional-externals-cjs/index.js b/test/configCases/externals/optional-externals-cjs/index.js index d38bf3d30..70700065c 100644 --- a/test/configCases/externals/optional-externals-cjs/index.js +++ b/test/configCases/externals/optional-externals-cjs/index.js @@ -2,9 +2,9 @@ it("should not fail on optional externals", function() { try { require("external"); } catch(e) { - e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e).toBeInstanceOf(Error); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-root/index.js b/test/configCases/externals/optional-externals-root/index.js index d38bf3d30..70700065c 100644 --- a/test/configCases/externals/optional-externals-root/index.js +++ b/test/configCases/externals/optional-externals-root/index.js @@ -2,9 +2,9 @@ it("should not fail on optional externals", function() { try { require("external"); } catch(e) { - e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e).toBeInstanceOf(Error); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-umd/index.js b/test/configCases/externals/optional-externals-umd/index.js index d38bf3d30..70700065c 100644 --- a/test/configCases/externals/optional-externals-umd/index.js +++ b/test/configCases/externals/optional-externals-umd/index.js @@ -2,9 +2,9 @@ it("should not fail on optional externals", function() { try { require("external"); } catch(e) { - e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e).toBeInstanceOf(Error); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-umd2-mixed/index.js b/test/configCases/externals/optional-externals-umd2-mixed/index.js index 67be49aaa..bc72d6a77 100644 --- a/test/configCases/externals/optional-externals-umd2-mixed/index.js +++ b/test/configCases/externals/optional-externals-umd2-mixed/index.js @@ -3,9 +3,9 @@ it("should not fail on optional externals", function() { try { require("external"); } catch(e) { - e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e).toBeInstanceOf(Error); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/externals/optional-externals-umd2/index.js b/test/configCases/externals/optional-externals-umd2/index.js index d38bf3d30..70700065c 100644 --- a/test/configCases/externals/optional-externals-umd2/index.js +++ b/test/configCases/externals/optional-externals-umd2/index.js @@ -2,9 +2,9 @@ it("should not fail on optional externals", function() { try { require("external"); } catch(e) { - e.should.be.instanceof(Error); - e.code.should.be.eql("MODULE_NOT_FOUND"); + expect(e).toBeInstanceOf(Error); + expect(e.code).toBe("MODULE_NOT_FOUND"); return; } throw new Error("It doesn't fail"); -}); \ No newline at end of file +}); diff --git a/test/configCases/filename-template/module-filename-template/index.js b/test/configCases/filename-template/module-filename-template/index.js index 4ba38d5ad..a8a8e6fa5 100644 --- a/test/configCases/filename-template/module-filename-template/index.js +++ b/test/configCases/filename-template/module-filename-template/index.js @@ -2,7 +2,7 @@ it("should include test.js in SourceMap", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("dummy:///./test.js"); + expect(map.sources).toContain("dummy:///./test.js"); }); require.include("./test.js"); diff --git a/test/configCases/hash-length/hashed-module-ids/index.js b/test/configCases/hash-length/hashed-module-ids/index.js index 903df73bd..9a989c6c4 100644 --- a/test/configCases/hash-length/hashed-module-ids/index.js +++ b/test/configCases/hash-length/hashed-module-ids/index.js @@ -2,7 +2,7 @@ it("should have unique ids", function () { var ids = []; for(var i = 1; i <= 15; i++) { var id = require("./files/file" + i + ".js"); - ids.indexOf(id).should.be.eql(-1); + expect(ids.indexOf(id)).toBe(-1); ids.push(id); } }); diff --git a/test/configCases/hash-length/output-filename/test.config.js b/test/configCases/hash-length/output-filename/test.config.js index a6d2483ca..c378cab55 100644 --- a/test/configCases/hash-length/output-filename/test.config.js +++ b/test/configCases/hash-length/output-filename/test.config.js @@ -1,5 +1,4 @@ var fs = require("fs"); -require("should"); var findFile = function(files, regex) { return files.find(function(file) { @@ -10,7 +9,7 @@ var findFile = function(files, regex) { }; var verifyFilenameLength = function(filename, expectedNameLength) { - filename.should.match(new RegExp("^.{" + expectedNameLength + "}$")); + expect(filename).toMatch(new RegExp("^.{" + expectedNameLength + "}$")); }; module.exports = { diff --git a/test/configCases/ignore/only-resource-context/test.js b/test/configCases/ignore/only-resource-context/test.js index f8d17ff90..9fd0c934b 100644 --- a/test/configCases/ignore/only-resource-context/test.js +++ b/test/configCases/ignore/only-resource-context/test.js @@ -6,16 +6,16 @@ it("should ignore ignored resources", function() { require("./src/" + mod); }; - (function() { + expect(function() { folderBContext("ignored-module"); - }).should.throw(); + }).toThrowError(); }); it("should not ignore resources that do not match", function() { const folderBContext = function(mod) { require("./src/" + mod); }; - (function() { + expect(function() { folderBContext("normal-module"); - }).should.not.throw(); + }).not.toThrowError(); }); diff --git a/test/configCases/ignore/only-resource/test.js b/test/configCases/ignore/only-resource/test.js index 64d65a041..93ce8146b 100644 --- a/test/configCases/ignore/only-resource/test.js +++ b/test/configCases/ignore/only-resource/test.js @@ -2,12 +2,12 @@ "use strict"; it("should ignore ignored resources", function() { - (function() { + expect(function() { require("./ignored-module"); - }).should.throw(); + }).toThrowError(); }); it("should not ignore resources that do not match", function() { - (function() { + expect(function() { require("./normal-module"); - }).should.not.throw(); + }).not.toThrowError(); }); diff --git a/test/configCases/ignore/resource-and-context-contextmodule/test.js b/test/configCases/ignore/resource-and-context-contextmodule/test.js index fbd74da53..150d2d127 100644 --- a/test/configCases/ignore/resource-and-context-contextmodule/test.js +++ b/test/configCases/ignore/resource-and-context-contextmodule/test.js @@ -6,9 +6,9 @@ it("should ignore context modules that match resource regex and context", functi require("./folder-b/" + mod); }; - (function() { + expect(function() { folderBContext("normal-module"); - }).should.throw(); + }).toThrowError(); }); it("should not ignore context modules that dont match the resource", function() { @@ -16,9 +16,9 @@ it("should not ignore context modules that dont match the resource", function() require("./folder-b/" + mod); }; - (function() { + expect(function() { folderBContext("only-context-match"); - }).should.not.throw(); + }).not.toThrowError(); }); it("should not ignore context modules that dont match the context", function() { @@ -26,10 +26,10 @@ it("should not ignore context modules that dont match the context", function() { require("./folder-a/" + mod); }; - (function() { + expect(function() { folderBContext("normal-module"); - }).should.not.throw(); - (function() { + }).not.toThrowError(); + expect(function() { folderBContext("ignored-module"); - }).should.not.throw(); + }).not.toThrowError(); }); diff --git a/test/configCases/ignore/resource-and-context/test.js b/test/configCases/ignore/resource-and-context/test.js index 48149de44..ae4f1ae2c 100644 --- a/test/configCases/ignore/resource-and-context/test.js +++ b/test/configCases/ignore/resource-and-context/test.js @@ -2,19 +2,19 @@ "use strict"; it("should ignore resources that match resource regex and context", function() { - (function() { + expect(function() { require("./folder-b/normal-module"); - }).should.throw(); + }).toThrowError(); }); it("should not ignore resources that match resource but not context", function() { - (function() { + expect(function() { require("./folder-a/normal-module"); - }).should.not.throw(); + }).not.toThrowError(); }); it("should not ignore resources that do not match resource but do match context", function() { - (function() { + expect(function() { require("./folder-b/only-context-match"); - }).should.not.throw(); + }).not.toThrowError(); }); diff --git a/test/configCases/library/1-use-library/default-test.js b/test/configCases/library/1-use-library/default-test.js index 0f0075243..ea4e84d0d 100644 --- a/test/configCases/library/1-use-library/default-test.js +++ b/test/configCases/library/1-use-library/default-test.js @@ -2,6 +2,6 @@ import d from "library"; var data = require("library"); it("should get default export from library (" + NAME + ")", function() { - data.should.be.eql("default-value"); - d.should.be.eql("default-value"); + expect(data).toBe("default-value"); + expect(d).toBe("default-value"); }); diff --git a/test/configCases/library/1-use-library/global-test.js b/test/configCases/library/1-use-library/global-test.js index 9ebb91168..f0f8efb8c 100644 --- a/test/configCases/library/1-use-library/global-test.js +++ b/test/configCases/library/1-use-library/global-test.js @@ -1,7 +1,7 @@ var data = require("library"); it("should be able get items from library (" + NAME + ")", function() { - data.should.have.property("default").be.eql("default-value"); - data.should.have.property("a").be.eql("a"); - data.should.have.property("b").be.eql("b"); + expect(data).toHaveProperty("default", "default-value"); + expect(data).toHaveProperty("a", "a"); + expect(data).toHaveProperty("b", "b"); }); diff --git a/test/configCases/library/1-use-library/index.js b/test/configCases/library/1-use-library/index.js index c8b879c52..726072db8 100644 --- a/test/configCases/library/1-use-library/index.js +++ b/test/configCases/library/1-use-library/index.js @@ -2,13 +2,13 @@ import d from "library"; import { a, b, external } from "library"; it("should be able to import harmony exports from library (" + NAME + ")", function() { - d.should.be.eql("default-value"); - a.should.be.eql("a"); - b.should.be.eql("b"); + expect(d).toBe("default-value"); + expect(a).toBe("a"); + expect(b).toBe("b"); if(typeof TEST_EXTERNAL !== "undefined" && TEST_EXTERNAL) { - external.should.be.eql(["external"]); - external.should.be.equal(require("external")); + expect(external).toEqual(["external"]); + expect(external).toBe(require("external")); } else { - external.should.be.eql("non-external"); + expect(external).toBe("non-external"); } }); diff --git a/test/configCases/library/b/index.js b/test/configCases/library/b/index.js index ec6626bc0..6fe35d718 100644 --- a/test/configCases/library/b/index.js +++ b/test/configCases/library/b/index.js @@ -4,8 +4,8 @@ it("should run", function() { it("should have exported", function(done) { setTimeout(function() { - exported.object.should.be.eql(module.exports.object); - exported.second.should.be.eql(module.exports.second); + expect(exported.object).toBe(module.exports.object); + expect(exported.second).toBe(module.exports.second); done(); }, 1); }); diff --git a/test/configCases/library/umd-array/index.js b/test/configCases/library/umd-array/index.js new file mode 100644 index 000000000..9970130cc --- /dev/null +++ b/test/configCases/library/umd-array/index.js @@ -0,0 +1,3 @@ +it("should run", function() { + +}); \ No newline at end of file diff --git a/test/configCases/library/umd-array/webpack.config.js b/test/configCases/library/umd-array/webpack.config.js new file mode 100644 index 000000000..fba3d5e17 --- /dev/null +++ b/test/configCases/library/umd-array/webpack.config.js @@ -0,0 +1,10 @@ +module.exports = { + output: { + libraryTarget: "umd", + library: { + root: ["test", "library"], + amd: "test-library", + commonjs: "test-library" + } + } +}; diff --git a/test/configCases/loaders/generate-ident/index.js b/test/configCases/loaders/generate-ident/index.js index 1ba367dbe..f4693e19c 100644 --- a/test/configCases/loaders/generate-ident/index.js +++ b/test/configCases/loaders/generate-ident/index.js @@ -1,6 +1,6 @@ it("should correctly pass complex query object with remaining request", function() { - require("./a").should.be.eql("ok"); - require("./b").should.be.eql("maybe"); - require("./c").should.be.eql("yes"); - require("./d").should.be.eql("ok"); + expect(require("./a")).toBe("ok"); + expect(require("./b")).toBe("maybe"); + expect(require("./c")).toBe("yes"); + expect(require("./d")).toBe("ok"); }); diff --git a/test/configCases/loaders/hot-in-context/index.js b/test/configCases/loaders/hot-in-context/index.js index 87b8abaca..a150c3a92 100644 --- a/test/configCases/loaders/hot-in-context/index.js +++ b/test/configCases/loaders/hot-in-context/index.js @@ -1,3 +1,3 @@ it("should have hmr flag in loader context", function() { - require("./loader!").should.be.eql(!!module.hot); + expect(require("./loader!")).toBe(!!module.hot); }); diff --git a/test/configCases/loaders/issue-3320/index.js b/test/configCases/loaders/issue-3320/index.js index 7dbdbd576..7d496b8eb 100644 --- a/test/configCases/loaders/issue-3320/index.js +++ b/test/configCases/loaders/issue-3320/index.js @@ -1,23 +1,23 @@ it("should resolve aliased loader module with query", function() { var foo = require('./a'); - foo.should.be.eql("someMessage"); + expect(foo).toBe("someMessage"); }); it("should favor explicit loader query over aliased query (options in rule)", function() { var foo = require('./b'); - foo.should.be.eql("someOtherMessage"); + expect(foo).toBe("someOtherMessage"); }); it("should favor explicit loader query over aliased query (inline query in rule)", function() { var foo = require('./b2'); - foo.should.be.eql("someOtherMessage"); + expect(foo).toBe("someOtherMessage"); }); it("should favor explicit loader query over aliased query (inline query in rule.use)", function() { var foo = require('./b3'); - foo.should.be.eql("someOtherMessage"); + expect(foo).toBe("someOtherMessage"); }); diff --git a/test/configCases/loaders/pre-post-loader/index.js b/test/configCases/loaders/pre-post-loader/index.js index 6a18d04e2..d69ad146f 100644 --- a/test/configCases/loaders/pre-post-loader/index.js +++ b/test/configCases/loaders/pre-post-loader/index.js @@ -1,6 +1,6 @@ it("should apply pre and post loaders correctly", function() { - require("./a").should.be.eql("resource loader2 loader1 loader3"); - require("!./a").should.be.eql("resource loader2 loader3"); - require("!!./a").should.be.eql("resource"); - require("-!./a").should.be.eql("resource loader3"); + expect(require("./a")).toBe("resource loader2 loader1 loader3"); + expect(require("!./a")).toBe("resource loader2 loader3"); + expect(require("!!./a")).toBe("resource"); + expect(require("-!./a")).toBe("resource loader3"); }); diff --git a/test/configCases/loaders/remaining-request/index.js b/test/configCases/loaders/remaining-request/index.js index 7285ccdba..53247f529 100644 --- a/test/configCases/loaders/remaining-request/index.js +++ b/test/configCases/loaders/remaining-request/index.js @@ -1,3 +1,3 @@ it("should correctly pass complex query object with remaining request", function() { - require("./a").should.be.eql("ok"); + expect(require("./a")).toBe("ok"); }); diff --git a/test/configCases/module-name/different-issuers-for-same-module/a.js b/test/configCases/module-name/different-issuers-for-same-module/a.js new file mode 100644 index 000000000..1463fc598 --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/a.js @@ -0,0 +1 @@ +module.exports = require("./c"); diff --git a/test/configCases/module-name/different-issuers-for-same-module/b.js b/test/configCases/module-name/different-issuers-for-same-module/b.js new file mode 100644 index 000000000..1463fc598 --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/b.js @@ -0,0 +1 @@ +module.exports = require("./c"); diff --git a/test/configCases/module-name/different-issuers-for-same-module/c.js b/test/configCases/module-name/different-issuers-for-same-module/c.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/c.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/module-name/different-issuers-for-same-module/loader-a.js b/test/configCases/module-name/different-issuers-for-same-module/loader-a.js new file mode 100644 index 000000000..bd8581ca4 --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/loader-a.js @@ -0,0 +1,3 @@ +module.exports = function(src) { + return `module.exports = "loader-a" + module.id`; +}; diff --git a/test/configCases/module-name/different-issuers-for-same-module/loader-b.js b/test/configCases/module-name/different-issuers-for-same-module/loader-b.js new file mode 100644 index 000000000..5365e2fd3 --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/loader-b.js @@ -0,0 +1,3 @@ +module.exports = function(src) { + return `module.exports = "loader-b" + module.id`; +}; diff --git a/test/configCases/module-name/different-issuers-for-same-module/test.js b/test/configCases/module-name/different-issuers-for-same-module/test.js new file mode 100644 index 000000000..c68cda023 --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/test.js @@ -0,0 +1,6 @@ +it("should assign different names to the same module with different issuers ", function() { + var regex = "\\./c\\.js\\?\\w{4}"; + expect(require("./c")).toMatch(new RegExp(regex)); + expect(require("./a")).toMatch(new RegExp("loader-a" + regex)); + expect(require("./b")).toMatch(new RegExp("loader-b" + regex)); +}); diff --git a/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js b/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js new file mode 100644 index 000000000..6527d721c --- /dev/null +++ b/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js @@ -0,0 +1,18 @@ +module.exports = { + mode: "development", + entry: ["./a", "./b", "./test"], + module: { + rules: [ + { + test: /c\.js/, + issuer: /a\.js/, + loader: "./loader-a" + }, + { + test: /c\.js/, + issuer: /b\.js/, + loader: "./loader-b" + } + ] + } +}; diff --git a/test/configCases/no-parse/module.exports/index.js b/test/configCases/no-parse/module.exports/index.js index fe0db2daa..3db446c82 100644 --- a/test/configCases/no-parse/module.exports/index.js +++ b/test/configCases/no-parse/module.exports/index.js @@ -1,4 +1,4 @@ it("should correctly export stuff from not parsed modules", function() { - require("./not-parsed-a").should.be.eql("ok"); - require("./not-parsed-b").should.be.eql("ok"); + expect(require("./not-parsed-a")).toBe("ok"); + expect(require("./not-parsed-b")).toBe("ok"); }); diff --git a/test/configCases/no-parse/no-parse-function/index.js b/test/configCases/no-parse/no-parse-function/index.js index fe0db2daa..3db446c82 100644 --- a/test/configCases/no-parse/no-parse-function/index.js +++ b/test/configCases/no-parse/no-parse-function/index.js @@ -1,4 +1,4 @@ it("should correctly export stuff from not parsed modules", function() { - require("./not-parsed-a").should.be.eql("ok"); - require("./not-parsed-b").should.be.eql("ok"); + expect(require("./not-parsed-a")).toBe("ok"); + expect(require("./not-parsed-b")).toBe("ok"); }); diff --git a/test/configCases/parsing/context/index.js b/test/configCases/parsing/context/index.js index baffd5e40..c11c62d9e 100644 --- a/test/configCases/parsing/context/index.js +++ b/test/configCases/parsing/context/index.js @@ -1,5 +1,5 @@ it("should automatically create contexts", function() { var template = "tmpl", templateFull = "./tmpl.js"; - require("../../../cases/parsing/context/templates/templateLoader")(templateFull).should.be.eql("test template"); - require("../../../cases/parsing/context/templates/templateLoaderIndirect")(templateFull).should.be.eql("test template"); -}); \ No newline at end of file + expect(require("../../../cases/parsing/context/templates/templateLoader")(templateFull)).toBe("test template"); + expect(require("../../../cases/parsing/context/templates/templateLoaderIndirect")(templateFull)).toBe("test template"); +}); diff --git a/test/configCases/parsing/extended-api/index.js b/test/configCases/parsing/extended-api/index.js index b33fb25bd..6b10bd1e4 100644 --- a/test/configCases/parsing/extended-api/index.js +++ b/test/configCases/parsing/extended-api/index.js @@ -1,8 +1,8 @@ it("should have __webpack_hash__", function() { - (typeof __webpack_hash__).should.be.type("string"); - __webpack_hash__.should.match(/^[0-9a-f]{20}$/); + expect(__webpack_hash__).toBeTypeOf("string"); + expect(__webpack_hash__).toMatch(/^[0-9a-f]{20}$/); }); it("should have __webpack_chunkname__", function() { - (typeof __webpack_chunkname__).should.be.type("string"); - __webpack_chunkname__.should.be.eql('other'); + expect(__webpack_chunkname__).toBeTypeOf("string"); + expect(__webpack_chunkname__).toBe("other"); }); diff --git a/test/configCases/parsing/harmony-global/index.js b/test/configCases/parsing/harmony-global/index.js index fde7f60f6..d61502ebe 100644 --- a/test/configCases/parsing/harmony-global/index.js +++ b/test/configCases/parsing/harmony-global/index.js @@ -1,5 +1,4 @@ -require("should"); it("should be able to use global in a harmony module", function() { var x = require("./module1"); - (x.default === global).should.be.ok(); + expect(x.default === global).toBeTruthy(); }); diff --git a/test/configCases/parsing/harmony-this-concat/index.js b/test/configCases/parsing/harmony-this-concat/index.js index af774470b..e2b94f2eb 100644 --- a/test/configCases/parsing/harmony-this-concat/index.js +++ b/test/configCases/parsing/harmony-this-concat/index.js @@ -7,16 +7,16 @@ import * as abc from "./abc"; function x() { throw new Error("should not be executed"); } it("should have this = undefined on imported non-strict functions", function() { x - d().should.be.eql("undefined"); + expect(d()).toBe("undefined"); x - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); x - B().should.be.eql("undefined"); + expect(B()).toBe("undefined"); x - abc.a().should.be.type("object"); + expect(abc.a()).toMatchObject({}); x var thing = abc.a(); - Object.keys(thing).should.be.eql(["a", "b", "default"]); + expect(Object.keys(thing)).toEqual(["a", "b", "default"]); }); import C2, { C } from "./new"; @@ -25,9 +25,9 @@ import * as New from "./new"; it("should be possible to use new correctly", function() { x - new C().should.match({ok: true}); + expect(new C()).toEqual({ok: true}); x - new C2().should.match({ok: true}); + expect(new C2()).toEqual({ok: true}); x - new New.C().should.match({ok: true}); + expect(new New.C()).toEqual({ok: true}); }); diff --git a/test/configCases/parsing/harmony-this/index.js b/test/configCases/parsing/harmony-this/index.js index 06933c8d6..a8af27500 100644 --- a/test/configCases/parsing/harmony-this/index.js +++ b/test/configCases/parsing/harmony-this/index.js @@ -1,64 +1,73 @@ "use strict"; -import should from "should"; import {extendThisClass, returnThisArrow, returnThisMember, that} from "./abc"; import d, {a, b as B, C as _C, D as _D, E, F, f1, f2, f3, G} from "./abc"; +import {bindThis, callThis, applyThis} from "./issue-7213"; import * as abc from "./abc"; -it("should have this = undefined on harmony modules", function() { - (typeof that).should.be.eql("undefined"); - (typeof abc.that).should.be.eql("undefined"); - (typeof returnThisArrow()).should.be.eql("undefined"); - (typeof abc.returnThisArrow()).should.be.eql("undefined"); - (function() { +it("should have this = undefined on harmony modules", () => { + expect((typeof that)).toBe("undefined"); + expect((typeof abc.that)).toBe("undefined"); + expect((typeof returnThisArrow())).toBe("undefined"); + expect((typeof abc.returnThisArrow())).toBe("undefined"); + expect(function() { returnThisMember(); - }).should.throw(); - (function() { + }).toThrowError(); + expect(function() { abc.returnThisMember(); - }).should.throw(); - (function() { + }).toThrowError(); + expect(function() { extendThisClass(); - }).should.throw(); + }).toThrowError(); }); -it("should not break classes and functions", function() { - (new _C).foo().should.be.eql("bar"); - (new _C).bar().should.be.eql("bar"); - (new _D).prop().should.be.eql("ok"); - E.foo().should.be.eql("bar"); - F.should.be.eql("ok"); - f1.call({x: "f1"}).should.be.eql("f1"); - f2.call({x: "f2"}).should.be.eql("f2"); - should(f3.call("f3")).be.eql(undefined); - should(f3()).be.eql(undefined); - (new G("ok")).getX().should.be.eql("ok"); +it("should not break classes and functions", () => { + expect((new _C).foo()).toBe("bar"); + expect((new _C).bar()).toBe("bar"); + expect((new _D).prop()).toBe("ok"); + expect(E.foo()).toBe("bar"); + expect(F).toBe("ok"); + expect(f1.call({x: "f1"})).toBe("f1"); + expect(f2.call({x: "f2"})).toBe("f2"); + expect(f3.call("f3")).toBe(undefined); + expect(f3()).toBe(undefined); + expect((new G("ok")).getX()).toBe("ok"); }); -function x() { throw new Error("should not be executed"); } -it("should have this = undefined on imported non-strict functions", function() { +function x() { + throw new Error("should not be executed"); +} + +it("should have this = undefined on imported non-strict functions", () => { x - d().should.be.eql("undefined"); + expect(d()).toBe("undefined"); x - a().should.be.eql("undefined"); + expect(a()).toBe("undefined"); x - B().should.be.eql("undefined"); + expect(B()).toBe("undefined"); x - abc.a().should.be.type("object"); + expect(abc.a()).toBeTypeOf("object"); x var thing = abc.a(); - Object.keys(thing).should.be.eql(Object.keys(abc)); + expect(Object.keys(thing)).toEqual(Object.keys(abc)); }); import C2, { C } from "./new"; import * as New from "./new"; -it("should be possible to use new correctly", function() { +it("should be possible to use new correctly", () => { x - new C().should.match({ok: true}); + expect(new C()).toEqual({ok: true}); x - new C2().should.match({ok: true}); + expect(new C2()).toEqual({ok: true}); x - new New.C().should.match({ok: true}); + expect(new New.C()).toEqual({ok: true}); +}); + +it("should not break Babel arrow function transform", () => { + expect(bindThis()).toBe(undefined); + expect(callThis).toBe(undefined); + expect(applyThis).toBe(undefined); }); diff --git a/test/configCases/parsing/harmony-this/issue-7213.js b/test/configCases/parsing/harmony-this/issue-7213.js new file mode 100644 index 000000000..0e3a36512 --- /dev/null +++ b/test/configCases/parsing/harmony-this/issue-7213.js @@ -0,0 +1,20 @@ +// This helper is taken from Babel +function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} + +let _this = this; +export let bindThis = function() { + _newArrowCheck(this, _this); + return this +}.bind(this); + +export let callThis = function() { + return this +}.call(this) + +export let applyThis = function() { + return this +}.apply(this) diff --git a/test/configCases/parsing/import-ignore/index.js b/test/configCases/parsing/import-ignore/index.js new file mode 100644 index 000000000..1706a861b --- /dev/null +++ b/test/configCases/parsing/import-ignore/index.js @@ -0,0 +1,8 @@ +const fs = require("fs"); +const path = require("path"); + +it("should be able to ignore import()", () => { + const source = fs.readFileSync(path.join(__dirname, "bundle1.js"), "utf-8"); + expect(source).toMatch(`import(/* webpackIgnore: true */ "./other2.js")`); + expect(source).not.toMatch(`import(/* webpackIgnore: false */ "./other3.js")`); +}); diff --git a/test/configCases/parsing/import-ignore/other.js b/test/configCases/parsing/import-ignore/other.js new file mode 100644 index 000000000..3f8179d09 --- /dev/null +++ b/test/configCases/parsing/import-ignore/other.js @@ -0,0 +1,2 @@ +import(/* webpackIgnore: true */ "./other2.js"); +import(/* webpackIgnore: false */ "./other3.js"); diff --git a/test/configCases/parsing/import-ignore/other2.js b/test/configCases/parsing/import-ignore/other2.js new file mode 100644 index 000000000..5d999f672 --- /dev/null +++ b/test/configCases/parsing/import-ignore/other2.js @@ -0,0 +1 @@ +export default "other2"; diff --git a/test/configCases/parsing/import-ignore/other3.js b/test/configCases/parsing/import-ignore/other3.js new file mode 100644 index 000000000..f5e805262 --- /dev/null +++ b/test/configCases/parsing/import-ignore/other3.js @@ -0,0 +1 @@ +export default "other3"; diff --git a/test/configCases/parsing/import-ignore/webpack.config.js b/test/configCases/parsing/import-ignore/webpack.config.js new file mode 100644 index 000000000..4fcaf47ef --- /dev/null +++ b/test/configCases/parsing/import-ignore/webpack.config.js @@ -0,0 +1,12 @@ +module.exports = { + entry: { + bundle0: "./index.js", + bundle1: "./other.js" + }, + output: { + filename: "[name].js" + }, + node: { + __dirname: false + } +}; diff --git a/test/configCases/parsing/issue-336/index.js b/test/configCases/parsing/issue-336/index.js index b6b5e2f84..5b4f4798e 100644 --- a/test/configCases/parsing/issue-336/index.js +++ b/test/configCases/parsing/issue-336/index.js @@ -1,4 +1,4 @@ it("should provide a module to a free var in a var decl", function() { var x = aaa.test; - x.should.be.eql("test"); -}); \ No newline at end of file + expect(x).toBe("test"); +}); diff --git a/test/configCases/parsing/issue-4857/index.js b/test/configCases/parsing/issue-4857/index.js index db6e32229..a1d24f3ae 100644 --- a/test/configCases/parsing/issue-4857/index.js +++ b/test/configCases/parsing/issue-4857/index.js @@ -23,7 +23,7 @@ it("should transpile unreachable branches", () => { true ? count++ : import("NOT_REACHABLE"); false ? import("NOT_REACHABLE") : count++; - count.should.be.eql(6); + expect(count).toBe(6); }); it("should not remove hoisted variable declarations", () => { @@ -55,7 +55,7 @@ it("should not remove hoisted variable declarations", () => { var withVar; } } - (() => { + expect(() => { a; b; c; @@ -71,19 +71,19 @@ it("should not remove hoisted variable declarations", () => { m; n; o; - }).should.not.throw(); - (() => { + }).not.toThrowError(); + expect(() => { withVar; - }).should.throw(); + }).toThrowError(); }); it("should not remove hoisted function declarations in loose mode", () => { if(false) { function funcDecl() {} } - (() => { + expect(() => { funcDecl; - }).should.not.throw(); + }).not.toThrowError(); }); it("should remove hoisted function declarations in strict mode", () => { @@ -91,7 +91,7 @@ it("should remove hoisted function declarations in strict mode", () => { if(false) { function funcDecl() {} } - (() => { + expect(() => { funcDecl; - }).should.throw(); + }).toThrowError(); }); diff --git a/test/configCases/parsing/issue-5624/index.js b/test/configCases/parsing/issue-5624/index.js index 04fe1e478..8b4624326 100644 --- a/test/configCases/parsing/issue-5624/index.js +++ b/test/configCases/parsing/issue-5624/index.js @@ -2,10 +2,10 @@ import * as M from "./module"; it("should allow conditionals as callee", function() { var x = (true ? M.fn : M.fn)(); - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); it("should allow conditionals as object", function() { var x = (true ? M : M).fn(); - x.should.be.eql("ok"); + expect(x).toBe("ok"); }); diff --git a/test/configCases/parsing/node-source-plugin-off/index.js b/test/configCases/parsing/node-source-plugin-off/index.js index ed447c13f..322337ef3 100644 --- a/test/configCases/parsing/node-source-plugin-off/index.js +++ b/test/configCases/parsing/node-source-plugin-off/index.js @@ -1,5 +1,3 @@ -require("should"); - it("should not load node-libs-browser when node option is false", function() { - (typeof process).should.be.eql("undefined"); + expect((typeof process)).toBe("undefined"); }); diff --git a/test/configCases/parsing/node-source-plugin/index.js b/test/configCases/parsing/node-source-plugin/index.js index 2e945a3e2..c1671f16f 100644 --- a/test/configCases/parsing/node-source-plugin/index.js +++ b/test/configCases/parsing/node-source-plugin/index.js @@ -1,5 +1,3 @@ -require("should"); - it("should add node-libs-browser to target web by default", function() { - process.browser.should.be.eql(true); + expect(process.browser).toBe(true); }); diff --git a/test/configCases/parsing/relative-filedirname/index.js b/test/configCases/parsing/relative-filedirname/index.js index 6f2e4fc53..2753225ef 100644 --- a/test/configCases/parsing/relative-filedirname/index.js +++ b/test/configCases/parsing/relative-filedirname/index.js @@ -1,6 +1,6 @@ it("should define __dirname and __filename", function() { - __dirname.should.be.eql(""); - __filename.should.be.eql("index.js"); - require("./dir/file").dirname.should.be.eql("dir"); - require("./dir/file").filename.should.match(/^dir[\\\/]file.js$/); -}); \ No newline at end of file + expect(__dirname).toBe(""); + expect(__filename).toBe("index.js"); + expect(require("./dir/file").dirname).toBe("dir"); + expect(require("./dir/file").filename).toMatch(/^dir[\\\/]file.js$/); +}); diff --git a/test/configCases/parsing/require.main/index.js b/test/configCases/parsing/require.main/index.js index c72bb927a..91a94843f 100644 --- a/test/configCases/parsing/require.main/index.js +++ b/test/configCases/parsing/require.main/index.js @@ -1,3 +1,3 @@ it("should define require.main", function() { - require.main.should.be.eql(module); + expect(require.main).toBe(module); }); diff --git a/test/configCases/parsing/system.import/index.js b/test/configCases/parsing/system.import/index.js index d294961f8..74637dc7b 100644 --- a/test/configCases/parsing/system.import/index.js +++ b/test/configCases/parsing/system.import/index.js @@ -1,18 +1,18 @@ it("should answer typeof System correctly", () => { if(__SYSTEM__ === false) { - (typeof System).should.be.eql("undefined"); + expect((typeof System)).toBe("undefined"); } else { - (typeof System).should.be.eql("object"); + expect((typeof System)).toBe("object"); } }); it("should answer typeof System.import correctly", () => { if(__SYSTEM__ === false) { - (() => { + expect(() => { typeof System.import; - }).should.throw(); + }).toThrowError(); } else { - (typeof System.import).should.be.eql("function"); + expect((typeof System.import)).toBe("function"); } }); @@ -22,7 +22,7 @@ it("should be able to use System.import()", done => { if(__SYSTEM__ === false) { done(new Error("System.import should not be parsed")); } else { - mod.should.be.eql({ default: "ok" }); + expect(mod).toEqual({ default: "ok" }); done(); } }); diff --git a/test/configCases/performance/many-exports/index.js b/test/configCases/performance/many-exports/index.js index 09e6f3203..a68c803f1 100644 --- a/test/configCases/performance/many-exports/index.js +++ b/test/configCases/performance/many-exports/index.js @@ -1,5 +1,5 @@ import sum from "./reexport.loader.js!"; it("should compile a module with many harmony exports in acceptable time", function() { - sum.should.be.eql(499500); + expect(sum).toBe(499500); }); diff --git a/test/configCases/plugins/banner-plugin-hashing/index.js b/test/configCases/plugins/banner-plugin-hashing/index.js index 65a407780..166837a7a 100644 --- a/test/configCases/plugins/banner-plugin-hashing/index.js +++ b/test/configCases/plugins/banner-plugin-hashing/index.js @@ -18,35 +18,35 @@ const banner = parseBanner(source) const REGEXP_HASH = /^[A-Za-z0-9]{20}$/ it("should interpolate file hash in chunk banner", () => { - REGEXP_HASH.test(banner["hash"]).should.be.true; + expect(REGEXP_HASH.test(banner["hash"])).toBe(true); }); it("should interpolate chunkHash in chunk banner", () => { - REGEXP_HASH.test(banner["chunkhash"]).should.be.true; + expect(REGEXP_HASH.test(banner["chunkhash"])).toBe(true); }); it("should interpolate file into chunk banner", () => { - banner["file"].should.equal("dist/banner.js"); + expect(banner["file"]).toBe("dist/banner.js"); }); it("should interpolate name in chunk banner", () => { - banner["name"].should.equal("dist/banner"); + expect(banner["name"]).toBe("dist/banner"); }); it("should interpolate basename in chunk banner", () => { - banner["filebase"].should.equal("banner.js"); + expect(banner["filebase"]).toBe("banner.js"); }); it("should interpolate query in chunk banner", () => { - banner["query"].should.equal("?value"); + expect(banner["query"]).toBe("?value"); }); it("should parse entry into file in chunk banner", () => { - banner["file"].should.not.equal(banner["filebase"]); + expect(banner["file"]).not.toBe(banner["filebase"]); }); it("should parse entry into name in chunk banner", () => { - banner["filebase"].should.not.equal(banner["name"]); + expect(banner["filebase"]).not.toBe(banner["name"]); }); require.include("./test.js"); diff --git a/test/configCases/plugins/banner-plugin/index.js b/test/configCases/plugins/banner-plugin/index.js index 50db60024..105a1f91b 100644 --- a/test/configCases/plugins/banner-plugin/index.js +++ b/test/configCases/plugins/banner-plugin/index.js @@ -1,14 +1,17 @@ -it("should contain banner in bundle0 chunk", function() { - var fs = require("fs"); - var source = fs.readFileSync(__filename, "utf-8"); - source.should.containEql("A test value"); +const fs = require("fs"); +const path = require("path"); + +it("should contain banner in bundle0 chunk", () => { + const source = fs.readFileSync(__filename, "utf-8"); + expect(source).toMatch("A test value"); + expect(source).toMatch("banner is a string"); + expect(source).toMatch("banner is a function"); + expect(source).toMatch("/*!\n * multiline\n * banner\n * 1\n */"); }); -it("should not contain banner in vendors chunk", function() { - var fs = require("fs"), - path = require("path"); - var source = fs.readFileSync(path.join(__dirname, "vendors.js"), "utf-8"); - source.should.not.containEql("A test value"); +it("should not contain banner in vendors chunk", () => { + const source = fs.readFileSync(path.join(__dirname, "vendors.js"), "utf-8"); + expect(source).not.toMatch("A test value"); }); require.include("./test.js"); diff --git a/test/configCases/plugins/banner-plugin/webpack.config.js b/test/configCases/plugins/banner-plugin/webpack.config.js index f8dda4c4d..fcaaee27a 100644 --- a/test/configCases/plugins/banner-plugin/webpack.config.js +++ b/test/configCases/plugins/banner-plugin/webpack.config.js @@ -12,9 +12,14 @@ module.exports = { filename: "[name].js" }, plugins: [ + new webpack.BannerPlugin("banner is a string"), + new webpack.BannerPlugin(() => "banner is a function"), new webpack.BannerPlugin({ banner: "A test value", exclude: ["vendors.js"] + }), + new webpack.BannerPlugin({ + banner: ({ chunk }) => `multiline\nbanner\n${chunk.id}` }) ] }; diff --git a/test/configCases/plugins/define-plugin/index.js b/test/configCases/plugins/define-plugin/index.js index 5716a30c3..8d08c2014 100644 --- a/test/configCases/plugins/define-plugin/index.js +++ b/test/configCases/plugins/define-plugin/index.js @@ -1,77 +1,77 @@ /* globals it, should */ it("should define FALSE", function() { - FALSE.should.be.eql(false); - (typeof TRUE).should.be.eql("boolean"); + expect(FALSE).toBe(false); + expect((typeof TRUE)).toBe("boolean"); var x = require(FALSE ? "fail" : "./a"); var y = FALSE ? require("fail") : require("./a"); }); it("should define CODE", function() { - CODE.should.be.eql(3); - (typeof CODE).should.be.eql("number"); + expect(CODE).toBe(3); + expect((typeof CODE)).toBe("number"); if(CODE !== 3) require("fail"); if(typeof CODE !== "number") require("fail"); }); it("should define FUNCTION", function() { - (FUNCTION(5)).should.be.eql(6); - (typeof FUNCTION).should.be.eql("function"); + expect((FUNCTION(5))).toBe(6); + expect((typeof FUNCTION)).toBe("function"); if(typeof FUNCTION !== "function") require("fail"); }); it("should define UNDEFINED", function() { - (typeof UNDEFINED).should.be.eql("undefined"); + expect((typeof UNDEFINED)).toBe("undefined"); if(typeof UNDEFINED !== "undefined") require("fail"); }); it("should define REGEXP", function() { - REGEXP.toString().should.be.eql("/abc/i"); - (typeof REGEXP).should.be.eql("object"); + expect(REGEXP.toString()).toBe("/abc/i"); + expect((typeof REGEXP)).toBe("object"); if(typeof REGEXP !== "object") require("fail"); }); it("should define OBJECT", function() { var o = OBJECT; - o.SUB.FUNCTION(10).should.be.eql(11); + expect(o.SUB.FUNCTION(10)).toBe(11); }); it("should define OBJECT.SUB.CODE", function() { - (typeof OBJECT.SUB.CODE).should.be.eql("number"); - OBJECT.SUB.CODE.should.be.eql(3); + expect((typeof OBJECT.SUB.CODE)).toBe("number"); + expect(OBJECT.SUB.CODE).toBe(3); if(OBJECT.SUB.CODE !== 3) require("fail"); if(typeof OBJECT.SUB.CODE !== "number") require("fail"); (function(sub) { // should not crash - sub.CODE.should.be.eql(3); + expect(sub.CODE).toBe(3); }(OBJECT.SUB)); }); it("should define OBJECT.SUB.STRING", function() { - (typeof OBJECT.SUB.STRING).should.be.eql("string"); - OBJECT.SUB.STRING.should.be.eql("string"); + expect((typeof OBJECT.SUB.STRING)).toBe("string"); + expect(OBJECT.SUB.STRING).toBe("string"); if(OBJECT.SUB.STRING !== "string") require("fail"); if(typeof OBJECT.SUB.STRING !== "string") require("fail"); (function(sub) { // should not crash - sub.STRING.should.be.eql("string"); + expect(sub.STRING).toBe("string"); }(OBJECT.SUB)); }); it("should define process.env.DEFINED_NESTED_KEY", function() { - (process.env.DEFINED_NESTED_KEY).should.be.eql(5); - (typeof process.env.DEFINED_NESTED_KEY).should.be.eql("number"); + expect((process.env.DEFINED_NESTED_KEY)).toBe(5); + expect((typeof process.env.DEFINED_NESTED_KEY)).toBe("number"); if(process.env.DEFINED_NESTED_KEY !== 5) require("fail"); if(typeof process.env.DEFINED_NESTED_KEY !== "number") require("fail"); var x = process.env.DEFINED_NESTED_KEY; - x.should.be.eql(5); + expect(x).toBe(5); var indirect = process.env; - (indirect.DEFINED_NESTED_KEY).should.be.eql(5); + expect((indirect.DEFINED_NESTED_KEY)).toBe(5); (function(env) { - (env.DEFINED_NESTED_KEY).should.be.eql(5); - (typeof env.DEFINED_NESTED_KEY).should.be.eql("number"); + expect((env.DEFINED_NESTED_KEY)).toBe(5); + expect((typeof env.DEFINED_NESTED_KEY)).toBe("number"); if(env.DEFINED_NESTED_KEY !== 5) require("fail"); if(typeof env.DEFINED_NESTED_KEY !== "number") require("fail"); var x = env.DEFINED_NESTED_KEY; - x.should.be.eql(5); + expect(x).toBe(5); }(process.env)); }); it("should define process.env.DEFINED_NESTED_KEY_STRING", function() { @@ -79,7 +79,7 @@ it("should define process.env.DEFINED_NESTED_KEY_STRING", function() { }); it("should assign to process.env", function() { process.env.TEST = "test"; - process.env.TEST.should.be.eql("test"); + expect(process.env.TEST).toBe("test"); }); it("should not have brackets on start", function() { function f() { @@ -90,13 +90,13 @@ it("should not have brackets on start", function() { }); it("should not explode on recursive typeof calls", function() { - (typeof wurst).should.eql("undefined"); // <- is recursively defined in config + expect(typeof wurst).toEqual("undefined"); // <- is recursively defined in config }); it("should not explode on recursive statements", function() { - (function() { + expect(function() { wurst; // <- is recursively defined in config - }).should.throw("suppe is not defined"); + }).toThrowError("suppe is not defined"); }); it("should evaluate composed expressions (issue 5100)", function() { @@ -111,6 +111,6 @@ it("should follow renamings in var (issue 5215)", function() { var _process$env = process.env, TEST = _process$env.TEST, DEFINED_NESTED_KEY = _process$env.DEFINED_NESTED_KEY; - TEST.should.be.eql("test"); - DEFINED_NESTED_KEY.should.be.eql(5); + expect(TEST).toBe("test"); + expect(DEFINED_NESTED_KEY).toBe(5); }); diff --git a/test/configCases/plugins/define-plugin/webpack.config.js b/test/configCases/plugins/define-plugin/webpack.config.js index 867ee3186..74a140740 100644 --- a/test/configCases/plugins/define-plugin/webpack.config.js +++ b/test/configCases/plugins/define-plugin/webpack.config.js @@ -5,7 +5,7 @@ module.exports = { TRUE: true, FALSE: false, UNDEFINED: undefined, - FUNCTION: function(a) { + FUNCTION: /* istanbul ignore next */ function(a) { return a + 1; }, CODE: "(1+2)", @@ -13,7 +13,7 @@ module.exports = { OBJECT: { SUB: { UNDEFINED: undefined, - FUNCTION: function(a) { + FUNCTION: /* istanbul ignore next */ function(a) { return a + 1; }, CODE: "(1+2)", diff --git a/test/configCases/plugins/lib-manifest-plugin/index.js b/test/configCases/plugins/lib-manifest-plugin/index.js index 30e1318de..0994b64ac 100644 --- a/test/configCases/plugins/lib-manifest-plugin/index.js +++ b/test/configCases/plugins/lib-manifest-plugin/index.js @@ -3,15 +3,16 @@ var path = require("path"); it("should complete", function(done) { require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); + expect(require("./a")).toBe("a"); done(); }); }); it("should write the correct manifest", function() { var manifest = JSON.parse(fs.readFileSync(path.join(__dirname, 'bundle0-manifest.json'), "utf-8")); - manifest.should.have.key("content", "name"); - manifest.content.should.not.have.property("./a.js"); - manifest.content.should.have.property("./index.js"); - manifest.content["./index.js"].should.have.property("id").eql(module.id); + expect(manifest).toHaveProperty("content"); + expect(manifest).toHaveProperty("name"); + expect(manifest.content).not.toHaveProperty(["./a.js"]); + expect(manifest.content).toHaveProperty(["./index.js"]); + expect(manifest.content["./index.js"]).toHaveProperty("id", module.id); }); diff --git a/test/configCases/plugins/loader-options-plugin/index.js b/test/configCases/plugins/loader-options-plugin/index.js index ec6279f29..efce2b7fc 100644 --- a/test/configCases/plugins/loader-options-plugin/index.js +++ b/test/configCases/plugins/loader-options-plugin/index.js @@ -1,11 +1,11 @@ it("should set correct options on js files", function() { - require("./loader!./index.js").should.be.eql({ + expect(require("./loader!./index.js")).toEqual({ minimize: true, jsfile: true }); }); it("should set correct options on other files", function() { - require("./loader!./txt.txt").should.be.eql({ + expect(require("./loader!./txt.txt")).toEqual({ minimize: true }); }); diff --git a/test/configCases/plugins/min-chunk-size/index.js b/test/configCases/plugins/min-chunk-size/index.js index 33290592b..fb7861444 100644 --- a/test/configCases/plugins/min-chunk-size/index.js +++ b/test/configCases/plugins/min-chunk-size/index.js @@ -1,18 +1,18 @@ it("should combine two chunk if too small", done => { // b should not yet available var bf = __webpack_modules__[require.resolveWeak("./b")]; - (typeof bf).should.be.eql("undefined"); + expect((typeof bf)).toBe("undefined"); // load a import("./a").then(a => { - a.default.should.be.eql("a"); + expect(a.default).toBe("a"); // check if b is available too var bf = __webpack_modules__[require.resolveWeak("./b")]; - (typeof bf).should.be.eql("function"); + expect((typeof bf)).toBe("function"); // load b (just to check if it's ok) import("./b").then(b => { - b.default.should.be.eql("b"); + expect(b.default).toBe("b"); done(); }).catch(done); }).catch(done); diff --git a/test/configCases/plugins/profiling-plugin/index.js b/test/configCases/plugins/profiling-plugin/index.js index bd111552c..c7b9eae83 100644 --- a/test/configCases/plugins/profiling-plugin/index.js +++ b/test/configCases/plugins/profiling-plugin/index.js @@ -3,8 +3,9 @@ import "./test.json"; it("should generate a events.json file", () => { var fs = require("fs"), path = require("path"), - os = require("os"); - fs.existsSync(path.join(os.tmpdir(), "events.json")).should.be.true(); + os = require("os"); + + expect(fs.existsSync(path.join(__dirname, "events.json"))).toBe(true); }); it("should have proper setup record inside of the json stream", () => { @@ -12,7 +13,7 @@ it("should have proper setup record inside of the json stream", () => { path = require("path"), os = require("os"); - // convert json stream to valid - var source = JSON.parse(fs.readFileSync(path.join(os.tmpdir(), "events.json"), "utf-8").toString() + "{}]"); - source[0].id.should.eql(1); + // convert json stream to valid + var source = JSON.parse(fs.readFileSync(path.join(__dirname, "events.json"), "utf-8").toString() + "{}]"); + expect(source[0].id).toEqual(1); }); diff --git a/test/configCases/plugins/profiling-plugin/webpack.config.js b/test/configCases/plugins/profiling-plugin/webpack.config.js index 58933fe41..1d0eb54fb 100644 --- a/test/configCases/plugins/profiling-plugin/webpack.config.js +++ b/test/configCases/plugins/profiling-plugin/webpack.config.js @@ -1,16 +1,15 @@ var rootPath = "../../../../"; var webpack = require(rootPath); var path = require("path"); -var os = require("os"); -module.exports = { +module.exports = (env, { testPath }) => ({ plugins: [ new webpack.debug.ProfilingPlugin({ - outputPath: path.join(os.tmpdir(), "events.json") + outputPath: path.join(testPath, "events.json") }) ], node: { __dirname: false, __filename: false } -}; +}); diff --git a/test/configCases/plugins/progress-plugin/index.js b/test/configCases/plugins/progress-plugin/index.js index cf1134394..d91f53a9c 100644 --- a/test/configCases/plugins/progress-plugin/index.js +++ b/test/configCases/plugins/progress-plugin/index.js @@ -1,6 +1,6 @@ it("should contain the custom progress messages", function() { var data = require(__dirname + "/data"); - data.should.containEql("optimizing"); - data.should.containEql("optimizing|CustomPlugin"); - data.should.containEql("optimizing|CustomPlugin|custom category|custom message"); + expect(data).toContain("optimizing"); + expect(data).toContain("optimizing|CustomPlugin"); + expect(data).toContain("optimizing|CustomPlugin|custom category|custom message"); }); diff --git a/test/configCases/plugins/provide-plugin/index.js b/test/configCases/plugins/provide-plugin/index.js index 7bfad58c0..00d4fe5c7 100644 --- a/test/configCases/plugins/provide-plugin/index.js +++ b/test/configCases/plugins/provide-plugin/index.js @@ -1,58 +1,58 @@ it("should provide a module for a simple free var", function() { - aaa.should.be.eql("aaa"); + expect(aaa).toBe("aaa"); }); it("should provide a module for a nested var", function() { - (bbb.ccc).should.be.eql("bbbccc"); + expect((bbb.ccc)).toBe("bbbccc"); var x = bbb.ccc; - x.should.be.eql("bbbccc"); + expect(x).toBe("bbbccc"); }); it("should provide a module for a nested var within a IIFE's argument", function() { (function(process) { - (process.env.NODE_ENV).should.be.eql("development"); + expect((process.env.NODE_ENV)).toBe("development"); var x = process.env.NODE_ENV; - x.should.be.eql("development"); + expect(x).toBe("development"); }(process)); }); it("should provide a module for thisExpression", () => { - (this.aaa).should.be.eql("aaa"); + expect(this.aaa).toBe("aaa"); }); it("should provide a module for a nested var within a IIFE's this", function() { (function() { - (this.env.NODE_ENV).should.be.eql("development"); + expect((this.env.NODE_ENV)).toBe("development"); var x = this.env.NODE_ENV; - x.should.be.eql("development"); + expect(x).toBe("development"); }.call(process)); }); it("should provide a module for a nested var within a nested IIFE's this", function() { (function() { (function() { - (this.env.NODE_ENV).should.be.eql("development"); + expect((this.env.NODE_ENV)).toBe("development"); var x = this.env.NODE_ENV; - x.should.be.eql("development"); + expect(x).toBe("development"); }.call(this)); }.call(process)); }); it("should not provide a module for a part of a var", function() { - (typeof bbb).should.be.eql("undefined"); + expect((typeof bbb)).toBe("undefined"); }); it("should provide a module for a property request", function() { - (dddeeefff).should.be.eql("fff"); + expect((dddeeefff)).toBe("fff"); var x = dddeeefff; - x.should.be.eql("fff"); + expect(x).toBe("fff"); }); it("should provide ES2015 modules", function() { - (es2015.default).should.be.eql("ECMAScript 2015"); - (es2015.alias).should.be.eql("ECMAScript Harmony"); - (es2015.year).should.be.eql(2015); - (es2015_name).should.be.eql("ECMAScript 2015"); - (es2015_alias).should.be.eql("ECMAScript Harmony"); - (es2015_year).should.be.eql(2015); + expect((es2015.default)).toBe("ECMAScript 2015"); + expect((es2015.alias)).toBe("ECMAScript Harmony"); + expect((es2015.year)).toBe(2015); + expect((es2015_name)).toBe("ECMAScript 2015"); + expect((es2015_alias)).toBe("ECMAScript Harmony"); + expect((es2015_year)).toBe(2015); }); diff --git a/test/configCases/plugins/source-map-dev-tool-plugin/index.js b/test/configCases/plugins/source-map-dev-tool-plugin/index.js index af9165efb..53b37f635 100644 --- a/test/configCases/plugins/source-map-dev-tool-plugin/index.js +++ b/test/configCases/plugins/source-map-dev-tool-plugin/index.js @@ -2,11 +2,11 @@ it("should contain publicPath prefix in [url] and resolve relatively to fileCont var fs = require("fs"), path = require("path"); var source = fs.readFileSync(path.join(__dirname, "public/test.js"), "utf-8"); - source.should.containEql("//# sourceMappingURL=https://10.10.10.10/project/sourcemaps/test.js.map"); + expect(source).toMatch("//# sourceMappingURL=https://10.10.10.10/project/sourcemaps/test.js.map"); }); it("should write sourcemap file relative fo fileContext", function() { var fs = require("fs"), path = require("path"); - fs.existsSync(path.join(__dirname, "sourcemaps/test.js.map")).should.be.true(); + expect(fs.existsSync(path.join(__dirname, "sourcemaps/test.js.map"))).toBe(true); }); diff --git a/test/configCases/plugins/uglifyjs-plugin/index.js b/test/configCases/plugins/uglifyjs-plugin/index.js index bf62cee31..73df11233 100644 --- a/test/configCases/plugins/uglifyjs-plugin/index.js +++ b/test/configCases/plugins/uglifyjs-plugin/index.js @@ -3,9 +3,9 @@ it("should contain no comments in out chunk", () => { const source = fs.readFileSync(__filename, "utf-8"); - source.should.not.match(/[^\"]comment should be stripped test\.1[^\"]/); - source.should.not.match(/[^\"]comment should be stripped test\.2[^\"]/); - source.should.not.match(/[^\"]comment should be stripped test\.3[^\"]/); + expect(source).not.toMatch(/[^\"]comment should be stripped test\.1[^\"]/); + expect(source).not.toMatch(/[^\"]comment should be stripped test\.2[^\"]/); + expect(source).not.toMatch(/[^\"]comment should be stripped test\.3[^\"]/); }); it("should contain comments in vendors chunk", function() { @@ -14,9 +14,9 @@ it("should contain comments in vendors chunk", function() { const source = fs.readFileSync(path.join(__dirname, "vendors.js"), "utf-8"); - source.should.containEql("comment should not be stripped vendors.1"); - source.should.containEql("// comment should not be stripped vendors.2"); - source.should.containEql(" * comment should not be stripped vendors.3"); + expect(source).toMatch("comment should not be stripped vendors.1"); + expect(source).toMatch("// comment should not be stripped vendors.2"); + expect(source).toMatch(" * comment should not be stripped vendors.3"); }); it("should extract comments to separate file", function() { @@ -25,10 +25,10 @@ it("should extract comments to separate file", function() { const source = fs.readFileSync(path.join(__dirname, "extract.js.LICENSE"), "utf-8"); - source.should.containEql("comment should be extracted extract-test.1"); - source.should.not.containEql("comment should be stripped extract-test.2"); - source.should.containEql("comment should be extracted extract-test.3"); - source.should.not.containEql("comment should be stripped extract-test.4"); + expect(source).toMatch("comment should be extracted extract-test.1"); + expect(source).not.toMatch("comment should be stripped extract-test.2"); + expect(source).toMatch("comment should be extracted extract-test.3"); + expect(source).not.toMatch("comment should be stripped extract-test.4"); }); it("should remove extracted comments and insert a banner", function() { @@ -37,11 +37,11 @@ it("should remove extracted comments and insert a banner", function() { const source = fs.readFileSync(path.join(__dirname, "extract.js"), "utf-8"); - source.should.not.containEql("comment should be extracted extract-test.1"); - source.should.not.containEql("comment should be stripped extract-test.2"); - source.should.not.containEql("comment should be extracted extract-test.3"); - source.should.not.containEql("comment should be stripped extract-test.4"); - source.should.containEql("/*! For license information please see extract.js.LICENSE */"); + expect(source).not.toMatch("comment should be extracted extract-test.1"); + expect(source).not.toMatch("comment should be stripped extract-test.2"); + expect(source).not.toMatch("comment should be extracted extract-test.3"); + expect(source).not.toMatch("comment should be stripped extract-test.4"); + expect(source).toMatch("/*! For license information please see extract.js.LICENSE */"); }); it("should pass mangle options", function() { @@ -50,7 +50,7 @@ it("should pass mangle options", function() { const source = fs.readFileSync(path.join(__dirname, "ie8.js"), "utf-8"); - source.should.containEql("t.exports=function(t){return function(n){try{t()}catch(t){n(t)}}}"); + expect(source).toMatch("t.exports=function(t){return function(n){try{t()}catch(t){n(t)}}}"); }); it("should pass compress options", function() { @@ -59,7 +59,7 @@ it("should pass compress options", function() { const source = fs.readFileSync(path.join(__dirname, "compress.js"), "utf-8"); - source.should.containEql("o.exports=function(){console.log(4),console.log(6),console.log(4),console.log(7)}"); + expect(source).toMatch("o.exports=function(){console.log(4),console.log(6),console.log(4),console.log(7)}"); }); require.include("./test.js"); diff --git a/test/configCases/race-conditions/load-module/index.js b/test/configCases/race-conditions/load-module/index.js index 34d52e764..668417cd2 100644 --- a/test/configCases/race-conditions/load-module/index.js +++ b/test/configCases/race-conditions/load-module/index.js @@ -1,4 +1,4 @@ it("should not deadlock when using loadModule", () => { const result = require("./loader!"); - result.should.match(/console.log\(42\)/); + expect(result).toMatch(/console.log\(42\)/); }); diff --git a/test/configCases/records/issue-295/test.js b/test/configCases/records/issue-295/test.js index 04974582b..c56f7adbb 100644 --- a/test/configCases/records/issue-295/test.js +++ b/test/configCases/records/issue-295/test.js @@ -5,5 +5,5 @@ it("should write relative paths to records", function() { var fs = require("fs"); var path = require("path"); var content = fs.readFileSync(path.join(__dirname, "records.json"), "utf-8"); - content.should.not.match(/webpack|issue/); + expect(content).not.toMatch(/webpack|issue/); }); diff --git a/test/configCases/records/issue-2991/test.js b/test/configCases/records/issue-2991/test.js index 8199725de..c2736c3f1 100644 --- a/test/configCases/records/issue-2991/test.js +++ b/test/configCases/records/issue-2991/test.js @@ -6,7 +6,7 @@ it("should write relative paths to records", function() { var fs = require("fs"); var path = require("path"); var content = fs.readFileSync(path.join(__dirname, "records.json"), "utf-8"); - content.should.eql(`{ + expect(content).toEqual(`{ "modules": { "byIdentifier": { "external \\"path\\"": 0, diff --git a/test/configCases/rule-set/chaining/index.js b/test/configCases/rule-set/chaining/index.js index ca3b76c2c..ccb162203 100644 --- a/test/configCases/rule-set/chaining/index.js +++ b/test/configCases/rule-set/chaining/index.js @@ -1,6 +1,6 @@ it("should match rule with multiple loaders in 'loader'", function() { var abc = require("./abc"); - abc.should.be.eql([ + expect(abc).toEqual([ "abc", "?b", "?a" @@ -8,7 +8,7 @@ it("should match rule with multiple loaders in 'loader'", function() { }); it("should match rule with multiple loaders in 'loaders'", function() { var def = require("./def"); - def.should.be.eql([ + expect(def).toEqual([ "def", "?d", "?c" diff --git a/test/configCases/rule-set/compiler/index.js b/test/configCases/rule-set/compiler/index.js index ae9a155a9..6eb52e6c4 100644 --- a/test/configCases/rule-set/compiler/index.js +++ b/test/configCases/rule-set/compiler/index.js @@ -1,6 +1,6 @@ it("should match rule with compiler name", function() { var a = require("./a"); - a.should.be.eql("loader matched"); + expect(a).toBe("loader matched"); var b = require("./b"); - b.should.be.eql("loader not matched"); + expect(b).toBe("loader not matched"); }); diff --git a/test/configCases/rule-set/custom/index.js b/test/configCases/rule-set/custom/index.js index 8c73ef9fa..e4894af51 100644 --- a/test/configCases/rule-set/custom/index.js +++ b/test/configCases/rule-set/custom/index.js @@ -1,6 +1,6 @@ it("should match a custom loader", function() { var a = require("./a"); - a.should.be.eql([ + expect(a).toEqual([ "a", { issuer: "index.js", @@ -9,7 +9,7 @@ it("should match a custom loader", function() { } ]); var b = require("./b?hello"); - b.should.be.eql([ + expect(b).toEqual([ "b", { issuer: "index.js", @@ -18,7 +18,7 @@ it("should match a custom loader", function() { } ]); var ca = require("./call-a?hello"); - ca.should.be.eql([ + expect(ca).toEqual([ "a", { issuer: "call-a.js", diff --git a/test/configCases/rule-set/query/index.js b/test/configCases/rule-set/query/index.js index baeb9e1e9..7114b9778 100644 --- a/test/configCases/rule-set/query/index.js +++ b/test/configCases/rule-set/query/index.js @@ -1,15 +1,15 @@ it("should match rule with resource query", function() { var a1 = require("./a"); - a1.should.be.eql([ + expect(a1).toEqual([ "a" ]); var a2 = require("./a?loader"); - a2.should.be.eql([ + expect(a2).toEqual([ "a", "?query" ]); var a3 = require("./a?other"); - a3.should.be.eql([ + expect(a3).toEqual([ "a" ]); }); diff --git a/test/configCases/rule-set/resolve-options/index.js b/test/configCases/rule-set/resolve-options/index.js index c5da4bedd..5baf4c239 100644 --- a/test/configCases/rule-set/resolve-options/index.js +++ b/test/configCases/rule-set/resolve-options/index.js @@ -1,6 +1,6 @@ it("should allow to set custom resolving rules", function() { var a = require("./a"); - a.should.be.eql("ok"); + expect(a).toBe("ok"); var b = require("./b"); - b.should.be.eql("wrong"); + expect(b).toBe("wrong"); }); diff --git a/test/configCases/rule-set/simple-use-array-fn/index.js b/test/configCases/rule-set/simple-use-array-fn/index.js index 5c0fb1255..64637f8ab 100644 --- a/test/configCases/rule-set/simple-use-array-fn/index.js +++ b/test/configCases/rule-set/simple-use-array-fn/index.js @@ -1,6 +1,6 @@ it("should match only one rule in a oneOf block", function() { var ab = require("./ab"); - ab.should.be.eql([ + expect(ab).toEqual([ "ab", "?first" ]); @@ -8,11 +8,11 @@ it("should match only one rule in a oneOf block", function() { it("should match with issuer and any option value", function() { var a = require("./a"); var b = require("./b"); - a.should.be.eql([ + expect(a).toEqual([ "a", "?third", ]); - b.should.be.eql([[ + expect(b).toEqual([[ "a", "second-3", "?second-2", diff --git a/test/configCases/rule-set/simple-use-fn-array/index.js b/test/configCases/rule-set/simple-use-fn-array/index.js index 5c0fb1255..64637f8ab 100644 --- a/test/configCases/rule-set/simple-use-fn-array/index.js +++ b/test/configCases/rule-set/simple-use-fn-array/index.js @@ -1,6 +1,6 @@ it("should match only one rule in a oneOf block", function() { var ab = require("./ab"); - ab.should.be.eql([ + expect(ab).toEqual([ "ab", "?first" ]); @@ -8,11 +8,11 @@ it("should match only one rule in a oneOf block", function() { it("should match with issuer and any option value", function() { var a = require("./a"); var b = require("./b"); - a.should.be.eql([ + expect(a).toEqual([ "a", "?third", ]); - b.should.be.eql([[ + expect(b).toEqual([[ "a", "second-3", "?second-2", diff --git a/test/configCases/rule-set/simple/index.js b/test/configCases/rule-set/simple/index.js index 5c0fb1255..64637f8ab 100644 --- a/test/configCases/rule-set/simple/index.js +++ b/test/configCases/rule-set/simple/index.js @@ -1,6 +1,6 @@ it("should match only one rule in a oneOf block", function() { var ab = require("./ab"); - ab.should.be.eql([ + expect(ab).toEqual([ "ab", "?first" ]); @@ -8,11 +8,11 @@ it("should match only one rule in a oneOf block", function() { it("should match with issuer and any option value", function() { var a = require("./a"); var b = require("./b"); - a.should.be.eql([ + expect(a).toEqual([ "a", "?third", ]); - b.should.be.eql([[ + expect(b).toEqual([[ "a", "second-3", "?second-2", diff --git a/test/configCases/runtime/opt-in-finally/index.js b/test/configCases/runtime/opt-in-finally/index.js index 5c5047db5..5d0bac929 100644 --- a/test/configCases/runtime/opt-in-finally/index.js +++ b/test/configCases/runtime/opt-in-finally/index.js @@ -1,8 +1,8 @@ it("should throw exception on every try to load a module", function() { - (function() { + expect(function() { require("./exception"); - }).should.throw(); - (function() { + }).toThrowError(); + expect(function() { require("./exception"); - }).should.throw(); + }).toThrowError(); }); diff --git a/test/configCases/scope-hoisting/dll-plugin/index.js b/test/configCases/scope-hoisting/dll-plugin/index.js index 90b28ea4e..c1533a31a 100644 --- a/test/configCases/scope-hoisting/dll-plugin/index.js +++ b/test/configCases/scope-hoisting/dll-plugin/index.js @@ -1,5 +1,5 @@ import value from "dll/module"; it("should not scope hoist delegated modules", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/configCases/scope-hoisting/named-modules/index.js b/test/configCases/scope-hoisting/named-modules/index.js index 2339e0ccd..9e915eb93 100644 --- a/test/configCases/scope-hoisting/named-modules/index.js +++ b/test/configCases/scope-hoisting/named-modules/index.js @@ -1,5 +1,5 @@ import value from "./module"; it("should generate valid code", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/configCases/scope-hoisting/strictThisContextOnImports/index.js b/test/configCases/scope-hoisting/strictThisContextOnImports/index.js index 9f14a7229..174d19ee4 100644 --- a/test/configCases/scope-hoisting/strictThisContextOnImports/index.js +++ b/test/configCases/scope-hoisting/strictThisContextOnImports/index.js @@ -2,10 +2,10 @@ import value, { identity } from "./module"; import * as m from "./module"; it("should parse and translate identifiers correctly", function() { - identity(value).should.be.eql(1234); - m.identity(value).should.be.eql(1234); - m.identity(identity).should.be.eql(identity); - m.identity(m.identity).should.be.eql(m.identity); - identity(m.identity).should.be.eql(m.identity); - identity(m.default).should.be.eql(1234); + expect(identity(value)).toBe(1234); + expect(m.identity(value)).toBe(1234); + expect(m.identity(identity)).toBe(identity); + expect(m.identity(m.identity)).toBe(m.identity); + expect(identity(m.identity)).toBe(m.identity); + expect(identity(m.default)).toBe(1234); }); diff --git a/test/configCases/side-effects/side-effects-override/index.js b/test/configCases/side-effects/side-effects-override/index.js index b15057fe0..ca444036a 100644 --- a/test/configCases/side-effects/side-effects-override/index.js +++ b/test/configCases/side-effects/side-effects-override/index.js @@ -4,8 +4,8 @@ import p from "pmodule"; import n from "nmodule"; it("should be able to override side effects", function() { - p.should.be.eql("def"); - n.should.be.eql("def"); - plog.should.be.eql(["a.js", "b.js", "c.js", "index.js"]); - nlog.should.be.eql(["index.js"]); + expect(p).toBe("def"); + expect(n).toBe("def"); + expect(plog).toEqual(["a.js", "b.js", "c.js", "index.js"]); + expect(nlog).toEqual(["index.js"]); }); diff --git a/test/configCases/side-effects/side-effects-values/index.js b/test/configCases/side-effects/side-effects-values/index.js index 1e8a69e2a..c2c5c0ffd 100644 --- a/test/configCases/side-effects/side-effects-values/index.js +++ b/test/configCases/side-effects/side-effects-values/index.js @@ -4,13 +4,13 @@ import { log as globValueModuleLog } from "glob-value-module/tracker"; import globValueModule from "glob-value-module"; it("should handle a boolean", function() { - booleanValueModule.should.be.eql("def"); - booleanValueModuleLog.should.be.eql(["index.js"]); + expect(booleanValueModule).toBe("def"); + expect(booleanValueModuleLog).toEqual(["index.js"]); }); it("should handle globs", function() { - globValueModule.should.be.eql("def"); - globValueModuleLog.should.be.eql([ + expect(globValueModule).toBe("def"); + expect(globValueModuleLog).toEqual([ "./src/a.js", "a.js", "index.js", diff --git a/test/configCases/source-map/exclude-chunks-source-map/index.js b/test/configCases/source-map/exclude-chunks-source-map/index.js index 9be4dd596..810a47f9f 100644 --- a/test/configCases/source-map/exclude-chunks-source-map/index.js +++ b/test/configCases/source-map/exclude-chunks-source-map/index.js @@ -2,14 +2,14 @@ it("should include test.js in SourceMap for bundle0 chunk", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("webpack:///./test.js"); + expect(map.sources).toContain("webpack:///./test.js"); }); it("should not produce a SourceMap for vendors chunk", function() { var fs = require("fs"), path = require("path"), assert = require("assert"); - fs.existsSync(path.join(__dirname, "vendors.js.map")).should.be.false(); + expect(fs.existsSync(path.join(__dirname, "vendors.js.map"))).toBe(false); }); require.include("./test.js"); diff --git a/test/configCases/source-map/exclude-modules-source-map/index.js b/test/configCases/source-map/exclude-modules-source-map/index.js index 942871944..bb54f2716 100644 --- a/test/configCases/source-map/exclude-modules-source-map/index.js +++ b/test/configCases/source-map/exclude-modules-source-map/index.js @@ -2,7 +2,7 @@ it("bundle1 should include eval sourcemapped test1.js and test2.js as is", funct var fs = require("fs"); var path = require("path"); var bundle1 = fs.readFileSync(path.join(__dirname, "bundle1.js"), "utf-8"); - bundle1.should.containEql("eval(\"var test1marker"); - bundle1.should.containEql("var test2marker"); - bundle1.should.not.containEql("eval(\"var test2marker"); + expect(bundle1).toMatch("eval(\"var test1marker"); + expect(bundle1).toMatch("var test2marker"); + expect(bundle1).not.toMatch("eval(\"var test2marker"); }); diff --git a/test/configCases/source-map/line-to-line/index.js b/test/configCases/source-map/line-to-line/index.js index d4c6fd6cc..23a95f012 100644 --- a/test/configCases/source-map/line-to-line/index.js +++ b/test/configCases/source-map/line-to-line/index.js @@ -2,7 +2,7 @@ it("should include test.js in SourceMap", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("webpack:///./test.js"); + expect(map.sources).toContain("webpack:///./test.js"); }); require.include("./test.js"); diff --git a/test/configCases/source-map/module-names/index.js b/test/configCases/source-map/module-names/index.js index e776749df..f1c338c72 100644 --- a/test/configCases/source-map/module-names/index.js +++ b/test/configCases/source-map/module-names/index.js @@ -7,14 +7,14 @@ function getSourceMap(filename) { it("should include test.js in SourceMap", function() { var map = getSourceMap("bundle0.js"); - map.sources.should.containEql("module"); - map.sources.should.containEql("fallback"); - map.sources.should.containEql("fallback**"); + expect(map.sources).toContain("module"); + expect(map.sources).toContain("fallback"); + expect(map.sources).toContain("fallback**"); map = getSourceMap("chunk-a.js"); - map.sources.should.containEql("fallback*"); + expect(map.sources).toContain("fallback*"); map = getSourceMap("chunk-b.js"); - map.sources.should.containEql("fallback*"); - map.sources.should.containEql("fallback***"); + expect(map.sources).toContain("fallback*"); + expect(map.sources).toContain("fallback***"); }); require.ensure(["./test.js"], function(require) {}, "chunk-a"); diff --git a/test/configCases/source-map/namespace-source-path.library/index.js b/test/configCases/source-map/namespace-source-path.library/index.js index 5dfce4d59..3f9942635 100644 --- a/test/configCases/source-map/namespace-source-path.library/index.js +++ b/test/configCases/source-map/namespace-source-path.library/index.js @@ -2,7 +2,7 @@ it("should include webpack://mylibrary/./test.js in SourceMap", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("webpack://mylibrary/./test.js"); + expect(map.sources).toContain("webpack://mylibrary/./test.js"); }); require.include("./test.js"); diff --git a/test/configCases/source-map/namespace-source-path/index.js b/test/configCases/source-map/namespace-source-path/index.js index da7dbac42..cbe53a9c4 100644 --- a/test/configCases/source-map/namespace-source-path/index.js +++ b/test/configCases/source-map/namespace-source-path/index.js @@ -2,7 +2,7 @@ it("should include webpack://mynamespace/./test.js in SourceMap", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("webpack://mynamespace/./test.js"); + expect(map.sources).toContain("webpack://mynamespace/./test.js"); }); require.include("./test.js"); diff --git a/test/configCases/source-map/nosources/index.js b/test/configCases/source-map/nosources/index.js index ccd3cad06..25bfc59c5 100644 --- a/test/configCases/source-map/nosources/index.js +++ b/test/configCases/source-map/nosources/index.js @@ -2,7 +2,7 @@ it("should not include sourcesContent if noSources option is used", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.should.not.have.property('sourcesContent'); + expect(map).not.toHaveProperty('sourcesContent'); }); require.include("./test.js"); diff --git a/test/configCases/source-map/relative-source-map-path/index.js b/test/configCases/source-map/relative-source-map-path/index.js index 3a94a8228..c91933662 100644 --- a/test/configCases/source-map/relative-source-map-path/index.js +++ b/test/configCases/source-map/relative-source-map-path/index.js @@ -2,11 +2,12 @@ it("should have a relative url to the source-map", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); var match = /sourceMappingURL\s*=\s*(.*)/.exec(source); - match[1].should.be.eql("bundle0.js.map"); + expect(match[1]).toBe("bundle0.js.map"); }); it("should have a relative url to the source-map with prefix", function(done) { require.ensure([], function(require) { + global.expect = expect; require("./test.js"); done(); }); diff --git a/test/configCases/source-map/relative-source-map-path/test.js b/test/configCases/source-map/relative-source-map-path/test.js index 46627acd3..02ac3dd39 100644 --- a/test/configCases/source-map/relative-source-map-path/test.js +++ b/test/configCases/source-map/relative-source-map-path/test.js @@ -1,4 +1,4 @@ var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); var match = /sourceMappingURL\s*=\s*(.*)/.exec(source); -match[1].should.be.eql("c.js.map"); \ No newline at end of file +expect(match[1]).toBe("c.js.map"); diff --git a/test/configCases/source-map/source-map-filename-contenthash/index.js b/test/configCases/source-map/source-map-filename-contenthash/index.js index 455b624c9..dd9fc97ab 100644 --- a/test/configCases/source-map/source-map-filename-contenthash/index.js +++ b/test/configCases/source-map/source-map-filename-contenthash/index.js @@ -2,5 +2,5 @@ it("should contain contenthash as query parameter and path", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); var match = /sourceMappingURL\s*=.*-([A-Fa-f0-9]{32})\.map\?([A-Fa-f0-9]{32})-([A-Fa-f0-9]{32})/.exec(source); - match.length.should.be.eql(4); + expect(match.length).toBe(4); }); diff --git a/test/configCases/source-map/source-map-with-profiling-plugin/index.js b/test/configCases/source-map/source-map-with-profiling-plugin/index.js index c970d7e6c..dac5992ee 100644 --- a/test/configCases/source-map/source-map-with-profiling-plugin/index.js +++ b/test/configCases/source-map/source-map-with-profiling-plugin/index.js @@ -2,7 +2,7 @@ it("bundle0 should include sourcemapped test.js", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("webpack:///./test.js"); + expect(map.sources).toContain("webpack:///./test.js"); }); require.include("./test.js"); diff --git a/test/configCases/source-map/sources-array-production/index.js b/test/configCases/source-map/sources-array-production/index.js index d4c6fd6cc..23a95f012 100644 --- a/test/configCases/source-map/sources-array-production/index.js +++ b/test/configCases/source-map/sources-array-production/index.js @@ -2,7 +2,7 @@ it("should include test.js in SourceMap", function() { var fs = require("fs"); var source = fs.readFileSync(__filename + ".map", "utf-8"); var map = JSON.parse(source); - map.sources.should.containEql("webpack:///./test.js"); + expect(map.sources).toContain("webpack:///./test.js"); }); require.include("./test.js"); diff --git a/test/configCases/split-chunks/chunk-filename-delimiter-default/index.js b/test/configCases/split-chunks/chunk-filename-delimiter-default/index.js index 15b22fc95..0b3d46fd3 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter-default/index.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter-default/index.js @@ -1,5 +1,3 @@ -require("should"); - it("should run", function() { Promise.all( [ @@ -12,5 +10,5 @@ it("should run", function() { const files = require("fs").readdirSync(__dirname); const hasFile = files.indexOf('a~b~c.bundle.js') !== -1; - hasFile.should.be.eql(true); + expect(hasFile).toBe(true); }); diff --git a/test/configCases/split-chunks/chunk-filename-delimiter/index.js b/test/configCases/split-chunks/chunk-filename-delimiter/index.js index 47a30f17f..c0179cf77 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter/index.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter/index.js @@ -1,5 +1,3 @@ -require("should"); - it("should run", function() { Promise.all( [ @@ -12,5 +10,5 @@ it("should run", function() { const files = require("fs").readdirSync(__dirname); const hasFile = files.indexOf('a-b-c.bundle.js') !== -1; - hasFile.should.be.eql(true); + expect(hasFile).toBe(true); }); diff --git a/test/configCases/split-chunks/no-options/index.js b/test/configCases/split-chunks/no-options/index.js index b5158af81..dfc5a1f6d 100644 --- a/test/configCases/split-chunks/no-options/index.js +++ b/test/configCases/split-chunks/no-options/index.js @@ -1,6 +1,4 @@ -require("should"); - it("should run", function() { var a = require("./a"); - a.should.be.eql("a"); + expect(a).toBe("a"); }); diff --git a/test/configCases/split-chunks/runtime-chunk-no-async/index.js b/test/configCases/split-chunks/runtime-chunk-no-async/index.js new file mode 100644 index 000000000..6068c2920 --- /dev/null +++ b/test/configCases/split-chunks/runtime-chunk-no-async/index.js @@ -0,0 +1 @@ +it("should compile and evaluate fine", () => {}); 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 new file mode 100644 index 000000000..7eafe4ed7 --- /dev/null +++ b/test/configCases/split-chunks/runtime-chunk-no-async/test.config.js @@ -0,0 +1,7 @@ +const fs = require("fs"); +module.exports = { + 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-no-async/webpack.config.js b/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js new file mode 100644 index 000000000..5f4da7943 --- /dev/null +++ b/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js @@ -0,0 +1,13 @@ +module.exports = { + entry: { + main: "./index" + }, + target: "web", + output: { + filename: "[name].js", + chunkFilename: "main.[contenthash:8].js" + }, + optimization: { + runtimeChunk: "single" + } +}; diff --git a/test/configCases/split-chunks/runtime-chunk/a.js b/test/configCases/split-chunks/runtime-chunk/a.js index 4c87bcac2..630d5af45 100644 --- a/test/configCases/split-chunks/runtime-chunk/a.js +++ b/test/configCases/split-chunks/runtime-chunk/a.js @@ -1,17 +1,18 @@ -const should = require("should"); const FakeDocument = require("../../../helpers/FakeDocument"); beforeEach(() => { global.document = new FakeDocument(); + global.window = {}; }); afterEach(() => { delete global.document; -}) + delete global.window; +}); it("should be able to load the split chunk on demand", () => { const promise = import(/* webpackChunkName: "shared" */ "./shared"); const script = document.head._children[0]; - should(script.src).be.eql("dep~b~shared.js"); + expect(script.src).toBe("dep~b~shared.js"); }); diff --git a/test/configCases/target/buffer-default/index.js b/test/configCases/target/buffer-default/index.js index 8ffa85e2f..9f0b5f8ba 100644 --- a/test/configCases/target/buffer-default/index.js +++ b/test/configCases/target/buffer-default/index.js @@ -1,10 +1,8 @@ -require("should"); - it("should provide a global Buffer shim", function () { - Buffer.should.be.a.Function(); + expect(Buffer).toBeInstanceOf(Function); }); it("should provide the buffer module", function () { var buffer = require("buffer"); - (typeof buffer).should.be.eql("object"); + expect((typeof buffer)).toBe("object"); }); diff --git a/test/configCases/target/buffer/index.js b/test/configCases/target/buffer/index.js index 1af4ad188..570c0e343 100644 --- a/test/configCases/target/buffer/index.js +++ b/test/configCases/target/buffer/index.js @@ -1,13 +1,3 @@ -require("should"); - it("should provide a global Buffer shim", function () { - Buffer.should.be.a.Function(); + expect(Buffer).toBeInstanceOf(Function); }); - -it("should fail on the buffer module"/*, function () { - (function(argument) { - try { - require("buffer"); - } catch(e) { throw e; } - }).should.throw(); -}*/); diff --git a/test/configCases/target/electron-renderer/index.js b/test/configCases/target/electron-renderer/index.js index 711552218..6e8c81abb 100644 --- a/test/configCases/target/electron-renderer/index.js +++ b/test/configCases/target/electron-renderer/index.js @@ -1,5 +1,5 @@ const foo = require("foo"); it("should use browser main field", () => { - foo.should.be.eql("browser"); + expect(foo).toBe("browser"); }); diff --git a/test/configCases/target/node-dynamic-import/index.js b/test/configCases/target/node-dynamic-import/index.js index e5bcc97a8..0a0ac4e00 100644 --- a/test/configCases/target/node-dynamic-import/index.js +++ b/test/configCases/target/node-dynamic-import/index.js @@ -2,11 +2,11 @@ function testCase(load, done) { load("two", 2, function() { var sync = true; load("one", 1, function() { - sync.should.be.eql(false); + expect(sync).toBe(false); load("three", 3, function() { var sync = true; load("two", 2, function() { - sync.should.be.eql(true); + expect(sync).toBe(true); done(); }); Promise.resolve().then(function() {}).then(function() {}).then(function() { @@ -23,7 +23,7 @@ function testCase(load, done) { it("should be able to use expressions in import", function(done) { function load(name, expected, callback) { import("./dir/" + name + '.js') - .then((result) => {result.should.be.eql({ default: expected }); callback()}) + .then((result) => {expect(result).toEqual({ default: expected }); callback()}) .catch((err) => {done(err)}); } testCase(load, done); @@ -32,7 +32,7 @@ it("should be able to use expressions in import", function(done) { it("should be able to use expressions in lazy-once import", function(done) { function load(name, expected, callback) { import(/* webpackMode: "lazy-once" */ "./dir/" + name + '.js') - .then((result) => {result.should.be.eql({ default: expected }); callback()}) + .then((result) => {expect(result).toEqual({ default: expected }); callback()}) .catch((err) => {done(err)}); } testCase(load, done); @@ -41,7 +41,7 @@ it("should be able to use expressions in lazy-once import", function(done) { it("should be able to use expressions in import", function(done) { function load(name, expected, callback) { import("./dir2/" + name).then((result) => { - result.should.be.eql({ default: expected }); + expect(result).toEqual({ default: expected }); callback(); }).catch((err) => { done(err); @@ -51,12 +51,12 @@ it("should be able to use expressions in import", function(done) { }); it("should convert to function in node", function() { - (typeof __webpack_require__.e).should.be.eql("function"); + expect((typeof __webpack_require__.e)).toBe("function"); }) it("should be able to use import", function(done) { import("./two").then((two) => { - two.should.be.eql({ default: 2 }); + expect(two).toEqual({ default: 2 }); done(); }).catch(function(err) { done(err); diff --git a/test/configCases/target/strict-mode-global/index.js b/test/configCases/target/strict-mode-global/index.js index da530ef4d..ba0b15cfa 100644 --- a/test/configCases/target/strict-mode-global/index.js +++ b/test/configCases/target/strict-mode-global/index.js @@ -1,8 +1,6 @@ "use strict"; -require("should"); - it("should be able to use global in strict mode", function() { - (typeof global).should.be.eql("object"); - (global === null).should.be.eql(false) + expect((typeof global)).toBe("object"); + expect((global === null)).toBe(false) }); diff --git a/test/configCases/target/umd-auxiliary-comments-object/index.js b/test/configCases/target/umd-auxiliary-comments-object/index.js index fd7de7e3c..ce88eecbf 100644 --- a/test/configCases/target/umd-auxiliary-comments-object/index.js +++ b/test/configCases/target/umd-auxiliary-comments-object/index.js @@ -6,8 +6,8 @@ it("should have auxiliary comments", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); - source.should.containEql("//test " + "comment " + "commonjs"); - source.should.containEql("//test " + "comment " + "commonjs2"); - source.should.containEql("//test " + "comment " + "amd"); - source.should.containEql("//test " + "comment " + "root"); + expect(source).toMatch("//test " + "comment " + "commonjs"); + expect(source).toMatch("//test " + "comment " + "commonjs2"); + expect(source).toMatch("//test " + "comment " + "amd"); + expect(source).toMatch("//test " + "comment " + "root"); }); diff --git a/test/configCases/target/umd-auxiliary-comments-string/index.js b/test/configCases/target/umd-auxiliary-comments-string/index.js index a02a54a03..9d9454a34 100644 --- a/test/configCases/target/umd-auxiliary-comments-string/index.js +++ b/test/configCases/target/umd-auxiliary-comments-string/index.js @@ -5,6 +5,6 @@ it("should run", function() { it("should have auxiliary comment string", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); - - source.should.containEql("//test " + "comment"); + + expect(source).toMatch("//test " + "comment"); }); diff --git a/test/configCases/target/umd-named-define/index.js b/test/configCases/target/umd-named-define/index.js index 749fbe37b..0d9cc474b 100644 --- a/test/configCases/target/umd-named-define/index.js +++ b/test/configCases/target/umd-named-define/index.js @@ -6,5 +6,5 @@ it("should name define", function() { var fs = require("fs"); var source = fs.readFileSync(__filename, "utf-8"); - source.should.containEql("define(\"NamedLibrary\","); + expect(source).toMatch("define(\"NamedLibrary\","); }); diff --git a/test/configCases/target/web/index.js b/test/configCases/target/web/index.js index 5b659b746..9e30bd08e 100644 --- a/test/configCases/target/web/index.js +++ b/test/configCases/target/web/index.js @@ -1,101 +1,90 @@ -require("should"); - -// shimming global XMLHttpRequest object so the http-module is happy. global.XMLHttpRequest = function() {}; global.XMLHttpRequest.prototype.open = function() {}; it("should provide a global Buffer constructor", function() { - Buffer.should.be.a.Function(); + expect(Buffer).toBeInstanceOf(Function); }); -// Webpack is not providing a console shim by default -// @see lib/WebpackOptionsDefaulter.js -// Uncomment this when defaults are changed -//it("should provide a global console shim", function () { -// console.should.be.an.Object(); -// console.time.should.be.a.Function(); -//}); - it("should provide a global process shim", function () { - process.should.be.an.Object(); + expect(process).toBeInstanceOf(Object); }); it("should provide a global setImmediate shim", function () { - setImmediate.should.be.a.Function(); + expect(setImmediate).toBeInstanceOf(Function); }); it("should provide a global clearImmediate shim", function () { - clearImmediate.should.be.a.Function(); + expect(clearImmediate).toBeInstanceOf(Function); }); it("should provide an assert shim", function () { - require("assert").should.be.a.Function(); + expect(require("assert")).toBeInstanceOf(Function); }); it("should provide a util shim", function () { - require("util").should.be.an.Object(); + expect(require("util")).toBeInstanceOf(Object); }); it("should provide a buffer shim", function () { - require("buffer").should.be.an.Object(); + expect(require("buffer")).toBeInstanceOf(Object); }); it("should provide a crypto shim", function () { - require("crypto").should.be.an.Object(); + expect(require("crypto")).toBeInstanceOf(Object); }); it("should provide a domain shim", function () { - require("domain").should.be.an.Object(); + expect(require("domain")).toBeInstanceOf(Object); }); it("should provide an events shim", function () { - require("events").should.be.a.Function(); + expect(require("events")).toBeInstanceOf(Function); }); it("should provide an http shim", function () { - require("http").should.be.an.Object(); + expect(require("http")).toBeInstanceOf(Object); }); it("should provide an https shim", function () { - require("https").should.be.an.Object(); + expect(require("https")).toBeInstanceOf(Object); }); it("should provide an os shim", function () { - require("os").should.be.an.Object(); + expect(require("os")).toBeInstanceOf(Object); }); it("should provide a path shim", function () { - require("path").should.be.an.Object(); + expect(require("path")).toBeInstanceOf(Object); }); it("should provide a punycode shim", function () { - require("punycode").should.be.an.Object(); + expect(require("punycode")).toBeInstanceOf(Object); }); it("should provide a stream shim", function () { - require("stream").should.be.a.Function(); + expect(require("stream")).toBeInstanceOf(Function); }); it("should provide a tty shim", function () { - require("tty").should.be.an.Object(); + expect(require("tty")).toBeInstanceOf(Object); }); it("should provide a url shim", function () { - require("url").should.be.an.Object(); + expect(require("url")).toBeInstanceOf(Object); }); it("should provide a util shim", function () { - require("util").should.be.an.Object(); + expect(require("util")).toBeInstanceOf(Object); }); it("should provide a vm shim", function () { - require("vm").should.be.an.Object(); + expect(require("vm")).toBeInstanceOf(Object); }); it("should provide a zlib shim", function () { - require("zlib").should.be.an.Object(); + expect(require("zlib")).toBeInstanceOf(Object); }); it("should provide a shim for a path in a build-in module", function () { - require("process/in.js").should.be.eql("in process"); + expect(require("process/in.js")).toBe("in process"); }); diff --git a/test/configCases/target/webworker/index.js b/test/configCases/target/webworker/index.js index 63a9cf2ce..40d1f6127 100644 --- a/test/configCases/target/webworker/index.js +++ b/test/configCases/target/webworker/index.js @@ -1,98 +1,95 @@ -var should = require("should"); -// shimming global window object so the http-module is happy. -// window is assigned without var on purpose. global.XMLHttpRequest = function() {}; global.XMLHttpRequest.prototype.open = function() {}; it("should provide a global Buffer constructor", function() { - Buffer.should.be.a.Function(); + expect(Buffer).toBeInstanceOf(Function); }); it("should provide a global console shim", function () { - console.should.be.an.Object(); - console.time.should.be.a.Function(); + expect(console).toBeTypeOf("object"); + expect(console.time).toBeTypeOf("function"); }); it("should provide a global process shim", function () { - process.should.be.an.Object(); + expect(process).toBeInstanceOf(Object); }); it("should provide a global setImmediate shim", function () { - setImmediate.should.be.a.Function(); + expect(setImmediate).toBeInstanceOf(Function); }); it("should provide a global clearImmediate shim", function () { - clearImmediate.should.be.a.Function(); + expect(clearImmediate).toBeInstanceOf(Function); }); it("should provide an assert shim", function () { - require("assert").should.be.a.Function(); + expect(require("assert")).toBeInstanceOf(Function); }); it("should provide a util shim", function () { - require("util").should.be.an.Object(); + expect(require("util")).toBeInstanceOf(Object); }); it("should provide a buffer shim", function () { - require("buffer").should.be.an.Object(); + expect(require("buffer")).toBeInstanceOf(Object); }); it("should provide a crypto shim", function () { - require("crypto").should.be.an.Object(); + expect(require("crypto")).toBeInstanceOf(Object); }); it("should provide a domain shim", function () { - require("domain").should.be.an.Object(); + expect(require("domain")).toBeInstanceOf(Object); }); it("should provide an events shim", function () { - require("events").should.be.a.Function(); + expect(require("events")).toBeInstanceOf(Function); }); it("should provide an http shim", function () { - require("http").should.be.an.Object(); + expect(require("http")).toBeInstanceOf(Object); }); it("should provide an https shim", function () { - require("https").should.be.an.Object(); + expect(require("https")).toBeInstanceOf(Object); }); it("should provide an os shim", function () { - require("os").should.be.an.Object(); + expect(require("os")).toBeInstanceOf(Object); }); it("should provide a path shim", function () { - require("path").should.be.an.Object(); + expect(require("path")).toBeInstanceOf(Object); }); it("should provide a punycode shim", function () { - require("punycode").should.be.an.Object(); + expect(require("punycode")).toBeInstanceOf(Object); }); it("should provide a stream shim", function () { - require("stream").should.be.a.Function(); + expect(require("stream")).toBeInstanceOf(Function); }); it("should provide a tty shim", function () { - require("tty").should.be.an.Object(); + expect(require("tty")).toBeInstanceOf(Object); }); it("should provide a url shim", function () { - require("url").should.be.an.Object(); + expect(require("url")).toBeInstanceOf(Object); }); it("should provide a util shim", function () { - require("util").should.be.an.Object(); + expect(require("util")).toBeInstanceOf(Object); }); it("should provide a vm shim", function () { - require("vm").should.be.an.Object(); + expect(require("vm")).toBeInstanceOf(Object); }); it("should provide a zlib shim", function () { - require("zlib").should.be.an.Object(); + expect(require("zlib")).toBeInstanceOf(Object); }); it("should provide a shim for a path in a build-in module", function () { - require("process/in.js").should.be.eql("in process"); + expect(require("process/in.js")).toBe("in process"); }); diff --git a/test/configCases/web/prefetch-preload/index.js b/test/configCases/web/prefetch-preload/index.js index 699196b32..b13b675f9 100644 --- a/test/configCases/web/prefetch-preload/index.js +++ b/test/configCases/web/prefetch-preload/index.js @@ -1,4 +1,3 @@ -const should = require("should"); const FakeDocument = require("../../../helpers/FakeDocument"); let oldNonce; @@ -7,53 +6,56 @@ let oldPublicPath; beforeEach(() => { oldNonce = __webpack_nonce__; oldPublicPath = __webpack_public_path__; - global.document = new FakeDocument(); + global.document = new FakeDocument(undefined, false); + global.window = {}; global.location = {origin: "https://example.com"}; }); afterEach(() => { delete global.document; + delete global.window; delete global.location; __webpack_nonce__ = oldNonce; __webpack_public_path__ = oldPublicPath; }) -it("should prefetch and preload child chunks on chunk load", () => { +it("should prefetch and preload child chunks on chunk load", (done) => { __webpack_nonce__ = "nonce"; __webpack_public_path__ = "/public/path/"; const promise = import(/* webpackChunkName: "chunk1" */ "./chunk1"); - document.head._children.length.should.be.eql(2); + expect(document.head._children).toHaveLength(2); const script = document.head._children[0]; - script._type.should.be.eql("script"); - should(script.src).be.eql("/public/path/chunk1.js") - should(script.getAttribute("nonce")).be.eql("nonce") - should(script.crossOrigin).be.eql("anonymous"); - should(script.onload).be.type("function"); + expect(script._type).toBe("script"); + expect(script.src).toBe("/public/path/chunk1.js") + expect(script.getAttribute("nonce")).toBe("nonce") + expect(script.crossOrigin).toBe("anonymous"); + expect(script.onload).toBeTypeOf("function"); let link = document.head._children[1]; - link._type.should.be.eql("link"); - should(link.rel).be.eql("preload"); - should(link.as).be.eql("script"); - should(link.href).be.eql("/public/path/chunk1-b.js"); - should(link.charset).be.eql("utf-8"); - should(link.getAttribute("nonce")).be.eql("nonce"); - should(link.crossOrigin).be.eql("anonymous"); + expect(link._type).toBe("link"); + expect(link.rel).toBe("preload"); + expect(link.as).toBe("script"); + expect(link.href).toBe("/public/path/chunk1-b.js"); + expect(link.charset).toBe("utf-8"); + expect(link.getAttribute("nonce")).toBe("nonce"); + expect(link.crossOrigin).toBe("anonymous"); __non_webpack_require__("./chunk1.js"); script.onload(); return promise.then((ex) => { - document.head._children.length.should.be.eql(4); + expect(document.head._children).toHaveLength(4); let link = document.head._children[2]; - link._type.should.be.eql("link"); - should(link.rel).be.eql("prefetch"); - should(link.href).be.eql("/public/path/chunk1-c.js"); + expect(link._type).toBe("link"); + expect(link.rel).toBe("prefetch"); + expect(link.href).toBe("/public/path/chunk1-c.js"); link = document.head._children[3]; - link._type.should.be.eql("link"); - should(link.rel).be.eql("prefetch"); - should(link.href).be.eql("/public/path/chunk1-a.js"); - }); + expect(link._type).toBe("link"); + expect(link.rel).toBe("prefetch"); + expect(link.href).toBe("/public/path/chunk1-a.js"); + done(); + }, done); }) diff --git a/test/formatLocation.unittest.js b/test/formatLocation.unittest.js index 5cebdb405..1d4f64b61 100644 --- a/test/formatLocation.unittest.js +++ b/test/formatLocation.unittest.js @@ -1,6 +1,5 @@ "use strict"; -require("should"); const formatLocation = require("../lib/formatLocation"); describe("formatLocation", () => { @@ -102,7 +101,7 @@ describe("formatLocation", () => { ]; testCases.forEach(testCase => { it(`should format location correctly for ${testCase.name}`, () => { - formatLocation(testCase.loc).should.be.eql(testCase.result); + expect(formatLocation(testCase.loc)).toEqual(testCase.result); }); }); }); diff --git a/test/helpers/FakeDocument.js b/test/helpers/FakeDocument.js index 0c9d80de0..774cbb409 100644 --- a/test/helpers/FakeDocument.js +++ b/test/helpers/FakeDocument.js @@ -16,8 +16,9 @@ module.exports = class FakeDocument { }; class FakeElement { - constructor(type) { + constructor(type, autoload = true) { this._type = type; + this._autoload = autoload; this._children = []; this._attributes = Object.create(null); } @@ -33,4 +34,33 @@ class FakeElement { getAttribute(name) { return this._attributes[name]; } + + get onload() { + return this._onload; + } + + set onload(script) { + if (this._autoload === true && typeof script === "function") { + script(); + } + this._onload = script; + } + + get src() { + return this._src; + } + + set src(src) { + // eslint-disable-next-line no-undef + const publicPath = __webpack_public_path__; + eval(` + const path = require('path'); + const fs = require('fs'); + const content = fs.readFileSync( + path.join(__dirname, '${src}'.replace('${publicPath}', '')), "utf-8" + ) + eval(content); + `); + this._src = src; + } } diff --git a/test/helpers/remove.js b/test/helpers/remove.js new file mode 100644 index 000000000..747e9302d --- /dev/null +++ b/test/helpers/remove.js @@ -0,0 +1,13 @@ +module.exports.remove = function remove(src) { + if (!fs.existsSync(src)) return; + const files = fs.readdirSync(src); + files.forEach(filename => { + const srcFile = path.join(src, filename); + const directory = fs.statSync(srcFile).isDirectory(); + if (directory) { + remove(srcFile); + } else { + fs.unlinkSync(srcFile); + } + }); +} diff --git a/test/hotCases/chunks/accept-system-import/index.js b/test/hotCases/chunks/accept-system-import/index.js index b9df9862d..33bdc93b4 100644 --- a/test/hotCases/chunks/accept-system-import/index.js +++ b/test/hotCases/chunks/accept-system-import/index.js @@ -1,14 +1,14 @@ -it("should import a changed chunk", function(done) { - import("./chunk").then(function(chunk) { - chunk.value.should.be.eql(1); - import("./chunk2").then(function(chunk2) { - chunk2.value.should.be.eql(1); +it("should import a changed chunk", (done) => { + import("./chunk").then((chunk) => { + expect(chunk.value).toBe(1); + import("./chunk2").then((chunk2) => { + expect(chunk2.value).toBe(1); NEXT(require("../../update")(done)); - module.hot.accept(["./chunk", "./chunk2"], function() { - import("./chunk").then(function(chunk) { - chunk.value.should.be.eql(2); - import("./chunk2").then(function(chunk2) { - chunk2.value.should.be.eql(2); + module.hot.accept(["./chunk", "./chunk2"], () => { + import("./chunk").then((chunk) => { + expect(chunk.value).toBe(2); + import("./chunk2").then((chunk2) => { + expect(chunk2.value).toBe(2); done(); }).catch(done); }).catch(done); diff --git a/test/hotCases/chunks/dynamic-system-import/index.js b/test/hotCases/chunks/dynamic-system-import/index.js index 156938628..49ffb8215 100644 --- a/test/hotCases/chunks/dynamic-system-import/index.js +++ b/test/hotCases/chunks/dynamic-system-import/index.js @@ -2,12 +2,12 @@ it("should import a changed chunk (dynamic import)", function(done) { function load(name) { return import("./chunk" + name); } - load(1).then(function(chunk) { - chunk.value.should.be.eql(1); - NEXT(require("../../update")(done, true, function() { - chunk.value.should.be.eql(2); - load(2).then(function(chunk2) { - chunk2.value.should.be.eql(2); + load(1).then((chunk) => { + expect(chunk.value).toBe(1); + NEXT(require("../../update")(done, true, () => { + expect(chunk.value).toBe(2); + load(2).then((chunk2) => { + expect(chunk2.value).toBe(2); done(); }).catch(done); })); diff --git a/test/hotCases/chunks/system-import/index.js b/test/hotCases/chunks/system-import/index.js index 0a0d40038..707a554fc 100644 --- a/test/hotCases/chunks/system-import/index.js +++ b/test/hotCases/chunks/system-import/index.js @@ -1,16 +1,16 @@ -it("should import a changed chunk", function(done) { - import("./chunk").then(function(chunk) { - chunk.value.should.be.eql(1); - chunk.value2.should.be.eql(3); - chunk.counter.should.be.eql(0); - NEXT(require("../../update")(done, true, function() { - chunk.value.should.be.eql(2); - chunk.value2.should.be.eql(4); - chunk.counter.should.be.eql(1); +it("should import a changed chunk", (done) => { + import("./chunk").then((chunk) => { + expect(chunk.value).toBe(1); + expect(chunk.value2).toBe(3); + expect(chunk.counter).toBe(0); + NEXT(require("../../update")(done, true, () => { + expect(chunk.value).toBe(2); + expect(chunk.value2).toBe(4); + expect(chunk.counter).toBe(1); import("./chunk2").then(function(chunk2) { - chunk2.value.should.be.eql(2); - chunk2.value2.should.be.eql(4); - chunk2.counter.should.be.eql(0); + expect(chunk2.value).toBe(2); + expect(chunk2.value2).toBe(4); + expect(chunk2.counter).toBe(0); done(); }).catch(done); })); diff --git a/test/hotCases/concat/reload-compat-flag/index.js b/test/hotCases/concat/reload-compat-flag/index.js index 7f36344a7..f37f4de79 100644 --- a/test/hotCases/concat/reload-compat-flag/index.js +++ b/test/hotCases/concat/reload-compat-flag/index.js @@ -1,15 +1,13 @@ var x = require("./module"); -it("should allow to hot replace modules in a ConcatenatedModule", function(done) { - x.should.be.eql({ - default: "ok1", - __esModule: true +it("should allow to hot replace modules in a ConcatenatedModule", (done) => { + expect(x).toEqual({ + default: "ok1" }); - module.hot.accept("./module", function() { + module.hot.accept("./module", () => { x = require("./module"); - x.should.be.eql({ - default: "ok2", - __esModule: true + expect(x).toEqual({ + default: "ok2" }); done(); }); diff --git a/test/hotCases/concat/reload-external/module.js b/test/hotCases/concat/reload-external/module.js index e24ad7de7..c77601225 100644 --- a/test/hotCases/concat/reload-external/module.js +++ b/test/hotCases/concat/reload-external/module.js @@ -1,15 +1,15 @@ import value1 from "./a"; import value2 from "./b"; -it("should allow to hot replace modules in a ConcatenatedModule", function(done) { - value1.should.be.eql(1); - value2.should.be.eql(10); - module.hot.accept("./a", function() { - value1.should.be.eql(2); +it("should allow to hot replace modules in a ConcatenatedModule", (done) => { + expect(value1).toBe(1); + expect(value2).toBe(10); + module.hot.accept("./a", () => { + expect(value1).toBe(2); NEXT(require("../../update")(done)); }); - module.hot.accept("./b", function() { - value2.should.be.eql(20); + module.hot.accept("./b", () => { + expect(value2).toBe(20); done(); }); NEXT(require("../../update")(done)); diff --git a/test/hotCases/define/issue-6962/module.js b/test/hotCases/define/issue-6962/module.js index ee5dfe5eb..542fc4de4 100644 --- a/test/hotCases/define/issue-6962/module.js +++ b/test/hotCases/define/issue-6962/module.js @@ -1,12 +1,12 @@ import value1 from "./a"; it("should have the expected static path defined", function() { - DEFINE_PATH.should.be.eql('./a'); + expect(DEFINE_PATH).toBe('./a'); }); it("should hot.accept the module located at the static file path without breaking the compiler", function() { module.hot.accept("./a"); - value1.should.be.eql(1); + expect(value1).toBe(1); }); it("should hot.accept the module located at the defined file path without breaking the compiler, when one argument is passed to hot.accept", function() { diff --git a/test/hotCases/errors/decline/index.js b/test/hotCases/errors/decline/index.js index 8b6f79bcc..e7b844a0a 100644 --- a/test/hotCases/errors/decline/index.js +++ b/test/hotCases/errors/decline/index.js @@ -1,11 +1,14 @@ import a from "./a"; -it("should abort when module is declined by parent", function(done) { - a.should.be.eql(1); - NEXT(require("../../update")(function(err) { +it("should abort when module is declined by parent", (done) => { + expect(a).toBe(1); + NEXT(require("../../update")((err) => { try { - err.message.should.match(/Aborted because of declined dependency: \.\/b\.js in \.\/a\.js\nUpdate propagation: \.\/c\.js -> \.\/b\.js -> \.\/a\.js/); + expect(/Aborted because of declined dependency: \.\/b\.js in \.\/a\.js/.test(err.message)).toBe(true); + expect(/Update propagation: \.\/c\.js -> \.\/b\.js -> \.\/a\.js/.test(err.message)).toBe(true); done(); - } catch(e) { done(e); } + } catch(e) { + done(e); + } })); }); diff --git a/test/hotCases/errors/events/index.js b/test/hotCases/errors/events/index.js index 388066912..d28545594 100644 --- a/test/hotCases/errors/events/index.js +++ b/test/hotCases/errors/events/index.js @@ -5,28 +5,30 @@ import f from "./f"; import h from "./h"; import j from "./j"; -it("should fire the correct events", function(done) { +it("should fire the correct events", (done) => { var events = []; var options = { ignoreUnaccepted: true, ignoreDeclined: true, ignoreErrored: true, - onDeclined: function(data) { events.push(data); }, - onUnaccepted: function(data) { events.push(data); }, - onAccepted: function(data) { events.push(data); }, - onErrored: function(data) { events.push(data); } + onDeclined(data) { events.push(data); }, + onUnaccepted(data) { events.push(data); }, + onAccepted(data) { events.push(data); }, + onErrored(data) { events.push(data); } }; function waitForUpdate(fn) { - NEXT(require("../../update")(done, options, function() { + NEXT(require("../../update")(done, options, () => { try { fn(); - } catch(e) { done(e); } + } catch(e) { + done(e); + } })); } - waitForUpdate(function() { - events.should.be.eql([ + waitForUpdate(() => { + expect(events).toEqual([ { type: "unaccepted", moduleId: "./index.js", diff --git a/test/hotCases/errors/self-decline/index.js b/test/hotCases/errors/self-decline/index.js index fb93936a5..b5814ee08 100644 --- a/test/hotCases/errors/self-decline/index.js +++ b/test/hotCases/errors/self-decline/index.js @@ -1,11 +1,14 @@ import a from "./a"; -it("should abort when module is declined by itself", function(done) { - a.should.be.eql(1); - NEXT(require("../../update")(function(err) { +it("should abort when module is declined by itself", (done) => { + expect(a).toBe(1); + NEXT(require("../../update")((err) => { try { - err.message.should.match(/Aborted because of self decline: \.\/a\.js\nUpdate propagation: \.\/c\.js -> \.\/b\.js -> \.\/a\.js/); + expect(/Aborted because of self decline: \.\/a\.js/.test(err.message)).toBe(true); + expect(/Update propagation: \.\/c\.js -> \.\/b\.js -> \.\/a\.js/.test(err.message)).toBe(true); done(); - } catch(e) { done(e); } + } catch(e) { + done(e); + } })); }); diff --git a/test/hotCases/errors/unaccepted-ignored/index.js b/test/hotCases/errors/unaccepted-ignored/index.js index d20b4b65e..05cc280c1 100644 --- a/test/hotCases/errors/unaccepted-ignored/index.js +++ b/test/hotCases/errors/unaccepted-ignored/index.js @@ -3,22 +3,22 @@ import get from "./b"; var options = { ignoreUnaccepted: true }; -it("should ignore unaccepted module updates", function(done) { +it("should ignore unaccepted module updates", (done) => { function waitForUpdate(fn) { NEXT(require("../../update")(done, options, fn)); } - a.should.be.eql(2); - get().should.be.eql(1); - waitForUpdate(function() { - a.should.be.eql(2); - get().should.be.eql(1); - waitForUpdate(function() { - a.should.be.eql(2); - get().should.be.eql(2); - waitForUpdate(function() { - a.should.be.eql(2); - get().should.be.eql(3); + expect(a).toBe(2); + expect(get()).toBe(1); + waitForUpdate(() => { + expect(a).toBe(2); + expect(get()).toBe(1); + waitForUpdate(() => { + expect(a).toBe(2); + expect(get()).toBe(2); + waitForUpdate(() => { + expect(a).toBe(2); + expect(get()).toBe(3); done(); }); }); diff --git a/test/hotCases/errors/unaccepted/index.js b/test/hotCases/errors/unaccepted/index.js index 359ec5c64..5409a58f7 100644 --- a/test/hotCases/errors/unaccepted/index.js +++ b/test/hotCases/errors/unaccepted/index.js @@ -1,12 +1,13 @@ import a from "./a"; import b from "./b"; -it("should abort when module is not accepted", function(done) { - a.should.be.eql(2); - b.should.be.eql(1); - NEXT(require("../../update")(function(err) { +it("should abort when module is not accepted", (done) => { + expect(a).toBe(2); + expect(b).toBe(1); + NEXT(require("../../update")((err) => { try { - err.message.should.match(/Aborted because \.\/c\.js is not accepted\nUpdate propagation: \.\/c\.js -> \.\/b\.js -> \.\/index\.js/); + expect(/Aborted because \.\/c\.js is not accepted/.test(err.message)).toBe(true); + expect(/Update propagation: \.\/c\.js -> \.\/b\.js -> \.\/index\.js/.test(err.message)).toBe(true); done(); } catch(e) { done(e); } })); diff --git a/test/hotCases/harmony/auto-import-default/index.js b/test/hotCases/harmony/auto-import-default/index.js index 53a4b6fe0..976b95a7f 100644 --- a/test/hotCases/harmony/auto-import-default/index.js +++ b/test/hotCases/harmony/auto-import-default/index.js @@ -1,9 +1,9 @@ import value from "./file"; -it("should auto-import a ES6 imported default value from non-harmony module on accept", function(done) { - value.should.be.eql(1); - module.hot.accept("./file", function() { - value.should.be.eql(2); +it("should auto-import a ES6 imported default value from non-harmony module on accept", (done) => { + expect(value).toBe(1); + module.hot.accept("./file", () => { + expect(value).toBe(2); outside(); done(); }); @@ -11,5 +11,5 @@ it("should auto-import a ES6 imported default value from non-harmony module on a }); function outside() { - value.should.be.eql(2); + expect(value).toBe(2); } diff --git a/test/hotCases/harmony/auto-import-default/out/bundle.js b/test/hotCases/harmony/auto-import-default/out/bundle.js index c99f1b02b..4c9559bdc 100644 --- a/test/hotCases/harmony/auto-import-default/out/bundle.js +++ b/test/hotCases/harmony/auto-import-default/out/bundle.js @@ -765,9 +765,9 @@ throw new Error("Module parse failed: Unexpected token (3:0)\nYou may need an ap it("should auto-import a ES6 imported value on accept", function(done) { - _file__WEBPACK_IMPORTED_MODULE_0__["value"].should.be.eql(1); + expect(_file__WEBPACK_IMPORTED_MODULE_0__["value"]).toEqual(1); module.hot.accept(/*! ./file */ "./file.js", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ _file__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./file */"./file.js"); /* harmony import */ _file__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_file__WEBPACK_IMPORTED_MODULE_0__); (function() { - _file__WEBPACK_IMPORTED_MODULE_0__["value"].should.be.eql(2); + expect(_file__WEBPACK_IMPORTED_MODULE_0__["value"]).toEqual(2); outside(); done(); })(__WEBPACK_OUTDATED_DEPENDENCIES__); }); @@ -775,7 +775,7 @@ it("should auto-import a ES6 imported value on accept", function(done) { }); function outside() { - _file__WEBPACK_IMPORTED_MODULE_0__["value"].should.be.eql(2); + expect(_file__WEBPACK_IMPORTED_MODULE_0__["value"]).toEqual(2); } diff --git a/test/hotCases/harmony/auto-import-multiple/index.js b/test/hotCases/harmony/auto-import-multiple/index.js index 6af674353..d947a9296 100644 --- a/test/hotCases/harmony/auto-import-multiple/index.js +++ b/test/hotCases/harmony/auto-import-multiple/index.js @@ -1,12 +1,12 @@ import { value } from "./file"; import value2 from "./commonjs"; -it("should auto-import multiple ES6 imported values on accept", function(done) { - value.should.be.eql(1); - value2.should.be.eql(10); - module.hot.accept(["./file", "./commonjs"], function() { - value.should.be.eql(2); - value2.should.be.eql(20); +it("should auto-import multiple ES6 imported values on accept", (done) => { + expect(value).toBe(1); + expect(value2).toBe(10); + module.hot.accept(["./file", "./commonjs"], () => { + expect(value).toBe(2); + expect(value2).toBe(20); outside(); done(); }); @@ -14,6 +14,6 @@ it("should auto-import multiple ES6 imported values on accept", function(done) { }); function outside() { - value.should.be.eql(2); - value2.should.be.eql(20); + expect(value).toBe(2); + expect(value2).toBe(20); } diff --git a/test/hotCases/harmony/auto-import/index.js b/test/hotCases/harmony/auto-import/index.js index f7a7049f1..cd36482c2 100644 --- a/test/hotCases/harmony/auto-import/index.js +++ b/test/hotCases/harmony/auto-import/index.js @@ -1,9 +1,9 @@ import { value } from "./file"; it("should auto-import a ES6 imported value on accept", function(done) { - value.should.be.eql(1); + expect(value).toBe(1); module.hot.accept("./file", function() { - value.should.be.eql(2); + expect(value).toBe(2); outside(); done(); }); @@ -11,5 +11,5 @@ it("should auto-import a ES6 imported value on accept", function(done) { }); function outside() { - value.should.be.eql(2); + expect(value).toBe(2); } diff --git a/test/hotCases/recover/recover-after-error/index.js b/test/hotCases/recover/recover-after-error/index.js index f57c89af4..2b3b02876 100644 --- a/test/hotCases/recover/recover-after-error/index.js +++ b/test/hotCases/recover/recover-after-error/index.js @@ -1,15 +1,15 @@ import a from "./a"; -it("should abort when module is not accepted", function(done) { - a.should.be.eql(1); +it("should abort when module is not accepted", (done) => { + expect(a).toBe(1); NEXT(require("../../update")(done, { ignoreErrored: true - }, function() { - a.should.be.eql(1); + }, () => { + expect(a).toBe(1); NEXT(require("../../update")(done, { ignoreErrored: true - }, function() { - a.should.be.eql(3); + }, () => { + expect(a).toBe(3); done(); })); })); diff --git a/test/hotCases/recover/recover-after-loader-error/index.js b/test/hotCases/recover/recover-after-loader-error/index.js index 186b26ef4..babc2a497 100644 --- a/test/hotCases/recover/recover-after-loader-error/index.js +++ b/test/hotCases/recover/recover-after-loader-error/index.js @@ -1,15 +1,15 @@ import a from "./loader!./a"; -it("should abort when module is not accepted", function(done) { - a.should.be.eql(1); +it("should abort when module is not accepted", (done) => { + expect(a).toBe(1); NEXT(require("../../update")(done, { ignoreErrored: true - }, function() { - a.should.be.eql(1); + }, () => { + expect(a).toBe(1); NEXT(require("../../update")(done, { ignoreErrored: true }, function() { - a.should.be.eql(3); + expect(a).toBe(3); done(); })); })); diff --git a/test/hotCases/recover/recover-after-parsing-error/index.js b/test/hotCases/recover/recover-after-parsing-error/index.js index f57c89af4..2b3b02876 100644 --- a/test/hotCases/recover/recover-after-parsing-error/index.js +++ b/test/hotCases/recover/recover-after-parsing-error/index.js @@ -1,15 +1,15 @@ import a from "./a"; -it("should abort when module is not accepted", function(done) { - a.should.be.eql(1); +it("should abort when module is not accepted", (done) => { + expect(a).toBe(1); NEXT(require("../../update")(done, { ignoreErrored: true - }, function() { - a.should.be.eql(1); + }, () => { + expect(a).toBe(1); NEXT(require("../../update")(done, { ignoreErrored: true - }, function() { - a.should.be.eql(3); + }, () => { + expect(a).toBe(3); done(); })); })); diff --git a/test/hotCases/runtime/accept/index.js b/test/hotCases/runtime/accept/index.js index 3c4f3dd2b..9ecba8cdc 100644 --- a/test/hotCases/runtime/accept/index.js +++ b/test/hotCases/runtime/accept/index.js @@ -1,10 +1,10 @@ var value = require("./file"); -it("should accept a dependencies and require a new value", function(done) { - value.should.be.eql(1); - module.hot.accept("./file", function() { +it("should accept a dependencies and require a new value", (done) => { + expect(value).toBe(1); + module.hot.accept("./file", () => { value = require("./file"); - value.should.be.eql(2); + expect(value).toBe(2); outside(); done(); }); @@ -12,5 +12,5 @@ it("should accept a dependencies and require a new value", function(done) { }); function outside() { - value.should.be.eql(2); + expect(value).toBe(2); } diff --git a/test/hotCases/runtime/bubble-update/index.js b/test/hotCases/runtime/bubble-update/index.js index 355baef0d..7827b0753 100644 --- a/test/hotCases/runtime/bubble-update/index.js +++ b/test/hotCases/runtime/bubble-update/index.js @@ -1,10 +1,10 @@ var value = require("./parent-file"); -it("should bubble update from a nested dependency", function(done) { - value.should.be.eql(1); - module.hot.accept("./parent-file", function() { +it("should bubble update from a nested dependency", (done) => { + expect(value).toBe(1); + module.hot.accept("./parent-file", () => { value = require("./parent-file"); - value.should.be.eql(2); + expect(value).toBe(2); done(); }); NEXT(require("../../update")(done)); diff --git a/test/hotCases/runtime/circular/index.js b/test/hotCases/runtime/circular/index.js index 84af64ba8..0d4655d3e 100644 --- a/test/hotCases/runtime/circular/index.js +++ b/test/hotCases/runtime/circular/index.js @@ -1,9 +1,9 @@ import a from "./a"; -it("should not throw on circular dependencies", function(done) { - a.should.be.eql(1); - module.hot.accept("./a", function() { - a.should.be.eql(2); +it("should not throw on circular dependencies", (done) => { + expect(a).toBe(1); + module.hot.accept("./a", () => { + expect(a).toBe(2); done(); }); NEXT(require("../../update")(done)); diff --git a/test/hotCases/runtime/dispose-removed-chunk/index.js b/test/hotCases/runtime/dispose-removed-chunk/index.js index 155c49182..c73676af4 100644 --- a/test/hotCases/runtime/dispose-removed-chunk/index.js +++ b/test/hotCases/runtime/dispose-removed-chunk/index.js @@ -1,13 +1,13 @@ -it("should dispose a chunk which is removed from bundle", function(done) { +it("should dispose a chunk which is removed from bundle", (done) => { var m1 = require("./module"); m1.default.then((x1) => { - NEXT(require("../../update")(done, true, function() { + NEXT(require("../../update")(done, true, () => { var m2 = require("./module"); m2.default.then((x2) => { - NEXT(require("../../update")(done, true, function() { + NEXT(require("../../update")(done, true, () => { var m3 = require("./module"); m3.default.then((x3) => { - x1.should.be.not.eql(x2); + expect(x1).not.toEqual(x2); done(); }).catch(done); })); diff --git a/test/hotCases/runtime/dispose-removed-module/index.js b/test/hotCases/runtime/dispose-removed-module/index.js index bd3da8723..0a86e0211 100644 --- a/test/hotCases/runtime/dispose-removed-module/index.js +++ b/test/hotCases/runtime/dispose-removed-module/index.js @@ -1,15 +1,15 @@ var m = require("./module"); -it("should dispose a module which is removed from bundle", function(done) { +it("should dispose a module which is removed from bundle", (done) => { var disposed = []; - m.setHandler(function(id) { + m.setHandler((id) => { disposed.push(id); }); - NEXT(require("../../update")(done, true, function() { + NEXT(require("../../update")(done, true, () => { require("./module"); - NEXT(require("../../update")(done, true, function() { + NEXT(require("../../update")(done, true, () => { var newModule = require("./module"); - disposed.should.be.eql([newModule.default]); + expect(disposed).toEqual([newModule.default]); done(); })); })); diff --git a/test/hotCases/runtime/self-accept-and-dispose/index.js b/test/hotCases/runtime/self-accept-and-dispose/index.js index b94303d21..510388c95 100644 --- a/test/hotCases/runtime/self-accept-and-dispose/index.js +++ b/test/hotCases/runtime/self-accept-and-dispose/index.js @@ -1,4 +1,4 @@ -it("should accept itself and pass data", function(done) { +it("should accept itself and pass data", (done) => { require("./file")(done); NEXT(require("../../update")(done)); }); diff --git a/test/hotCases/runtime/update-multiple-modules/index.js b/test/hotCases/runtime/update-multiple-modules/index.js index 65e98e3e4..9ac1450a9 100644 --- a/test/hotCases/runtime/update-multiple-modules/index.js +++ b/test/hotCases/runtime/update-multiple-modules/index.js @@ -1,10 +1,10 @@ var value = require("./parent-file"); -it("should update multiple modules at the same time", function(done) { - value.should.be.eql(2); - module.hot.accept("./parent-file", function() { +it("should update multiple modules at the same time", (done) => { + expect(value).toBe(2); + module.hot.accept("./parent-file", () => { value = require("./parent-file"); - value.should.be.eql(4); + expect(value).toBe(4); done(); }); NEXT(require("../../update")(done)); diff --git a/test/hotCases/runtime/update-multiple-times/index.js b/test/hotCases/runtime/update-multiple-times/index.js index e2a8b9e7b..937492631 100644 --- a/test/hotCases/runtime/update-multiple-times/index.js +++ b/test/hotCases/runtime/update-multiple-times/index.js @@ -1,11 +1,11 @@ var value = require("./file"); -it("should accept a dependencies multiple times", function(done) { - value.should.be.eql(1); - module.hot.accept("./file", function() { +it("should accept a dependencies multiple times", (done) => { + expect(value).toBe(1); + module.hot.accept("./file", () => { var oldValue = value; value = require("./file"); - value.should.be.eql(oldValue + 1); + expect(value).toBe(oldValue + 1); if(value < 4) NEXT(require("../../update")(done)); else diff --git a/test/hotCases/update.js b/test/hotCases/update.js index fd30ee103..e85933acc 100644 --- a/test/hotCases/update.js +++ b/test/hotCases/update.js @@ -1,9 +1,9 @@ module.exports = function(done, options, callback) { return function(stats) { - module.hot.check(options || true).then(function() { + module.hot.check(options || true).then(() => { if(callback) callback(stats); - }).catch(function(err) { + }).catch((err) => { done(err); }); } diff --git a/test/identifier.unittest.js b/test/identifier.unittest.js index 4ef2fc33b..19a2990d9 100644 --- a/test/identifier.unittest.js +++ b/test/identifier.unittest.js @@ -1,8 +1,6 @@ /* globals describe, beforeEach, it */ "use strict"; -const should = require("should"); - const identifierUtil = require("../lib/util/identifier"); describe("util/identifier", () => { @@ -16,9 +14,9 @@ describe("util/identifier", () => { }); it("computes the correct relative results for the path construct", () => { - should( - identifierUtil.makePathsRelative(context, pathConstruct) - ).be.exactly(expected); + expect(identifierUtil.makePathsRelative(context, pathConstruct)).toBe( + expected + ); }); }); }); diff --git a/test/lint-mocha.opts b/test/lint-mocha.opts deleted file mode 100644 index 84fc1681a..000000000 --- a/test/lint-mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---reporter min diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index f3d5690d4..000000000 --- a/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---full-trace ---reporter dot ---check-leaks ---globals Base64 diff --git a/test/objectToMap.unittest.js b/test/objectToMap.unittest.js index c0f1aff7b..3b8f70e8b 100644 --- a/test/objectToMap.unittest.js +++ b/test/objectToMap.unittest.js @@ -1,17 +1,15 @@ /* globals describe it */ -require("should"); - var objectToMap = require("../lib/util/objectToMap"); -describe("objectToMap", function() { - it("should convert a plain object into a Map successfully", function() { +describe("objectToMap", () => { + it("should convert a plain object into a Map successfully", () => { const map = objectToMap({ foo: "bar", bar: "baz" }); - map.get("foo").should.eql("bar"); - map.get("bar").should.eql("baz"); + expect(map.get("foo")).toBe("bar"); + expect(map.get("bar")).toBe("baz"); }); }); diff --git a/test/setupTestFramework.js b/test/setupTestFramework.js new file mode 100644 index 000000000..b6c1a049d --- /dev/null +++ b/test/setupTestFramework.js @@ -0,0 +1,25 @@ +/* globals expect */ +expect.extend({ + toBeTypeOf(received, expected) { + const objType = typeof received; + const pass = objType === expected; + + const message = pass + ? () => + this.utils.matcherHint(".not.toBeTypeOf") + + "\n\n" + + "Expected value to not be (using typeof):\n" + + ` ${this.utils.printExpected(expected)}\n` + + "Received:\n" + + ` ${this.utils.printReceived(objType)}` + : () => + this.utils.matcherHint(".toBeTypeOf") + + "\n\n" + + "Expected value to be (using typeof):\n" + + ` ${this.utils.printExpected(expected)}\n` + + "Received:\n" + + ` ${this.utils.printReceived(objType)}`; + + return { message, pass }; + } +}); diff --git a/test/statsCases/aggressive-splitting-entry/expected.txt b/test/statsCases/aggressive-splitting-entry/expected.txt deleted file mode 100644 index 8f046830f..000000000 --- a/test/statsCases/aggressive-splitting-entry/expected.txt +++ /dev/null @@ -1,53 +0,0 @@ -Hash: e3ba3c1dddc97b92dbf7e3ba3c1dddc97b92dbf7 -Child fitting: - Hash: e3ba3c1dddc97b92dbf7 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - fb95acf7c457672e70d0.js 1.05 KiB 0 [emitted] - 2795fd99577b4ba7fef2.js 10.2 KiB 1 [emitted] - d43339a3d0f86c6b8d90.js 1.94 KiB 2 [emitted] - 6c7fb52c5514dbfbf094.js 1.94 KiB 3 [emitted] - Entrypoint main = d43339a3d0f86c6b8d90.js 6c7fb52c5514dbfbf094.js 2795fd99577b4ba7fef2.js - chunk {0} fb95acf7c457672e70d0.js 916 bytes <{1}> <{2}> <{3}> - > ./g [4] ./index.js 7:0-13 - [7] ./g.js 916 bytes {0} [built] - chunk {1} 2795fd99577b4ba7fef2.js 1.87 KiB ={2}= ={3}= >{0}< [entry] [rendered] - > ./index main - [3] ./e.js 899 bytes {1} [built] - [4] ./index.js 111 bytes {1} [built] - [6] ./f.js 900 bytes {1} [built] - chunk {2} d43339a3d0f86c6b8d90.js 1.76 KiB ={1}= ={3}= >{0}< [initial] [rendered] [recorded] aggressive splitted - > ./index main - [0] ./b.js 899 bytes {2} [built] - [5] ./a.js 899 bytes {2} [built] - chunk {3} 6c7fb52c5514dbfbf094.js 1.76 KiB ={1}= ={2}= >{0}< [initial] [rendered] [recorded] aggressive splitted - > ./index main - [1] ./c.js 899 bytes {3} [built] - [2] ./d.js 899 bytes {3} [built] -Child content-change: - Hash: e3ba3c1dddc97b92dbf7 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - fb95acf7c457672e70d0.js 1.05 KiB 0 [emitted] - 2795fd99577b4ba7fef2.js 10.2 KiB 1 [emitted] - d43339a3d0f86c6b8d90.js 1.94 KiB 2 [emitted] - 6c7fb52c5514dbfbf094.js 1.94 KiB 3 [emitted] - Entrypoint main = d43339a3d0f86c6b8d90.js 6c7fb52c5514dbfbf094.js 2795fd99577b4ba7fef2.js - chunk {0} fb95acf7c457672e70d0.js 916 bytes <{1}> <{2}> <{3}> - > ./g [4] ./index.js 7:0-13 - [7] ./g.js 916 bytes {0} [built] - chunk {1} 2795fd99577b4ba7fef2.js 1.87 KiB ={2}= ={3}= >{0}< [entry] [rendered] - > ./index main - [3] ./e.js 899 bytes {1} [built] - [4] ./index.js 111 bytes {1} [built] - [6] ./f.js 900 bytes {1} [built] - chunk {2} d43339a3d0f86c6b8d90.js 1.76 KiB ={1}= ={3}= >{0}< [initial] [rendered] [recorded] aggressive splitted - > ./index main - [0] ./b.js 899 bytes {2} [built] - [5] ./a.js 899 bytes {2} [built] - chunk {3} 6c7fb52c5514dbfbf094.js 1.76 KiB ={1}= ={2}= >{0}< [initial] [rendered] [recorded] aggressive splitted - > ./index main - [1] ./c.js 899 bytes {3} [built] - [2] ./d.js 899 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/aggressive-splitting-on-demand/expected.txt b/test/statsCases/aggressive-splitting-on-demand/expected.txt deleted file mode 100644 index 2f3970dc4..000000000 --- a/test/statsCases/aggressive-splitting-on-demand/expected.txt +++ /dev/null @@ -1,65 +0,0 @@ -Hash: 0bbde62e97b9652dcaac -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -620d3f8d9bdb989cde07.js 1.94 KiB 6, 7 [emitted] -4467a9f70ef8365bcb32.js 1.93 KiB 0 [emitted] -8debdc7e72b763a13e35.js 1.96 KiB 2 [emitted] -6a2c2702ac98f9f90db9.js 1.94 KiB 3, 1 [emitted] -258ba4b441feff644266.js 1.01 KiB 4 [emitted] -8ae4998ca98adb2a08ea.js 1.94 KiB 5 [emitted] -aafb9d82e452def4c3bb.js 1 KiB 1 [emitted] -344e13508b62e833aacf.js 1 KiB 7 [emitted] -2aaed192bbfbc2302c53.js 1.94 KiB 8 [emitted] -72e04d4eaed46d9aac4c.js 1.94 KiB 9 [emitted] -d19dabec0d62bca26765.js 8.68 KiB 10 [emitted] main -1165c0cca1ba14a506ff.js 1.94 KiB 11 [emitted] -Entrypoint main = d19dabec0d62bca26765.js -chunk {0} 4467a9f70ef8365bcb32.js 1.76 KiB <{10}> ={1}= ={2}= ={3}= ={7}= ={9}= [recorded] aggressive splitted - > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 - > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 - [0] ./b.js 899 bytes {0} {5} [built] - [1] ./d.js 899 bytes {0} {8} [built] -chunk {1} aafb9d82e452def4c3bb.js 899 bytes <{10}> ={0}= ={2}= ={8}= - > ./c ./d ./e [11] ./index.js 3:0-30 - > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 - [2] ./e.js 899 bytes {1} {3} [built] -chunk {2} 8debdc7e72b763a13e35.js 1.76 KiB <{10}> ={0}= ={1}= ={11}= ={3}= ={6}= ={7}= ={9}= [recorded] aggressive splitted - > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 - > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 - > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 - [3] ./f.js 899 bytes {2} [built] - [4] ./g.js 901 bytes {2} [built] -chunk {3} 6a2c2702ac98f9f90db9.js 1.76 KiB <{10}> ={0}= ={2}= ={7}= ={9}= [rendered] [recorded] aggressive splitted - > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 - [2] ./e.js 899 bytes {1} {3} [built] - [6] ./h.js 899 bytes {3} {11} [built] -chunk {4} 258ba4b441feff644266.js 899 bytes <{10}> - > ./a [11] ./index.js 1:0-16 - [10] ./a.js 899 bytes {4} [built] -chunk {5} 8ae4998ca98adb2a08ea.js 1.76 KiB <{10}> - > ./b ./c [11] ./index.js 2:0-23 - [0] ./b.js 899 bytes {0} {5} [built] - [5] ./c.js 899 bytes {5} {8} [built] -chunk {6} 620d3f8d9bdb989cde07.js 1.76 KiB <{10}> ={11}= ={2}= - > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 - [8] ./j.js 901 bytes {6} {9} [built] - [9] ./k.js 899 bytes {6} {7} [built] -chunk {7} 344e13508b62e833aacf.js 899 bytes <{10}> ={0}= ={2}= ={3}= ={9}= - > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 - [9] ./k.js 899 bytes {6} {7} [built] -chunk {8} 2aaed192bbfbc2302c53.js 1.76 KiB <{10}> ={1}= [recorded] aggressive splitted - > ./c ./d ./e [11] ./index.js 3:0-30 - [1] ./d.js 899 bytes {0} {8} [built] - [5] ./c.js 899 bytes {5} {8} [built] -chunk {9} 72e04d4eaed46d9aac4c.js 1.76 KiB <{10}> ={0}= ={2}= ={3}= ={7}= [rendered] [recorded] aggressive splitted - > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 - [7] ./i.js 899 bytes {9} {11} [built] - [8] ./j.js 901 bytes {6} {9} [built] -chunk {10} d19dabec0d62bca26765.js (main) 248 bytes >{0}< >{1}< >{11}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< >{8}< >{9}< [entry] [rendered] - > ./index main - [11] ./index.js 248 bytes {10} [built] -chunk {11} 1165c0cca1ba14a506ff.js 1.76 KiB <{10}> ={2}= ={6}= [rendered] [recorded] aggressive splitted - > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 - [6] ./h.js 899 bytes {3} {11} [built] - [7] ./i.js 899 bytes {9} {11} [built] \ No newline at end of file diff --git a/test/statsCases/async-commons-chunk-auto/expected.txt b/test/statsCases/async-commons-chunk-auto/expected.txt deleted file mode 100644 index 5aea082f1..000000000 --- a/test/statsCases/async-commons-chunk-auto/expected.txt +++ /dev/null @@ -1,321 +0,0 @@ -Child disabled: - Entrypoint main = disabled/main.js - Entrypoint a = disabled/a.js - Entrypoint b = disabled/b.js - Entrypoint c = disabled/c.js - chunk {0} disabled/async-g.js (async-g) 54 bytes <{1}> <{5}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [8] ./g.js 34 bytes {0} [built] - chunk {1} disabled/async-a.js (async-a) 216 bytes <{4}> >{0}< [rendered] - > ./a [7] ./index.js 1:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [5] ./a.js + 1 modules 156 bytes {1} {5} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {2} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] - > ./b [7] ./index.js 2:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [4] ./b.js 72 bytes {2} {6} [built] - chunk {3} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] - > ./c [7] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [6] ./c.js + 1 modules 107 bytes {3} {7} [built] - | ./c.js 72 bytes [built] - | ./node_modules/z.js 20 bytes [built] - chunk {4} disabled/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] - > ./ main - [7] ./index.js 147 bytes {4} [built] - chunk {5} disabled/a.js (a) 216 bytes >{0}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [5] ./a.js + 1 modules 156 bytes {1} {5} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {6} disabled/b.js (b) 152 bytes [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [4] ./b.js 72 bytes {2} {6} [built] - chunk {7} disabled/c.js (c) 167 bytes [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [6] ./c.js + 1 modules 107 bytes {3} {7} [built] - | ./c.js 72 bytes [built] - | ./node_modules/z.js 20 bytes [built] -Child default: - Entrypoint main = default/main.js - Entrypoint a = default/a.js - Entrypoint b = default/b.js - Entrypoint c = default/c.js - chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {4} [built] - chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] - > ./a [8] ./index.js 1:0-47 - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [5] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] - > ./c [8] ./index.js 3:0-47 - [6] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) - > ./c [8] ./index.js 3:0-47 - [4] ./node_modules/z.js 20 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} default/b.js (b) 152 bytes [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [2] ./f.js 20 bytes {2} {11} {12} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [5] ./b.js 72 bytes {6} {11} [built] - chunk {12} default/c.js (c) 152 bytes [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [2] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./node_modules/z.js 20 bytes {8} {12} [built] - [6] ./c.js 72 bytes {7} {12} [built] -Child vendors: - Entrypoint main = vendors/main.js - Entrypoint a = vendors/vendors.js vendors/a.js - Entrypoint b = vendors/vendors.js vendors/b.js - Entrypoint c = vendors/vendors.js vendors/c.js - chunk {0} vendors/async-g.js (async-g) 54 bytes <{1}> <{4}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [9] ./g.js 34 bytes {0} [built] - chunk {1} vendors/async-a.js (async-a) 216 bytes <{5}> >{0}< [rendered] - > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [7] ./a.js + 1 modules 156 bytes {1} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {2} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] - > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [5] ./b.js 72 bytes {2} {7} [built] - chunk {3} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [4] ./node_modules/z.js 20 bytes {3} {4} [built] - [6] ./c.js 72 bytes {3} {8} [built] - chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{0}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) - > ./a a - > ./b b - > ./c c - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [4] ./node_modules/z.js 20 bytes {3} {4} [built] - chunk {5} vendors/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {5} [built] - chunk {6} vendors/a.js (a) 176 bytes ={4}= >{0}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {1} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {7} vendors/b.js (b) 112 bytes ={4}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [5] ./b.js 72 bytes {2} {7} [built] - chunk {8} vendors/c.js (c) 112 bytes ={4}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [6] ./c.js 72 bytes {3} {8} [built] -Child multiple-vendors: - Entrypoint main = multiple-vendors/main.js - Entrypoint a = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/a.js - Entrypoint b = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/b.js - Entrypoint c = multiple-vendors/libs-x.js multiple-vendors/vendors~async-c~c.js multiple-vendors/c.js - chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) - > ./a a - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} multiple-vendors/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} multiple-vendors/async-b~async-c~async-g~b~c.js (async-b~async-c~async-g~b~c) 20 bytes <{0}> <{1}> <{10}> <{3}> <{8}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={6}= ={7}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~b~c) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) - > ./a a - > ./b b - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) - > ./c c - > ./c [8] ./index.js 3:0-47 - [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{8}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {6} {11} [built] - chunk {7} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] - > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {7} {12} [built] - chunk {8} multiple-vendors/a~async-a.js (a~async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: a~async-a) - > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} multiple-vendors/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} multiple-vendors/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {6} {11} [built] - chunk {12} multiple-vendors/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {7} {12} [built] -Child all: - Entrypoint main = all/main.js - Entrypoint a = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/a.js - Entrypoint b = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/b.js - Entrypoint c = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~async-c~c.js all/c.js - chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) - > ./a a - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} all/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} all/async-b~async-c~async-g~b~c.js (async-b~async-c~async-g~b~c) 20 bytes <{0}> <{1}> <{10}> <{3}> <{8}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={6}= ={7}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~b~c) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) - > ./a a - > ./b b - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) - > ./c c - > ./c [8] ./index.js 3:0-47 - [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{8}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {6} {11} [built] - chunk {7} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] - > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {7} {12} [built] - chunk {8} all/a~async-a.js (a~async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: a~async-a) - > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} all/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} all/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {6} {11} [built] - chunk {12} all/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {7} {12} [built] \ No newline at end of file diff --git a/test/statsCases/async-commons-chunk/expected.txt b/test/statsCases/async-commons-chunk/expected.txt deleted file mode 100644 index bdbe8c27e..000000000 --- a/test/statsCases/async-commons-chunk/expected.txt +++ /dev/null @@ -1,15 +0,0 @@ -Entrypoint main = main.js -chunk {0} 0.js 21 bytes <{3}> [rendered] reused as split chunk (cache group: default) - > [3] ./index.js 2:1-5:3 - [0] ./a.js 21 bytes {0} {1} {2} [built] -chunk {1} 1.js 42 bytes <{3}> [rendered] - > ./a ./b [3] ./index.js 9:1-13:3 - [0] ./a.js 21 bytes {0} {1} {2} [built] - [1] ./b.js 21 bytes {1} [built] -chunk {2} 2.js 42 bytes <{3}> [rendered] - > [3] ./index.js 17:1-21:3 - [0] ./a.js 21 bytes {0} {1} {2} [built] - [2] ./c.js 21 bytes {2} [built] -chunk {3} main.js (main) 550 bytes >{0}< >{1}< >{2}< [entry] [rendered] - > ./ main - [3] ./index.js 550 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/async-commons-chunk/index.js b/test/statsCases/async-commons-chunk/index.js index 474da4c16..5953c6923 100644 --- a/test/statsCases/async-commons-chunk/index.js +++ b/test/statsCases/async-commons-chunk/index.js @@ -1,22 +1,22 @@ -it("should load the full async commons", function(done) { - require.ensure(["./a"], function(require) { - require("./a").should.be.eql("a"); +it("should load the full async commons", (done) => { + require.ensure(["./a"], (require) => { + expect(require("./a")).toBe("a"); done(); }); }); -it("should load a chunk with async commons (AMD)", function(done) { - require(["./a", "./b"], function(a, b) { - a.should.be.eql("a"); - b.should.be.eql("b"); +it("should load a chunk with async commons (AMD)", (done) => { + require(["./a", "./b"], (a, b) => { + expect(a).toBe("a"); + expect(b).toBe("b"); done(); }); }); -it("should load a chunk with async commons (require.ensure)", function(done) { - require.ensure([], function(require) { - require("./a").should.be.eql("a"); - require("./c").should.be.eql("c"); +it("should load a chunk with async commons (require.ensure)", (done) => { + require.ensure([], (require) => { + expect(require("./a")).toBe("a"); + expect(require("./c")).toBe("c"); done(); }); }); diff --git a/test/statsCases/chunk-module-id-range/expected.txt b/test/statsCases/chunk-module-id-range/expected.txt deleted file mode 100644 index a34fa06a6..000000000 --- a/test/statsCases/chunk-module-id-range/expected.txt +++ /dev/null @@ -1,22 +0,0 @@ -Hash: 27b68d27e07b42624dae -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main2.js 3.89 KiB 0 [emitted] main2 -main1.js 3.89 KiB 1 [emitted] main1 -Entrypoint main1 = main1.js -Entrypoint main2 = main2.js -chunk {0} main2.js (main2) 136 bytes [entry] [rendered] - > ./main2 main2 - [0] ./e.js 20 bytes {0} [built] - [1] ./f.js 20 bytes {0} [built] - [2] ./main2.js 56 bytes {0} [built] - [100] ./d.js 20 bytes {0} {1} [built] - [101] ./a.js 20 bytes {0} {1} [built] -chunk {1} main1.js (main1) 136 bytes [entry] [rendered] - > ./main1 main1 - [3] ./b.js 20 bytes {1} [built] - [4] ./main1.js 56 bytes {1} [built] - [100] ./d.js 20 bytes {0} {1} [built] - [101] ./a.js 20 bytes {0} {1} [built] - [102] ./c.js 20 bytes {1} [built] \ No newline at end of file diff --git a/test/statsCases/chunks-development/expected.txt b/test/statsCases/chunks-development/expected.txt deleted file mode 100644 index 615dd812a..000000000 --- a/test/statsCases/chunks-development/expected.txt +++ /dev/null @@ -1,36 +0,0 @@ -Hash: d8b40b77893587325329 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -0.bundle.js 433 bytes 0 [emitted] -1.bundle.js 297 bytes 1 [emitted] -2.bundle.js 588 bytes 2 [emitted] - bundle.js 7.65 KiB main [emitted] main -Entrypoint main = bundle.js -chunk {main} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] - > ./index main - [./a.js] 22 bytes {main} [built] - cjs require ./a [./index.js] 1:0-14 - cjs require ./a [./e.js] 1:0-14 - [./index.js] Xms -> factory:Xms building:Xms = Xms - [./index.js] 51 bytes {main} [built] - single entry ./index main - factory:Xms building:Xms = Xms -chunk {0} 0.bundle.js 54 bytes <{main}> >{2}< [rendered] - > ./c [./index.js] ./index.js 3:0-16 - [./c.js] 54 bytes {0} [built] - amd require ./c [./index.js] 3:0-16 - [./index.js] Xms -> factory:Xms building:Xms = Xms -chunk {1} 1.bundle.js 22 bytes <{main}> [rendered] - > ./b [./index.js] ./index.js 2:0-16 - [./b.js] 22 bytes {1} [built] - amd require ./b [./index.js] 2:0-16 - [./index.js] Xms -> factory:Xms building:Xms = Xms -chunk {2} 2.bundle.js 60 bytes <{0}> [rendered] - > [./c.js] ./c.js 1:0-52 - [./d.js] 22 bytes {2} [built] - require.ensure item ./d [./c.js] 1:0-52 - [./index.js] Xms -> [./c.js] Xms -> factory:Xms building:Xms = Xms - [./e.js] 38 bytes {2} [built] - require.ensure item ./e [./c.js] 1:0-52 - [./index.js] Xms -> [./c.js] Xms -> factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/chunks/expected.txt b/test/statsCases/chunks/expected.txt deleted file mode 100644 index b12c85752..000000000 --- a/test/statsCases/chunks/expected.txt +++ /dev/null @@ -1,35 +0,0 @@ -Hash: e99cd61934506d7567a3 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -0.bundle.js 152 bytes 0 [emitted] -1.bundle.js 289 bytes 1 [emitted] - bundle.js 7.27 KiB 2 [emitted] main -3.bundle.js 227 bytes 3 [emitted] -Entrypoint main = bundle.js -chunk {0} 0.bundle.js 22 bytes <{2}> [rendered] - > ./b [4] ./index.js 2:0-16 - [2] ./b.js 22 bytes {0} [built] - amd require ./b [4] ./index.js 2:0-16 - [4] Xms -> factory:Xms building:Xms = Xms -chunk {1} 1.bundle.js 54 bytes <{2}> >{3}< [rendered] - > ./c [4] ./index.js 3:0-16 - [3] ./c.js 54 bytes {1} [built] - amd require ./c [4] ./index.js 3:0-16 - [4] Xms -> factory:Xms building:Xms = Xms -chunk {2} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] - > ./index main - [4] ./index.js 51 bytes {2} [built] - single entry ./index main - factory:Xms building:Xms = Xms - [5] ./a.js 22 bytes {2} [built] - cjs require ./a [4] ./index.js 1:0-14 - [4] Xms -> factory:Xms building:Xms = Xms -chunk {3} 3.bundle.js 44 bytes <{1}> [rendered] - > [3] ./c.js 1:0-52 - [0] ./d.js 22 bytes {3} [built] - require.ensure item ./d [3] ./c.js 1:0-52 - [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms - [1] ./e.js 22 bytes {3} [built] - require.ensure item ./e [3] ./c.js 1:0-52 - [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/circular-correctness/expected.txt b/test/statsCases/circular-correctness/expected.txt deleted file mode 100644 index 3501a16c3..000000000 --- a/test/statsCases/circular-correctness/expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -Entrypoint main = bundle.js -chunk {0} 0.bundle.js (a) 49 bytes <{2}> <{3}> >{3}< [rendered] - [1] ./module-a.js 49 bytes {0} [built] -chunk {1} 1.bundle.js (b) 49 bytes <{2}> <{3}> >{3}< [rendered] - [2] ./module-b.js 49 bytes {1} [built] -chunk {2} bundle.js (main) 98 bytes >{0}< >{1}< [entry] [rendered] - [3] ./index.js 98 bytes {2} [built] -chunk {3} 3.bundle.js (c) 98 bytes <{0}> <{1}> >{0}< >{1}< [rendered] - [0] ./module-c.js 98 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/color-disabled/expected.txt b/test/statsCases/color-disabled/expected.txt deleted file mode 100644 index a61ed09c9..000000000 --- a/test/statsCases/color-disabled/expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Hash: 0b32ee714cee3c8b25d4 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 2.61 KiB 0 [emitted] main -Entrypoint main = main.js -[0] ./index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/color-enabled-custom/expected.txt b/test/statsCases/color-enabled-custom/expected.txt deleted file mode 100644 index 2a18c994d..000000000 --- a/test/statsCases/color-enabled-custom/expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Hash: 0b32ee714cee3c8b25d4 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 2.61 KiB 0 [emitted] main -Entrypoint main = main.js -[0] ./index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/color-enabled/expected.txt b/test/statsCases/color-enabled/expected.txt deleted file mode 100644 index bb7974c5b..000000000 --- a/test/statsCases/color-enabled/expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Hash: 0b32ee714cee3c8b25d4 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 2.61 KiB 0 [emitted] main -Entrypoint main = main.js -[0] ./index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/commons-chunk-min-size-0/expected.txt b/test/statsCases/commons-chunk-min-size-0/expected.txt deleted file mode 100644 index 4a2b4f0c5..000000000 --- a/test/statsCases/commons-chunk-min-size-0/expected.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hash: cad25b99a073374722a7 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - entry-1.js 5.79 KiB 0 [emitted] entry-1 -vendor-1~entry-1.js 314 bytes 1 [emitted] vendor-1~entry-1 -Entrypoint entry-1 = vendor-1~entry-1.js entry-1.js -[0] ./entry-1.js 145 bytes {0} [built] -[1] ./modules/a.js 22 bytes {1} [built] -[2] ./modules/b.js 22 bytes {1} [built] -[3] ./modules/c.js 22 bytes {1} [built] -[4] ./modules/d.js 22 bytes {0} [built] -[5] ./modules/e.js 22 bytes {0} [built] -[6] ./modules/f.js 22 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/commons-chunk-min-size-Infinity/expected.txt b/test/statsCases/commons-chunk-min-size-Infinity/expected.txt deleted file mode 100644 index 00f7c5aa4..000000000 --- a/test/statsCases/commons-chunk-min-size-Infinity/expected.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hash: c176225f44e51c7a39a4 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - entry-1.js 5.79 KiB 0 [emitted] entry-1 -vendor-1.js 314 bytes 1 [emitted] vendor-1 -Entrypoint entry-1 = vendor-1.js entry-1.js -[0] ./entry-1.js 145 bytes {0} [built] -[1] ./modules/a.js 22 bytes {1} [built] -[2] ./modules/b.js 22 bytes {1} [built] -[3] ./modules/c.js 22 bytes {1} [built] -[4] ./modules/d.js 22 bytes {0} [built] -[5] ./modules/e.js 22 bytes {0} [built] -[6] ./modules/f.js 22 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/commons-plugin-issue-4980/expected.txt b/test/statsCases/commons-plugin-issue-4980/expected.txt deleted file mode 100644 index 8c19ca7a3..000000000 --- a/test/statsCases/commons-plugin-issue-4980/expected.txt +++ /dev/null @@ -1,27 +0,0 @@ -Hash: 1c62a4c91035f66150df2425703c4fe7d61799b3 -Child - Hash: 1c62a4c91035f66150df - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - app.js 5.9 KiB 0 [emitted] app - vendor.c0e73bece4137a7015c2.js 619 bytes 1 [emitted] vendor - Entrypoint app = vendor.c0e73bece4137a7015c2.js app.js - [./constants.js] 87 bytes {1} [built] - [./entry-1.js] ./entry-1.js + 2 modules 190 bytes {0} [built] - | ./entry-1.js 67 bytes [built] - | ./submodule-a.js 59 bytes [built] - | ./submodule-b.js 59 bytes [built] -Child - Hash: 2425703c4fe7d61799b3 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - app.js 5.92 KiB 0 [emitted] app - vendor.c0e73bece4137a7015c2.js 619 bytes 1 [emitted] vendor - Entrypoint app = vendor.c0e73bece4137a7015c2.js app.js - [./constants.js] 87 bytes {1} [built] - [./entry-2.js] ./entry-2.js + 2 modules 197 bytes {0} [built] - | ./entry-2.js 67 bytes [built] - | ./submodule-a.js 59 bytes [built] - | ./submodule-c.js 66 bytes [built] \ No newline at end of file diff --git a/test/statsCases/concat-and-sideeffects/expected.txt b/test/statsCases/concat-and-sideeffects/expected.txt deleted file mode 100644 index 46d862938..000000000 --- a/test/statsCases/concat-and-sideeffects/expected.txt +++ /dev/null @@ -1,15 +0,0 @@ -[0] ./index.js + 2 modules 119 bytes {0} [built] - | ./index.js 46 bytes [built] - | ModuleConcatenation bailout: Module is an entry point - | ./node_modules/pmodule/a.js 49 bytes [built] - | ./node_modules/pmodule/aa.js 24 bytes [built] -[1] ./node_modules/pmodule/b.js 49 bytes [built] - ModuleConcatenation bailout: Module is not in any chunk -[2] ./node_modules/pmodule/bb.js 24 bytes [built] - ModuleConcatenation bailout: Module is not in any chunk -[3] ./node_modules/pmodule/c.js 49 bytes [built] - ModuleConcatenation bailout: Module is not in any chunk -[4] ./node_modules/pmodule/cc.js 24 bytes [built] - ModuleConcatenation bailout: Module is not in any chunk -[5] ./node_modules/pmodule/index.js 63 bytes [built] - ModuleConcatenation bailout: Module is not in any chunk \ No newline at end of file diff --git a/test/statsCases/define-plugin/expected.txt b/test/statsCases/define-plugin/expected.txt deleted file mode 100644 index d43671c36..000000000 --- a/test/statsCases/define-plugin/expected.txt +++ /dev/null @@ -1,17 +0,0 @@ -Hash: 189d0d15eb46be80d1f9eaead63561588b554cc6 -Child - Hash: 189d0d15eb46be80d1f9 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - main.js 2.63 KiB 0 [emitted] main - Entrypoint main = main.js - [0] ./index.js 24 bytes {0} [built] -Child - Hash: eaead63561588b554cc6 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - main.js 2.63 KiB 0 [emitted] main - Entrypoint main = main.js - [0] ./index.js 24 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/exclude-with-loader/expected.txt b/test/statsCases/exclude-with-loader/expected.txt deleted file mode 100644 index e51510ecf..000000000 --- a/test/statsCases/exclude-with-loader/expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hash: 8b3d74c47fe62d34ee43 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -bundle.js 3.05 KiB 0 [emitted] main - + 1 hidden asset -Entrypoint main = bundle.js -[0] ./index.js 77 bytes {0} [built] -[1] ./a.txt 43 bytes {0} [built] - + 2 hidden modules \ No newline at end of file diff --git a/test/statsCases/external/expected.txt b/test/statsCases/external/expected.txt deleted file mode 100644 index b8ebe71bd..000000000 --- a/test/statsCases/external/expected.txt +++ /dev/null @@ -1,8 +0,0 @@ -Hash: 3386bd94ba1fc3ae7f29 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 2.74 KiB 0 [emitted] main -Entrypoint main = main.js -[0] ./index.js 17 bytes {0} [built] -[1] external "test" 42 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/filter-warnings/expected.txt b/test/statsCases/filter-warnings/expected.txt deleted file mode 100644 index 9e37978c9..000000000 --- a/test/statsCases/filter-warnings/expected.txt +++ /dev/null @@ -1,183 +0,0 @@ -Hash: abbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318adabbea59d067e262318ad -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] -Child - Hash: abbea59d067e262318ad - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 2.19 KiB 0 [emitted] main - Entrypoint main = bundle.js - - WARNING in bundle.js from UglifyJs - Dropping side-effect-free statement [./index.js:6,0] - Dropping unused function someUnUsedFunction1 [./index.js:8,0] - Dropping unused function someUnUsedFunction2 [./index.js:9,0] - Dropping unused function someUnUsedFunction3 [./index.js:10,0] - Dropping unused function someUnUsedFunction4 [./index.js:11,0] - Dropping unused function someUnUsedFunction5 [./index.js:12,0] - Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] - Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] - Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] - Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] - Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] \ No newline at end of file diff --git a/test/statsCases/graph-correctness-entries/expected.txt b/test/statsCases/graph-correctness-entries/expected.txt deleted file mode 100644 index 2c8c3c13e..000000000 --- a/test/statsCases/graph-correctness-entries/expected.txt +++ /dev/null @@ -1,19 +0,0 @@ -Entrypoint e1 = e1.js -Entrypoint e2 = e2.js -chunk {0} c.js (c) 49 bytes <{3}> <{4}> >{1}< [rendered] - [1] ./module-c.js 49 bytes {0} [built] - import() ./module-c [2] ./module-b.js 1:0-47 - import() ./module-c [4] ./e2.js 1:0-47 -chunk {1} a.js (a) 49 bytes <{0}> <{2}> >{4}< [rendered] - [0] ./module-a.js 49 bytes {1} [built] - import() ./module-a [1] ./module-c.js 1:0-47 - import() ./module-a [3] ./e1.js 1:0-47 -chunk {2} e1.js (e1) 49 bytes >{1}< [entry] [rendered] - [3] ./e1.js 49 bytes {2} [built] - single entry ./e1 e1 -chunk {3} e2.js (e2) 49 bytes >{0}< [entry] [rendered] - [4] ./e2.js 49 bytes {3} [built] - single entry ./e2 e2 -chunk {4} b.js (b) 49 bytes <{1}> >{0}< [rendered] - [2] ./module-b.js 49 bytes {4} [built] - import() ./module-b [0] ./module-a.js 1:0-47 \ No newline at end of file diff --git a/test/statsCases/graph-correctness-modules/expected.txt b/test/statsCases/graph-correctness-modules/expected.txt deleted file mode 100644 index d19a2d2be..000000000 --- a/test/statsCases/graph-correctness-modules/expected.txt +++ /dev/null @@ -1,30 +0,0 @@ -Entrypoint e1 = e1.js -Entrypoint e2 = e2.js -chunk {0} y.js (y) 0 bytes <{3}> <{4}> [rendered] - [3] ./module-y.js 0 bytes {0} [built] - import() ./module-y [0] ./module-x.js 1:0-47 -chunk {1} c.js (c) 49 bytes <{4}> <{5}> >{2}< [rendered] - [2] ./module-c.js 49 bytes {1} [built] - import() ./module-c [4] ./module-b.js 1:0-47 - import() ./module-c [6] ./e2.js 2:0-47 -chunk {2} a.js (a) 49 bytes <{1}> <{3}> >{5}< [rendered] - [1] ./module-a.js 49 bytes {2} [built] - import() ./module-a [2] ./module-c.js 1:0-47 - import() ./module-a [5] ./e1.js 2:0-47 -chunk {3} e1.js (e1) 119 bytes >{0}< >{2}< [entry] [rendered] - [0] ./module-x.js 49 bytes {3} {4} [built] - import() ./module-x [4] ./module-b.js 2:0-20 - harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 - harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 - [5] ./e1.js 70 bytes {3} [built] - single entry ./e1 e1 -chunk {4} e2.js (e2) 119 bytes >{0}< >{1}< [entry] [rendered] - [0] ./module-x.js 49 bytes {3} {4} [built] - import() ./module-x [4] ./module-b.js 2:0-20 - harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 - harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 - [6] ./e2.js 70 bytes {4} [built] - single entry ./e2 e2 -chunk {5} b.js (b) 179 bytes <{2}> >{1}< [rendered] - [4] ./module-b.js 179 bytes {5} [built] - import() ./module-b [1] ./module-a.js 1:0-47 \ No newline at end of file diff --git a/test/statsCases/import-context-filter/expected.txt b/test/statsCases/import-context-filter/expected.txt deleted file mode 100644 index 8883ce138..000000000 --- a/test/statsCases/import-context-filter/expected.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hash: 736289137c8313a6d802 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 305 bytes 0 [emitted] - 1.js 314 bytes 1 [emitted] - 2.js 308 bytes 2 [emitted] -entry.js 8.07 KiB 3 [emitted] entry -Entrypoint entry = entry.js -[0] ./templates/bar.js 38 bytes {0} [optional] [built] -[1] ./templates/baz.js 38 bytes {1} [optional] [built] -[2] ./templates/foo.js 38 bytes {2} [optional] [built] -[3] ./entry.js 450 bytes {3} [built] -[4] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] \ No newline at end of file diff --git a/test/statsCases/import-weak/expected.txt b/test/statsCases/import-weak/expected.txt deleted file mode 100644 index e1283ab69..000000000 --- a/test/statsCases/import-weak/expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hash: 1c55fc2d238369c62239 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 149 bytes 0 [emitted] -entry.js 8.06 KiB 1 [emitted] entry -Entrypoint entry = entry.js -[0] ./modules/b.js 22 bytes {0} [built] -[1] ./entry.js 120 bytes {1} [built] -[2] ./modules/a.js 37 bytes [built] \ No newline at end of file diff --git a/test/statsCases/limit-chunk-count-plugin/expected.txt b/test/statsCases/limit-chunk-count-plugin/expected.txt deleted file mode 100644 index 88012eed7..000000000 --- a/test/statsCases/limit-chunk-count-plugin/expected.txt +++ /dev/null @@ -1,69 +0,0 @@ -Hash: 89bb5076b735d47082582924d303eb8bcffb1c785cc24ae5dbdd7c6bafb935e3a49d38d6f5cc7854 -Child 1 chunks: - Hash: 89bb5076b735d4708258 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - bundle.js 5.98 KiB 0 [emitted] main - Entrypoint main = bundle.js - chunk {0} bundle.js (main) 191 bytes <{0}> >{0}< [entry] [rendered] - [0] ./index.js 73 bytes {0} [built] - [1] ./a.js 22 bytes {0} [built] - [2] ./b.js 22 bytes {0} [built] - [3] ./c.js 30 bytes {0} [built] - [4] ./d.js 22 bytes {0} [built] - [5] ./e.js 22 bytes {0} [built] -Child 2 chunks: - Hash: 2924d303eb8bcffb1c78 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.bundle.js 1 KiB 0 [emitted] - bundle.js 7.46 KiB 1 [emitted] main - Entrypoint main = bundle.js - chunk {0} 0.bundle.js 118 bytes <{0}> <{1}> >{0}< [rendered] - [0] ./d.js 22 bytes {0} [built] - [1] ./e.js 22 bytes {0} [built] - [2] ./a.js 22 bytes {0} [built] - [3] ./b.js 22 bytes {0} [built] - [4] ./c.js 30 bytes {0} [built] - chunk {1} bundle.js (main) 73 bytes >{0}< [entry] [rendered] - [5] ./index.js 73 bytes {1} [built] -Child 3 chunks: - Hash: 5cc24ae5dbdd7c6bafb9 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.bundle.js 886 bytes 0 [emitted] - 1.bundle.js 245 bytes 1 [emitted] - bundle.js 7.46 KiB 2 [emitted] main - Entrypoint main = bundle.js - chunk {0} 0.bundle.js 74 bytes <{0}> <{2}> >{0}< >{1}< [rendered] - [0] ./d.js 22 bytes {0} [built] - [2] ./a.js 22 bytes {0} [built] - [4] ./c.js 30 bytes {0} [built] - chunk {1} 1.bundle.js 44 bytes <{0}> <{2}> [rendered] - [1] ./e.js 22 bytes {1} [built] - [3] ./b.js 22 bytes {1} [built] - chunk {2} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] - [5] ./index.js 73 bytes {2} [built] -Child 4 chunks: - Hash: 35e3a49d38d6f5cc7854 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.bundle.js 236 bytes 0 [emitted] - 1.bundle.js 245 bytes 1 [emitted] - 2.bundle.js 715 bytes 2 [emitted] - bundle.js 7.46 KiB 3 [emitted] main - Entrypoint main = bundle.js - chunk {0} 0.bundle.js 44 bytes <{2}> <{3}> [rendered] - [0] ./d.js 22 bytes {0} [built] - [2] ./a.js 22 bytes {0} [built] - chunk {1} 1.bundle.js 44 bytes <{2}> <{3}> [rendered] - [1] ./e.js 22 bytes {1} [built] - [3] ./b.js 22 bytes {1} [built] - chunk {2} 2.bundle.js 30 bytes <{3}> >{0}< >{1}< [rendered] - [4] ./c.js 30 bytes {2} [built] - chunk {3} bundle.js (main) 73 bytes >{0}< >{1}< >{2}< [entry] [rendered] - [5] ./index.js 73 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/max-modules-default/expected.txt b/test/statsCases/max-modules-default/expected.txt deleted file mode 100644 index f8915ebb3..000000000 --- a/test/statsCases/max-modules-default/expected.txt +++ /dev/null @@ -1,22 +0,0 @@ -Hash: c5cf5ab0cc0a404f1acf -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 5.85 KiB 0 [emitted] main -Entrypoint main = main.js - [0] ./a.js?1 33 bytes {0} [built] - [1] ./a.js?2 33 bytes {0} [built] - [2] ./a.js?3 33 bytes {0} [built] - [3] ./a.js?4 33 bytes {0} [built] - [4] ./a.js?5 33 bytes {0} [built] - [5] ./a.js?6 33 bytes {0} [built] - [6] ./a.js?7 33 bytes {0} [built] - [7] ./a.js?8 33 bytes {0} [built] - [8] ./a.js?9 33 bytes {0} [built] - [9] ./a.js?10 33 bytes {0} [built] -[10] ./index.js 181 bytes {0} [built] -[11] ./c.js?1 33 bytes {0} [built] -[13] ./c.js?2 33 bytes {0} [built] -[27] ./c.js?9 33 bytes {0} [built] -[29] ./c.js?10 33 bytes {0} [built] - + 16 hidden modules \ No newline at end of file diff --git a/test/statsCases/max-modules/expected.txt b/test/statsCases/max-modules/expected.txt deleted file mode 100644 index 653fca302..000000000 --- a/test/statsCases/max-modules/expected.txt +++ /dev/null @@ -1,27 +0,0 @@ -Hash: c5cf5ab0cc0a404f1acf -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 5.85 KiB 0 [emitted] main -Entrypoint main = main.js - [0] ./a.js?1 33 bytes {0} [built] - [1] ./a.js?2 33 bytes {0} [built] - [2] ./a.js?3 33 bytes {0} [built] - [3] ./a.js?4 33 bytes {0} [built] - [4] ./a.js?5 33 bytes {0} [built] - [5] ./a.js?6 33 bytes {0} [built] - [6] ./a.js?7 33 bytes {0} [built] - [7] ./a.js?8 33 bytes {0} [built] - [8] ./a.js?9 33 bytes {0} [built] - [9] ./a.js?10 33 bytes {0} [built] -[10] ./index.js 181 bytes {0} [built] -[11] ./c.js?1 33 bytes {0} [built] -[13] ./c.js?2 33 bytes {0} [built] -[15] ./c.js?3 33 bytes {0} [built] -[17] ./c.js?4 33 bytes {0} [built] -[19] ./c.js?5 33 bytes {0} [built] -[23] ./c.js?7 33 bytes {0} [built] -[25] ./c.js?8 33 bytes {0} [built] -[27] ./c.js?9 33 bytes {0} [built] -[29] ./c.js?10 33 bytes {0} [built] - + 11 hidden modules \ No newline at end of file diff --git a/test/statsCases/module-assets/expected.txt b/test/statsCases/module-assets/expected.txt deleted file mode 100644 index 723eea28d..000000000 --- a/test/statsCases/module-assets/expected.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hash: 021e4419d6957e08eedd -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT -Entrypoint main = main.js -chunk {0} 0.js 68 bytes <{1}> [rendered] - [0] ./node_modules/a/1.png 51 bytes {0} [built] [1 asset] - [1] ./node_modules/a/index.js 17 bytes {0} [built] -chunk {1} main.js (main) 12 bytes >{0}< [entry] [rendered] - [2] ./index.js 12 bytes {1} [built] -[0] ./node_modules/a/1.png 51 bytes {0} [built] [1 asset] -[1] ./node_modules/a/index.js 17 bytes {0} [built] -[2] ./index.js 12 bytes {1} [built] \ No newline at end of file diff --git a/test/statsCases/module-deduplication-named/expected.txt b/test/statsCases/module-deduplication-named/expected.txt deleted file mode 100644 index 1c68b4453..000000000 --- a/test/statsCases/module-deduplication-named/expected.txt +++ /dev/null @@ -1,37 +0,0 @@ - Asset Size Chunks Chunk Names -async3.js 818 bytes 0 [emitted] async3 -async1.js 818 bytes 1 [emitted] async1 -async2.js 818 bytes 2 [emitted] async2 - e1.js 8.29 KiB 3 [emitted] e1 - e2.js 8.31 KiB 4 [emitted] e2 - e3.js 8.33 KiB 5 [emitted] e3 -Entrypoint e1 = e1.js -Entrypoint e2 = e2.js -Entrypoint e3 = e3.js -chunk {0} async3.js (async3) 89 bytes <{2}> <{5}> >{1}< [rendered] - [4] ./h.js 9 bytes {0} {5} [built] - [7] ./async3.js 80 bytes {0} [built] -chunk {1} async1.js (async1) 89 bytes <{0}> <{3}> >{2}< [rendered] - [2] ./d.js 9 bytes {1} {3} [built] - [5] ./async1.js 80 bytes {1} [built] -chunk {2} async2.js (async2) 89 bytes <{1}> <{4}> >{0}< [rendered] - [3] ./f.js 9 bytes {2} {4} [built] - [6] ./async2.js 80 bytes {2} [built] -chunk {3} e1.js (e1) 144 bytes >{1}< [entry] [rendered] - [0] ./b.js 9 bytes {3} {4} {5} [built] - [1] ./a.js 9 bytes {3} {4} {5} [built] - [2] ./d.js 9 bytes {1} {3} [built] - [8] ./e1.js 108 bytes {3} [built] - [9] ./c.js 9 bytes {3} [built] -chunk {4} e2.js (e2) 144 bytes >{2}< [entry] [rendered] - [0] ./b.js 9 bytes {3} {4} {5} [built] - [1] ./a.js 9 bytes {3} {4} {5} [built] - [3] ./f.js 9 bytes {2} {4} [built] - [10] ./e2.js 108 bytes {4} [built] - [11] ./e.js 9 bytes {4} [built] -chunk {5} e3.js (e3) 144 bytes >{0}< [entry] [rendered] - [0] ./b.js 9 bytes {3} {4} {5} [built] - [1] ./a.js 9 bytes {3} {4} {5} [built] - [4] ./h.js 9 bytes {0} {5} [built] - [12] ./e3.js 108 bytes {5} [built] - [13] ./g.js 9 bytes {5} [built] \ No newline at end of file diff --git a/test/statsCases/module-deduplication/expected.txt b/test/statsCases/module-deduplication/expected.txt deleted file mode 100644 index 1dd7c9037..000000000 --- a/test/statsCases/module-deduplication/expected.txt +++ /dev/null @@ -1,46 +0,0 @@ -Asset Size Chunks Chunk Names - 0.js 730 bytes 0, 5 [emitted] - 1.js 730 bytes 1, 4 [emitted] - 2.js 730 bytes 2, 3 [emitted] - 3.js 661 bytes 3 [emitted] - 4.js 661 bytes 4 [emitted] - 5.js 661 bytes 5 [emitted] -e1.js 8.4 KiB 6 [emitted] e1 -e2.js 8.43 KiB 7 [emitted] e2 -e3.js 8.45 KiB 8 [emitted] e3 -Entrypoint e1 = e1.js -Entrypoint e2 = e2.js -Entrypoint e3 = e3.js -chunk {0} 0.js 37 bytes <{7}> <{8}> [rendered] - [2] ./d.js 9 bytes {0} {6} [built] - [5] ./async1.js 28 bytes {0} {5} [built] -chunk {1} 1.js 37 bytes <{6}> <{8}> [rendered] - [3] ./f.js 9 bytes {1} {7} [built] - [6] ./async2.js 28 bytes {1} {4} [built] -chunk {2} 2.js 37 bytes <{6}> <{7}> [rendered] - [4] ./h.js 9 bytes {2} {8} [built] - [7] ./async3.js 28 bytes {2} {3} [built] -chunk {3} 3.js 28 bytes <{8}> [rendered] - [7] ./async3.js 28 bytes {2} {3} [built] -chunk {4} 4.js 28 bytes <{7}> [rendered] - [6] ./async2.js 28 bytes {1} {4} [built] -chunk {5} 5.js 28 bytes <{6}> [rendered] - [5] ./async1.js 28 bytes {0} {5} [built] -chunk {6} e1.js (e1) 152 bytes >{1}< >{2}< >{5}< [entry] [rendered] - [0] ./b.js 9 bytes {6} {7} {8} [built] - [1] ./a.js 9 bytes {6} {7} {8} [built] - [2] ./d.js 9 bytes {0} {6} [built] - [8] ./e1.js 116 bytes {6} [built] - [9] ./c.js 9 bytes {6} [built] -chunk {7} e2.js (e2) 152 bytes >{0}< >{2}< >{4}< [entry] [rendered] - [0] ./b.js 9 bytes {6} {7} {8} [built] - [1] ./a.js 9 bytes {6} {7} {8} [built] - [3] ./f.js 9 bytes {1} {7} [built] - [10] ./e2.js 116 bytes {7} [built] - [11] ./e.js 9 bytes {7} [built] -chunk {8} e3.js (e3) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] - [0] ./b.js 9 bytes {6} {7} {8} [built] - [1] ./a.js 9 bytes {6} {7} {8} [built] - [4] ./h.js 9 bytes {2} {8} [built] - [12] ./e3.js 116 bytes {8} [built] - [13] ./g.js 9 bytes {8} [built] \ No newline at end of file diff --git a/test/statsCases/module-trace-disabled-in-error/expected.txt b/test/statsCases/module-trace-disabled-in-error/expected.txt deleted file mode 100644 index 4331cd169..000000000 --- a/test/statsCases/module-trace-disabled-in-error/expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 2.79 KiB 0 main -Entrypoint main = main.js -[0] ./index.js 25 bytes {0} [built] - -ERROR in ./index.js -Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-disabled-in-error' \ No newline at end of file diff --git a/test/statsCases/module-trace-enabled-in-error/expected.txt b/test/statsCases/module-trace-enabled-in-error/expected.txt deleted file mode 100644 index 8b4bf5134..000000000 --- a/test/statsCases/module-trace-enabled-in-error/expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 2.79 KiB 0 main -Entrypoint main = main.js -[0] ./index.js 25 bytes {0} [built] - -ERROR in ./index.js -Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-enabled-in-error' - @ ./index.js 1:0-25 \ No newline at end of file diff --git a/test/statsCases/named-chunk-groups/a.js b/test/statsCases/named-chunk-groups/a.js new file mode 100644 index 000000000..699904754 --- /dev/null +++ b/test/statsCases/named-chunk-groups/a.js @@ -0,0 +1,3 @@ +import "./shared"; + +export default "a"; diff --git a/test/statsCases/named-chunk-groups/b.js b/test/statsCases/named-chunk-groups/b.js new file mode 100644 index 000000000..a47f90b65 --- /dev/null +++ b/test/statsCases/named-chunk-groups/b.js @@ -0,0 +1,3 @@ +import "./shared"; + +export default "b"; diff --git a/test/statsCases/named-chunk-groups/c.js b/test/statsCases/named-chunk-groups/c.js new file mode 100644 index 000000000..00c4083b2 --- /dev/null +++ b/test/statsCases/named-chunk-groups/c.js @@ -0,0 +1,4 @@ +import "x"; +import "y"; + +export default "c"; diff --git a/test/statsCases/named-chunk-groups/index.js b/test/statsCases/named-chunk-groups/index.js new file mode 100644 index 000000000..e700f4783 --- /dev/null +++ b/test/statsCases/named-chunk-groups/index.js @@ -0,0 +1,3 @@ +import(/* webpackChunkName: "async-a" */ "./a"); +import(/* webpackChunkName: "async-b" */ "./b"); +import(/* webpackChunkName: "async-c" */ "./c"); \ No newline at end of file diff --git a/test/statsCases/named-chunk-groups/node_modules/x.js b/test/statsCases/named-chunk-groups/node_modules/x.js new file mode 100644 index 000000000..3fd5ecc7a --- /dev/null +++ b/test/statsCases/named-chunk-groups/node_modules/x.js @@ -0,0 +1 @@ +export default "x"; diff --git a/test/statsCases/named-chunk-groups/node_modules/y.js b/test/statsCases/named-chunk-groups/node_modules/y.js new file mode 100644 index 000000000..413e7c09d --- /dev/null +++ b/test/statsCases/named-chunk-groups/node_modules/y.js @@ -0,0 +1 @@ +export default "y"; diff --git a/test/statsCases/named-chunk-groups/shared.js b/test/statsCases/named-chunk-groups/shared.js new file mode 100644 index 000000000..f53cf742a --- /dev/null +++ b/test/statsCases/named-chunk-groups/shared.js @@ -0,0 +1,2 @@ +// content content content content content content content content +// content content content content content content content content \ No newline at end of file diff --git a/test/statsCases/named-chunk-groups/webpack.config.js b/test/statsCases/named-chunk-groups/webpack.config.js new file mode 100644 index 000000000..617a63e18 --- /dev/null +++ b/test/statsCases/named-chunk-groups/webpack.config.js @@ -0,0 +1,47 @@ +const stats = { + hash: false, + timings: false, + builtAt: false, + assets: false, + chunks: true, + chunkOrigins: true, + modules: false +}; + +const config = { + mode: "production", + entry: { + main: "./" + }, + output: { + filename: "[name].js" + }, + optimization: { + splitChunks: { + minSize: 100, + cacheGroups: { + vendors: { + test: /[\\/]node_modules[\\/]/, + chunks: "async", + enforce: true, + name: "vendors" + } + } + } + } +}; + +module.exports = [ + Object.assign( + { + stats: Object.assign({ entrypoints: false, chunkGroups: true }, stats) + }, + config + ), + Object.assign( + { + stats: Object.assign({ entrypoints: true, chunkGroups: true }, stats) + }, + config + ) +]; diff --git a/test/statsCases/named-chunks-plugin-async/expected.txt b/test/statsCases/named-chunks-plugin-async/expected.txt deleted file mode 100644 index 1bf804994..000000000 --- a/test/statsCases/named-chunks-plugin-async/expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hash: f7d13fc86234627ae268 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -chunk-containing-__a_js.js 509 bytes chunk-containing-__a_js [emitted] -chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted] - entry.js 7.55 KiB entry [emitted] entry -Entrypoint entry = entry.js -[0] ./modules/b.js 22 bytes {chunk-containing-__b_js} [built] -[1] ./modules/a.js 37 bytes {chunk-containing-__a_js} [built] -[2] ./entry.js 47 bytes {entry} [built] \ No newline at end of file diff --git a/test/statsCases/named-chunks-plugin/expected.txt b/test/statsCases/named-chunks-plugin/expected.txt deleted file mode 100644 index b4bcb7705..000000000 --- a/test/statsCases/named-chunks-plugin/expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hash: 5df55d54223f36cc303b -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - entry.js 5.64 KiB entry [emitted] entry -vendor.js 269 bytes vendor [emitted] vendor -Entrypoint entry = vendor.js entry.js -[./entry.js] 72 bytes {entry} [built] -[./modules/a.js] 22 bytes {vendor} [built] -[./modules/b.js] 22 bytes {vendor} [built] -[./modules/c.js] 22 bytes {entry} [built] \ No newline at end of file diff --git a/test/statsCases/no-emit-on-errors-plugin-with-child-error/expected.txt b/test/statsCases/no-emit-on-errors-plugin-with-child-error/expected.txt deleted file mode 100644 index 72101dbc3..000000000 --- a/test/statsCases/no-emit-on-errors-plugin-with-child-error/expected.txt +++ /dev/null @@ -1,19 +0,0 @@ -Hash: 550499db0a071b393308 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - child.js 2.61 KiB -bundle.js 2.61 KiB 0 main -Entrypoint main = bundle.js -[0] ./index.js 0 bytes {0} [built] - -WARNING in configuration -The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. -You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ -Child child: - Asset Size Chunks Chunk Names - child.js 2.61 KiB 0 child - Entrypoint child = child.js - [0] ./index.js 0 bytes {0} [built] - - ERROR in forced error \ No newline at end of file diff --git a/test/statsCases/optimize-chunks/expected.txt b/test/statsCases/optimize-chunks/expected.txt deleted file mode 100644 index 37a2a0a38..000000000 --- a/test/statsCases/optimize-chunks/expected.txt +++ /dev/null @@ -1,47 +0,0 @@ -Hash: b643225c9d2e70212495 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - cir1.js 299 bytes 0 [emitted] cir1 - ab.js 183 bytes 1 [emitted] ab - abd.js 277 bytes 2, 1 [emitted] abd - cir2.js 299 bytes 3 [emitted] cir2 - main.js 8.07 KiB 4 [emitted] main -cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 - chunk.js 190 bytes 6, 7 [emitted] chunk - ac in ab.js 130 bytes 7 [emitted] ac in ab -Entrypoint main = main.js -chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> <{5}> >{5}< [rendered] - > [3] ./circular2.js 1:0-79 - > [3] ./circular2.js 1:0-79 - > [8] ./index.js 13:0-54 - [2] ./circular1.js 81 bytes {0} [built] -chunk {1} ab.js (ab) 0 bytes <{4}> >{7}< [rendered] - > [8] ./index.js 1:0-6:8 - [0] ./modules/a.js 0 bytes {1} {2} [built] - [1] ./modules/b.js 0 bytes {1} {2} [built] -chunk {2} abd.js (abd) 0 bytes <{4}> >{6}< [rendered] - > [8] ./index.js 8:0-11:9 - [0] ./modules/a.js 0 bytes {1} {2} [built] - [1] ./modules/b.js 0 bytes {1} {2} [built] - [6] ./modules/d.js 0 bytes {2} {6} [built] -chunk {3} cir2.js (cir2) 81 bytes <{4}> >{0}< [rendered] - > [8] ./index.js 14:0-54 - [3] ./circular2.js 81 bytes {3} {5} [built] -chunk {4} main.js (main) 523 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] - > ./index main - [4] ./modules/f.js 0 bytes {4} [built] - [8] ./index.js 523 bytes {4} [built] -chunk {5} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> >{0}< [rendered] - > [2] ./circular1.js 1:0-79 - > [2] ./circular1.js 1:0-79 - [3] ./circular2.js 81 bytes {3} {5} [built] - [7] ./modules/e.js 0 bytes {5} [built] -chunk {6} chunk.js (chunk) 0 bytes <{2}> <{7}> [rendered] - > [8] ./index.js 3:2-4:13 - > [8] ./index.js 9:1-10:12 - [5] ./modules/c.js 0 bytes {6} {7} [built] - [6] ./modules/d.js 0 bytes {2} {6} [built] -chunk {7} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] - > [8] ./index.js 2:1-5:15 - [5] ./modules/c.js 0 bytes {6} {7} [built] \ No newline at end of file diff --git a/test/statsCases/parse-error/expected.txt b/test/statsCases/parse-error/expected.txt deleted file mode 100644 index fb2938a35..000000000 --- a/test/statsCases/parse-error/expected.txt +++ /dev/null @@ -1,18 +0,0 @@ - Asset Size Chunks Chunk Names -main.js 3.05 KiB 0 main -Entrypoint main = main.js -[0] ./b.js 169 bytes {0} [built] [failed] [1 error] -[1] ./index.js + 1 modules 35 bytes {0} [built] - | ./index.js 15 bytes [built] - | ./a.js 15 bytes [built] - -ERROR in ./b.js -Module parse failed: Unexpected token (6:7) -You may need an appropriate loader to handle this file type. -| includes -| a -| parser ) -| error -| in - @ ./a.js 2:0-13 - @ ./index.js \ No newline at end of file diff --git a/test/statsCases/performance-different-mode-and-target/expected.txt b/test/statsCases/performance-different-mode-and-target/expected.txt deleted file mode 100644 index 56a60aab9..000000000 --- a/test/statsCases/performance-different-mode-and-target/expected.txt +++ /dev/null @@ -1,102 +0,0 @@ -Hash: df3a0090d24670ebd17d7094466a296a7ae4ae823f59070ac8deb95011d223ef01d5f7db6f7b0912f47482563c8b6b9dc4955fdf2e3a0c7c308a998f9bab5b59aa119495c443 -Child - Hash: df3a0090d24670ebd17d - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - warning.pro-web.js 296 KiB 0 [emitted] [big] main - Entrypoint main [big] = warning.pro-web.js - [0] ./index.js 293 KiB {0} [built] - - WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). - This can impact web performance. - Assets: - warning.pro-web.js (296 KiB) - - WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. - Entrypoints: - main (296 KiB) - warning.pro-web.js - - - WARNING in webpack performance recommendations: - You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. - For more info visit https://webpack.js.org/guides/code-splitting/ -Child - Hash: 7094466a296a7ae4ae82 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - warning.pro-webworker.js 296 KiB 0 [emitted] [big] main - Entrypoint main [big] = warning.pro-webworker.js - [0] ./index.js 293 KiB {0} [built] - - WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). - This can impact web performance. - Assets: - warning.pro-webworker.js (296 KiB) - - WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. - Entrypoints: - main (296 KiB) - warning.pro-webworker.js - - - WARNING in webpack performance recommendations: - You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. - For more info visit https://webpack.js.org/guides/code-splitting/ -Child - Hash: 3f59070ac8deb95011d2 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - no-warning.pro-node.js 296 KiB 0 [emitted] main - Entrypoint main = no-warning.pro-node.js - [0] ./index.js 293 KiB {0} [built] -Child - Hash: 23ef01d5f7db6f7b0912 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - no-warning.dev-web.js 1.72 MiB main [emitted] main - Entrypoint main = no-warning.dev-web.js - [./index.js] 293 KiB {main} [built] -Child - Hash: f47482563c8b6b9dc495 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - no-warning.dev-node.js 1.72 MiB main [emitted] main - Entrypoint main = no-warning.dev-node.js - [./index.js] 293 KiB {main} [built] -Child - Hash: 5fdf2e3a0c7c308a998f - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - no-warning.dev-web-with-limit-set.js 1.72 MiB main [emitted] [big] main - Entrypoint main [big] = no-warning.dev-web-with-limit-set.js - [./index.js] 293 KiB {main} [built] -Child - Hash: 9bab5b59aa119495c443 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - warning.pro-node-with-hints-set.js 296 KiB 0 [emitted] [big] main - Entrypoint main [big] = warning.pro-node-with-hints-set.js - [0] ./index.js 293 KiB {0} [built] - - WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). - This can impact web performance. - Assets: - warning.pro-node-with-hints-set.js (296 KiB) - - WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. - Entrypoints: - main (296 KiB) - warning.pro-node-with-hints-set.js - - - WARNING in webpack performance recommendations: - You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. - For more info visit https://webpack.js.org/guides/code-splitting/ \ No newline at end of file diff --git a/test/statsCases/performance-disabled/expected.txt b/test/statsCases/performance-disabled/expected.txt deleted file mode 100644 index 8747d941a..000000000 --- a/test/statsCases/performance-disabled/expected.txt +++ /dev/null @@ -1,14 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 300 KiB 2 [emitted] main - 3.js 227 bytes 3 [emitted] -Entrypoint main = main.js -[0] ./d.js 22 bytes {3} [built] -[1] ./e.js 22 bytes {3} [built] -[2] ./b.js 22 bytes {0} [built] -[3] ./c.js 54 bytes {1} [built] -[4] ./index.js 52 bytes {2} [built] -[5] ./a.js 293 KiB {2} [built] \ No newline at end of file diff --git a/test/statsCases/performance-error/expected.txt b/test/statsCases/performance-error/expected.txt deleted file mode 100644 index bb67d7656..000000000 --- a/test/statsCases/performance-error/expected.txt +++ /dev/null @@ -1,25 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 300 KiB 2 [emitted] [big] main - 3.js 227 bytes 3 [emitted] -Entrypoint main [big] = main.js -[0] ./d.js 22 bytes {3} [built] -[1] ./e.js 22 bytes {3} [built] -[2] ./b.js 22 bytes {0} [built] -[3] ./c.js 54 bytes {1} [built] -[4] ./index.js 52 bytes {2} [built] -[5] ./a.js 293 KiB {2} [built] - -ERROR in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). -This can impact web performance. -Assets: - main.js (300 KiB) - -ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. -Entrypoints: - main (300 KiB) - main.js - \ No newline at end of file diff --git a/test/statsCases/performance-no-async-chunks-shown/expected.txt b/test/statsCases/performance-no-async-chunks-shown/expected.txt deleted file mode 100644 index d3e498d8a..000000000 --- a/test/statsCases/performance-no-async-chunks-shown/expected.txt +++ /dev/null @@ -1,28 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 296 KiB 0 [emitted] [big] main - sec.js 2.95 KiB 1 [emitted] sec -Entrypoint main [big] = main.js -Entrypoint sec = sec.js -[0] ./b.js 22 bytes {0} {1} [built] -[1] ./index.js 32 bytes {0} [built] -[2] ./a.js 293 KiB {0} [built] -[3] ./index2.js 48 bytes {1} [built] -[4] ./c.js 22 bytes {1} [built] -[5] ./d.js 22 bytes {1} [built] - -WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). -This can impact web performance. -Assets: - main.js (296 KiB) - -WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. -Entrypoints: - main (296 KiB) - main.js - - -WARNING in webpack performance recommendations: -You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. -For more info visit https://webpack.js.org/guides/code-splitting/ \ No newline at end of file diff --git a/test/statsCases/performance-no-hints/expected.txt b/test/statsCases/performance-no-hints/expected.txt deleted file mode 100644 index 1181b98c5..000000000 --- a/test/statsCases/performance-no-hints/expected.txt +++ /dev/null @@ -1,14 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 300 KiB 2 [emitted] [big] main - 3.js 227 bytes 3 [emitted] -Entrypoint main [big] = main.js -[0] ./d.js 22 bytes {3} [built] -[1] ./e.js 22 bytes {3} [built] -[2] ./b.js 22 bytes {0} [built] -[3] ./c.js 54 bytes {1} [built] -[4] ./index.js 52 bytes {2} [built] -[5] ./a.js 293 KiB {2} [built] \ No newline at end of file diff --git a/test/statsCases/performance-oversize-limit-error/expected.txt b/test/statsCases/performance-oversize-limit-error/expected.txt deleted file mode 100644 index 288a58cd7..000000000 --- a/test/statsCases/performance-oversize-limit-error/expected.txt +++ /dev/null @@ -1,28 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 296 KiB 0 [emitted] [big] main - sec.js 296 KiB 1 [emitted] [big] sec -Entrypoint main [big] = main.js -Entrypoint sec [big] = sec.js -[0] ./a.js 293 KiB {0} {1} [built] -[1] ./index.js 16 bytes {0} [built] -[2] ./index2.js 16 bytes {1} [built] - -ERROR in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). -This can impact web performance. -Assets: - main.js (296 KiB) - sec.js (296 KiB) - -ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. -Entrypoints: - main (296 KiB) - main.js - sec (296 KiB) - sec.js - - -ERROR in webpack performance recommendations: -You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. -For more info visit https://webpack.js.org/guides/code-splitting/ \ No newline at end of file diff --git a/test/statsCases/prefetch-preload-mixed/expected.txt b/test/statsCases/prefetch-preload-mixed/expected.txt deleted file mode 100644 index 55597681b..000000000 --- a/test/statsCases/prefetch-preload-mixed/expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {9} {10}) [rendered] -chunk {1} b.js (b) 203 bytes <{3}> >{6}< >{7}< >{8}< (prefetch: {6} {8}) (preload: {7}) [rendered] -chunk {2} c.js (c) 134 bytes <{3}> >{4}< >{5}< (preload: {4} {5}) [rendered] -chunk {3} main.js (main) 195 bytes >{0}< >{1}< >{2}< (prefetch: {0} {1} {2}) [entry] [rendered] -chunk {4} c1.js (c1) 0 bytes <{2}> [rendered] -chunk {5} c2.js (c2) 0 bytes <{2}> [rendered] -chunk {6} b1.js (b1) 0 bytes <{1}> [rendered] -chunk {7} b2.js (b2) 0 bytes <{1}> [rendered] -chunk {8} b3.js (b3) 0 bytes <{1}> [rendered] -chunk {9} a1.js (a1) 0 bytes <{0}> [rendered] -chunk {10} a2.js (a2) 0 bytes <{0}> [rendered] \ No newline at end of file diff --git a/test/statsCases/prefetch/expected.txt b/test/statsCases/prefetch/expected.txt deleted file mode 100644 index 1c4aa09a0..000000000 --- a/test/statsCases/prefetch/expected.txt +++ /dev/null @@ -1,16 +0,0 @@ - Asset Size Chunks Chunk Names - prefetched.js 1.03 KiB 0 [emitted] prefetched - normal.js 130 bytes 1 [emitted] normal -prefetched2.js 127 bytes 2 [emitted] prefetched2 -prefetched3.js 130 bytes 3 [emitted] prefetched3 - main.js 9.69 KiB 4 [emitted] main - inner.js 136 bytes 5 [emitted] inner - inner2.js 201 bytes 6 [emitted] inner2 -Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js) -chunk {0} prefetched.js (prefetched) 228 bytes <{4}> >{5}< >{6}< (prefetch: {6} {5}) [rendered] -chunk {1} normal.js (normal) 0 bytes <{4}> [rendered] -chunk {2} prefetched2.js (prefetched2) 0 bytes <{4}> [rendered] -chunk {3} prefetched3.js (prefetched3) 0 bytes <{4}> [rendered] -chunk {4} main.js (main) 436 bytes >{0}< >{1}< >{2}< >{3}< (prefetch: {2} {0} {3}) [entry] [rendered] -chunk {5} inner.js (inner) 0 bytes <{0}> [rendered] -chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered] \ No newline at end of file diff --git a/test/statsCases/preset-detailed/expected.txt b/test/statsCases/preset-detailed/expected.txt deleted file mode 100644 index 353b8af1d..000000000 --- a/test/statsCases/preset-detailed/expected.txt +++ /dev/null @@ -1,29 +0,0 @@ -Hash: 5a6d9c01f46a5330eee6 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 7.28 KiB 2 [emitted] main - 3.js 227 bytes 3 [emitted] -Entrypoint main = main.js -chunk {0} 0.js 22 bytes <{2}> [rendered] - > ./b [4] ./index.js 2:0-16 -chunk {1} 1.js 54 bytes <{2}> >{3}< [rendered] - > ./c [4] ./index.js 3:0-16 -chunk {2} main.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] - > ./index main -chunk {3} 3.js 44 bytes <{1}> [rendered] - > [3] ./c.js 1:0-52 -[0] ./d.js 22 bytes {3} [depth 2] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[1] ./e.js 22 bytes {3} [depth 2] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[2] ./b.js 22 bytes {0} [depth 1] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[3] ./c.js 54 bytes {1} [depth 1] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[4] ./index.js 51 bytes {2} [depth 0] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[5] ./a.js 22 bytes {2} [depth 1] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module \ No newline at end of file diff --git a/test/statsCases/preset-errors-only-error/expected.txt b/test/statsCases/preset-errors-only-error/expected.txt deleted file mode 100644 index 3ad717ffe..000000000 --- a/test/statsCases/preset-errors-only-error/expected.txt +++ /dev/null @@ -1,4 +0,0 @@ - -ERROR in ./index.js -Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/preset-errors-only-error' - @ ./index.js 1:0-25 \ No newline at end of file diff --git a/test/statsCases/preset-errors-only/expected.txt b/test/statsCases/preset-errors-only/expected.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/statsCases/preset-minimal-simple/expected.txt b/test/statsCases/preset-minimal-simple/expected.txt deleted file mode 100644 index 2ba6dec13..000000000 --- a/test/statsCases/preset-minimal-simple/expected.txt +++ /dev/null @@ -1 +0,0 @@ - 1 module \ No newline at end of file diff --git a/test/statsCases/preset-minimal/expected.txt b/test/statsCases/preset-minimal/expected.txt deleted file mode 100644 index fb8d2244f..000000000 --- a/test/statsCases/preset-minimal/expected.txt +++ /dev/null @@ -1 +0,0 @@ - 6 modules \ No newline at end of file diff --git a/test/statsCases/preset-mixed-array/expected.txt b/test/statsCases/preset-mixed-array/expected.txt deleted file mode 100644 index 119f7a1be..000000000 --- a/test/statsCases/preset-mixed-array/expected.txt +++ /dev/null @@ -1,5 +0,0 @@ -Child minimal: - 1 module -Child verbose: - Entrypoint main = main.js - [0] ./index.js 8 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/preset-none-array/expected.txt b/test/statsCases/preset-none-array/expected.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/statsCases/preset-none-error/expected.txt b/test/statsCases/preset-none-error/expected.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/statsCases/preset-none/expected.txt b/test/statsCases/preset-none/expected.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt deleted file mode 100644 index a3ff9d555..000000000 --- a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt +++ /dev/null @@ -1,29 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 182 bytes 0 [emitted] - 1.js 319 bytes 1 [emitted] - main.js 300 KiB 2 [emitted] [big] main - 3.js 257 bytes 3 [emitted] - 0.js.map 156 bytes 0 [emitted] - 1.js.map 197 bytes 1 [emitted] -main.js.map 1.72 MiB 2 [emitted] main - 3.js.map 214 bytes 3 [emitted] -Entrypoint main [big] = main.js main.js.map -[0] ./d.js 22 bytes {3} [built] -[1] ./e.js 22 bytes {3} [built] -[2] ./b.js 22 bytes {0} [built] -[3] ./c.js 54 bytes {1} [built] -[4] ./index.js 52 bytes {2} [built] -[5] ./a.js 293 KiB {2} [built] - -WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). -This can impact web performance. -Assets: - main.js (300 KiB) - -WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. -Entrypoints: - main (300 KiB) - main.js - \ No newline at end of file diff --git a/test/statsCases/preset-normal-performance/expected.txt b/test/statsCases/preset-normal-performance/expected.txt deleted file mode 100644 index 3054babb3..000000000 --- a/test/statsCases/preset-normal-performance/expected.txt +++ /dev/null @@ -1,25 +0,0 @@ -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 300 KiB 2 [emitted] [big] main - 3.js 227 bytes 3 [emitted] -Entrypoint main [big] = main.js -[0] ./d.js 22 bytes {3} [built] -[1] ./e.js 22 bytes {3} [built] -[2] ./b.js 22 bytes {0} [built] -[3] ./c.js 54 bytes {1} [built] -[4] ./index.js 52 bytes {2} [built] -[5] ./a.js 293 KiB {2} [built] - -WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). -This can impact web performance. -Assets: - main.js (300 KiB) - -WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. -Entrypoints: - main (300 KiB) - main.js - \ No newline at end of file diff --git a/test/statsCases/preset-normal/expected.txt b/test/statsCases/preset-normal/expected.txt deleted file mode 100644 index 89ef4e41f..000000000 --- a/test/statsCases/preset-normal/expected.txt +++ /dev/null @@ -1,15 +0,0 @@ -Hash: 5a6d9c01f46a5330eee6 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 7.28 KiB 2 [emitted] main - 3.js 227 bytes 3 [emitted] -Entrypoint main = main.js -[0] ./d.js 22 bytes {3} [built] -[1] ./e.js 22 bytes {3} [built] -[2] ./b.js 22 bytes {0} [built] -[3] ./c.js 54 bytes {1} [built] -[4] ./index.js 51 bytes {2} [built] -[5] ./a.js 22 bytes {2} [built] \ No newline at end of file diff --git a/test/statsCases/preset-verbose/expected.txt b/test/statsCases/preset-verbose/expected.txt deleted file mode 100644 index 5f0db8b99..000000000 --- a/test/statsCases/preset-verbose/expected.txt +++ /dev/null @@ -1,41 +0,0 @@ -Hash: 5a6d9c01f46a5330eee6 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names - 0.js 152 bytes 0 [emitted] - 1.js 289 bytes 1 [emitted] -main.js 7.28 KiB 2 [emitted] main - 3.js 227 bytes 3 [emitted] -Entrypoint main = main.js -chunk {0} 0.js 22 bytes <{2}> [rendered] - > ./b [4] ./index.js 2:0-16 - [2] ./b.js 22 bytes {0} [depth 1] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module - amd require ./b [4] ./index.js 2:0-16 - [4] Xms -> factory:Xms building:Xms = Xms -chunk {1} 1.js 54 bytes <{2}> >{3}< [rendered] - > ./c [4] ./index.js 3:0-16 - [3] ./c.js 54 bytes {1} [depth 1] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module - amd require ./c [4] ./index.js 3:0-16 - [4] Xms -> factory:Xms building:Xms = Xms -chunk {2} main.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] - > ./index main - [4] ./index.js 51 bytes {2} [depth 0] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module - single entry ./index main - factory:Xms building:Xms = Xms - [5] ./a.js 22 bytes {2} [depth 1] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module - cjs require ./a [4] ./index.js 1:0-14 - [4] Xms -> factory:Xms building:Xms = Xms -chunk {3} 3.js 44 bytes <{1}> [rendered] - > [3] ./c.js 1:0-52 - [0] ./d.js 22 bytes {3} [depth 2] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module - require.ensure item ./d [3] ./c.js 1:0-52 - [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms - [1] ./e.js 22 bytes {3} [depth 2] [built] - ModuleConcatenation bailout: Module is not an ECMAScript module - require.ensure item ./e [3] ./c.js 1:0-52 - [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/resolve-plugin-context/expected.txt b/test/statsCases/resolve-plugin-context/expected.txt deleted file mode 100644 index ee27654fc..000000000 --- a/test/statsCases/resolve-plugin-context/expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hash: 47eae06ebcb26f6b883a -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -bundle.js 3.01 KiB 0 [emitted] main -Entrypoint main = bundle.js -[0] ./node_modules/xyz/index.js 0 bytes {0} [built] -[1] ./index.js 48 bytes {0} [built] -[2] ./node_modules/abc/index.js 16 bytes {0} [built] -[3] ./node_modules/def/index.js 16 bytes {0} [built] -[4] ./node_modules/def/node_modules/xyz/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/reverse-sort-modules/expected.txt b/test/statsCases/reverse-sort-modules/expected.txt deleted file mode 100644 index 4eb744a13..000000000 --- a/test/statsCases/reverse-sort-modules/expected.txt +++ /dev/null @@ -1,27 +0,0 @@ -Hash: c5cf5ab0cc0a404f1acf -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -main.js 5.85 KiB 0 [emitted] main -Entrypoint main = main.js -[29] ./c.js?10 33 bytes {0} [built] -[27] ./c.js?9 33 bytes {0} [built] -[25] ./c.js?8 33 bytes {0} [built] -[23] ./c.js?7 33 bytes {0} [built] -[19] ./c.js?5 33 bytes {0} [built] -[17] ./c.js?4 33 bytes {0} [built] -[15] ./c.js?3 33 bytes {0} [built] -[13] ./c.js?2 33 bytes {0} [built] -[11] ./c.js?1 33 bytes {0} [built] -[10] ./index.js 181 bytes {0} [built] - [9] ./a.js?10 33 bytes {0} [built] - [8] ./a.js?9 33 bytes {0} [built] - [7] ./a.js?8 33 bytes {0} [built] - [6] ./a.js?7 33 bytes {0} [built] - [5] ./a.js?6 33 bytes {0} [built] - [4] ./a.js?5 33 bytes {0} [built] - [3] ./a.js?4 33 bytes {0} [built] - [2] ./a.js?3 33 bytes {0} [built] - [1] ./a.js?2 33 bytes {0} [built] - [0] ./a.js?1 33 bytes {0} [built] - + 11 hidden modules \ No newline at end of file diff --git a/test/statsCases/runtime-chunk-integration/b.js b/test/statsCases/runtime-chunk-integration/b.js new file mode 100644 index 000000000..eff703ff4 --- /dev/null +++ b/test/statsCases/runtime-chunk-integration/b.js @@ -0,0 +1 @@ +export default "b"; diff --git a/test/statsCases/runtime-chunk-integration/c.js b/test/statsCases/runtime-chunk-integration/c.js new file mode 100644 index 000000000..5d50db5bc --- /dev/null +++ b/test/statsCases/runtime-chunk-integration/c.js @@ -0,0 +1 @@ +export default "c"; diff --git a/test/statsCases/runtime-chunk-integration/d.js b/test/statsCases/runtime-chunk-integration/d.js new file mode 100644 index 000000000..987d6d7e4 --- /dev/null +++ b/test/statsCases/runtime-chunk-integration/d.js @@ -0,0 +1 @@ +export default "d"; diff --git a/test/statsCases/runtime-chunk-integration/f.js b/test/statsCases/runtime-chunk-integration/f.js new file mode 100644 index 000000000..657d4dee8 --- /dev/null +++ b/test/statsCases/runtime-chunk-integration/f.js @@ -0,0 +1 @@ +export default "f"; diff --git a/test/statsCases/runtime-chunk-integration/main1.js b/test/statsCases/runtime-chunk-integration/main1.js new file mode 100644 index 000000000..5029ffe63 --- /dev/null +++ b/test/statsCases/runtime-chunk-integration/main1.js @@ -0,0 +1,5 @@ +import("./b"); +import("./c"); +import("./d"); + +export default "a"; diff --git a/test/statsCases/runtime-chunk-integration/webpack.config.js b/test/statsCases/runtime-chunk-integration/webpack.config.js new file mode 100644 index 000000000..6ee9324a2 --- /dev/null +++ b/test/statsCases/runtime-chunk-integration/webpack.config.js @@ -0,0 +1,44 @@ +const MinChunkSizePlugin = require("../../../lib/optimize/MinChunkSizePlugin"); + +const baseConfig = { + mode: "production", + target: "web", + output: { + filename: "[name].js" + }, + stats: { + hash: false, + timings: false, + builtAt: false + }, + plugins: [ + new MinChunkSizePlugin({ + minChunkSize: 1000 + }) + ] +}; + +const withoutNamedEntry = Object.assign({}, baseConfig, { + name: "base", + entry: { + main1: "./main1" + }, + optimization: { + runtimeChunk: "single" + } +}); + +const withNamedEntry = Object.assign({}, baseConfig, { + name: "manifest is named entry", + entry: { + main1: "./main1", + manifest: "./f" + }, + optimization: { + runtimeChunk: { + name: "manifest" + } + } +}); + +module.exports = [withoutNamedEntry, withNamedEntry]; diff --git a/test/statsCases/runtime-chunk-single/expected.txt b/test/statsCases/runtime-chunk-single/expected.txt deleted file mode 100644 index 77f5b8296..000000000 --- a/test/statsCases/runtime-chunk-single/expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -Entrypoint e1 = runtime.js e1.js -Entrypoint e2 = runtime.js e2.js \ No newline at end of file diff --git a/test/statsCases/runtime-chunk/expected.txt b/test/statsCases/runtime-chunk/expected.txt deleted file mode 100644 index 0eb0020bc..000000000 --- a/test/statsCases/runtime-chunk/expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -Entrypoint e1 = runtime~e1.js e1.js -Entrypoint e2 = runtime~e2.js e2.js \ No newline at end of file diff --git a/test/statsCases/scope-hoisting-bailouts/expected.txt b/test/statsCases/scope-hoisting-bailouts/expected.txt deleted file mode 100644 index 93abd0711..000000000 --- a/test/statsCases/scope-hoisting-bailouts/expected.txt +++ /dev/null @@ -1,29 +0,0 @@ -Hash: ee60eae5100628922748 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT -Entrypoint index = index.js -Entrypoint entry = entry.js -[0] ./entry.js 32 bytes {1} {2} [built] - ModuleConcatenation bailout: Module is an entry point -[1] ./ref-from-cjs.js 45 bytes {1} [built] - ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./cjs.js (referenced with cjs require) -[2] external "external" 42 bytes {1} [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[3] ./concatenated.js + 2 modules 116 bytes {0} [built] - ModuleConcatenation bailout: Cannot concat with external "external" (<- Module is not an ECMAScript module) - | ./concatenated.js 26 bytes [built] - | ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./index.js (referenced with import()) - | ./concatenated1.js 37 bytes [built] - | ./concatenated2.js 48 bytes [built] -[4] ./index.js 176 bytes {1} [built] - ModuleConcatenation bailout: Module is an entry point -[5] ./cjs.js 59 bytes {1} [built] - ModuleConcatenation bailout: Module is not an ECMAScript module -[6] ./eval.js 35 bytes {1} [built] - ModuleConcatenation bailout: Module uses eval() -[7] ./injected-vars.js 40 bytes {1} [built] - ModuleConcatenation bailout: Module uses injected variables (__dirname, __filename) -[8] ./module-id.js 26 bytes {1} [built] - ModuleConcatenation bailout: Module uses module.id -[9] ./module-loaded.js 30 bytes {1} [built] - ModuleConcatenation bailout: Module uses module.loaded \ No newline at end of file diff --git a/test/statsCases/scope-hoisting-multi/expected.txt b/test/statsCases/scope-hoisting-multi/expected.txt deleted file mode 100644 index 93efc61d5..000000000 --- a/test/statsCases/scope-hoisting-multi/expected.txt +++ /dev/null @@ -1,44 +0,0 @@ -Hash: 33704ebeb245a82a7e824bf53c5eb877060bfd4d -Child - Hash: 33704ebeb245a82a7e82 - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Entrypoint first = vendor.js first.js - Entrypoint second = vendor.js second.js - [0] ./common_lazy_shared.js 25 bytes {0} {1} {2} [built] - [1] ./common2.js 25 bytes {4} {5} [built] - [2] ./common_lazy.js 25 bytes {1} {2} [built] - [3] ./common.js 37 bytes {4} {5} [built] - [4] ./lazy_shared.js 31 bytes {0} [built] - [5] ./vendor.js 25 bytes {3} [built] - [6] ./lazy_first.js 55 bytes {2} [built] - [7] ./lazy_second.js 55 bytes {1} [built] - [8] ./first.js 207 bytes {4} [built] - [9] ./module_first.js 31 bytes {4} [built] - [10] ./second.js 177 bytes {5} [built] -Child - Hash: 4bf53c5eb877060bfd4d - Time: Xms - Built at: Thu Jan 01 1970 00:00:00 GMT - Entrypoint first = vendor.js first.js - Entrypoint second = vendor.js second.js - [0] ./common_lazy_shared.js 25 bytes {0} {1} {2} [built] - [1] ./common_lazy.js 25 bytes {1} {2} [built] - [2] ./common.js + 1 modules 62 bytes {4} {5} [built] - | ./common.js 37 bytes [built] - | ./common2.js 25 bytes [built] - [3] ./vendor.js 25 bytes {3} [built] - [4] ./lazy_shared.js 31 bytes {0} [built] - ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()), ./second.js (referenced with import()) - [5] ./lazy_second.js 55 bytes {1} [built] - ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./second.js (referenced with import()) - [6] ./second.js 177 bytes {5} [built] - ModuleConcatenation bailout: Module is an entry point - [7] ./first.js + 1 modules 248 bytes {4} [built] - ModuleConcatenation bailout: Cannot concat with ./common.js - ModuleConcatenation bailout: Cannot concat with ./vendor.js - | ./first.js 207 bytes [built] - | ModuleConcatenation bailout: Module is an entry point - | ./module_first.js 31 bytes [built] - [8] ./lazy_first.js 55 bytes {2} [built] - ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()) \ No newline at end of file diff --git a/test/statsCases/simple-more-info/expected.txt b/test/statsCases/simple-more-info/expected.txt deleted file mode 100644 index 49e2bef32..000000000 --- a/test/statsCases/simple-more-info/expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hash: ee367da3e170c28a39bf -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -bundle.js 2.61 KiB 0 [emitted] main -Entrypoint main = bundle.js -[0] ./index.js 0 bytes {0} [built] - single entry ./index main - factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/simple/expected.txt b/test/statsCases/simple/expected.txt deleted file mode 100644 index e48aa187f..000000000 --- a/test/statsCases/simple/expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Hash: 18342b523b0aca4784a6 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -bundle.js 2.78 KiB main [emitted] main -Entrypoint main = bundle.js -[./index.js] 0 bytes {main} [built] \ No newline at end of file diff --git a/test/statsCases/split-chunks-combinations/expected.txt b/test/statsCases/split-chunks-combinations/expected.txt deleted file mode 100644 index 2debb7214..000000000 --- a/test/statsCases/split-chunks-combinations/expected.txt +++ /dev/null @@ -1,35 +0,0 @@ -Entrypoint main = main.js -chunk {0} async-a~async-b.js (async-a~async-b) 134 bytes <{8}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) - > ./a [9] ./index.js 1:0-47 - > ./b [9] ./index.js 2:0-47 - [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] - [1] ./y.js 67 bytes {0} [built] -chunk {1} async-a.js (async-a) 48 bytes <{8}> ={0}= [rendered] - > ./a [9] ./index.js 1:0-47 - [2] ./a.js 48 bytes {1} [built] -chunk {2} async-b.js (async-b) 48 bytes <{8}> ={0}= [rendered] - > ./b [9] ./index.js 2:0-47 - [3] ./b.js 48 bytes {2} [built] -chunk {3} async-c.js (async-c) 101 bytes <{8}> [rendered] - > ./c [9] ./index.js 3:0-47 - [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] - [4] ./c.js 34 bytes {3} [built] -chunk {4} async-d.js (async-d) 101 bytes <{8}> [rendered] - > ./d [9] ./index.js 4:0-47 - [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] - [5] ./d.js 34 bytes {4} [built] -chunk {5} async-e.js (async-e) 101 bytes <{8}> [rendered] - > ./e [9] ./index.js 5:0-47 - [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] - [6] ./e.js 34 bytes {5} [built] -chunk {6} async-f.js (async-f) 101 bytes <{8}> [rendered] - > ./f [9] ./index.js 6:0-47 - [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] - [7] ./f.js 34 bytes {6} [built] -chunk {7} async-g.js (async-g) 101 bytes <{8}> [rendered] - > ./g [9] ./index.js 7:0-47 - [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] - [8] ./g.js 34 bytes {7} [built] -chunk {8} main.js (main) 343 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] - > ./ main - [9] ./index.js 343 bytes {8} [built] \ No newline at end of file diff --git a/test/statsCases/split-chunks-issue-6413/expected.txt b/test/statsCases/split-chunks-issue-6413/expected.txt deleted file mode 100644 index c97025236..000000000 --- a/test/statsCases/split-chunks-issue-6413/expected.txt +++ /dev/null @@ -1,23 +0,0 @@ -Entrypoint main = main.js -chunk {0} vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{5}> ={1}= ={2}= ={3}= ={4}= [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) - > ./a [5] ./index.js 1:0-47 - > ./b [5] ./index.js 2:0-47 - > ./c [5] ./index.js 3:0-47 - [1] ./node_modules/x.js 20 bytes {0} [built] -chunk {1} async-a~async-b~async-c.js (async-a~async-b~async-c) 11 bytes <{5}> ={0}= ={2}= ={3}= ={4}= [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) - > ./a [5] ./index.js 1:0-47 - > ./b [5] ./index.js 2:0-47 - > ./c [5] ./index.js 3:0-47 - [0] ./common.js 11 bytes {1} [built] -chunk {2} async-a.js (async-a) 19 bytes <{5}> ={0}= ={1}= [rendered] - > ./a [5] ./index.js 1:0-47 - [2] ./a.js 19 bytes {2} [built] -chunk {3} async-b.js (async-b) 19 bytes <{5}> ={0}= ={1}= [rendered] - > ./b [5] ./index.js 2:0-47 - [3] ./b.js 19 bytes {3} [built] -chunk {4} async-c.js (async-c) 19 bytes <{5}> ={0}= ={1}= [rendered] - > ./c [5] ./index.js 3:0-47 - [4] ./c.js 19 bytes {4} [built] -chunk {5} main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] - > ./ main - [5] ./index.js 147 bytes {5} [built] \ No newline at end of file diff --git a/test/statsCases/split-chunks-issue-6696/expected.txt b/test/statsCases/split-chunks-issue-6696/expected.txt deleted file mode 100644 index 6f6eb840d..000000000 --- a/test/statsCases/split-chunks-issue-6696/expected.txt +++ /dev/null @@ -1,15 +0,0 @@ -Entrypoint main = vendors.js main.js -chunk {0} async-a.js (async-a) 32 bytes <{2}> <{3}> [rendered] - > ./a [3] ./index.js 2:0-47 - [0] ./node_modules/x.js 20 bytes {0} {1} [built] - [1] ./a.js 12 bytes {0} [built] -chunk {1} async-b.js (async-b) 32 bytes <{2}> <{3}> [rendered] - > ./b [3] ./index.js 3:0-47 - [0] ./node_modules/x.js 20 bytes {0} {1} [built] - [2] ./b.js 12 bytes {1} [built] -chunk {2} main.js (main) 110 bytes ={3}= >{0}< >{1}< [entry] [rendered] - > ./ main - [3] ./index.js 110 bytes {2} [built] -chunk {3} vendors.js (vendors) 20 bytes ={2}= >{0}< >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) - > ./ main - [4] ./node_modules/y.js 20 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/split-chunks-prefer-bigger-splits/expected.txt b/test/statsCases/split-chunks-prefer-bigger-splits/expected.txt deleted file mode 100644 index 4d49ccaae..000000000 --- a/test/statsCases/split-chunks-prefer-bigger-splits/expected.txt +++ /dev/null @@ -1,21 +0,0 @@ -Entrypoint main = default/main.js -chunk {0} default/async-b~async-c.js (async-b~async-c) 110 bytes <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) (name: async-b~async-c) - > ./b [6] ./index.js 2:0-47 - > ./c [6] ./index.js 3:0-47 - [0] ./d.js 43 bytes {0} {1} [built] - [2] ./f.js 67 bytes {0} [built] -chunk {1} default/async-a.js (async-a) 134 bytes <{4}> [rendered] - > ./a [6] ./index.js 1:0-47 - [0] ./d.js 43 bytes {0} {1} [built] - [1] ./e.js 43 bytes {1} {2} [built] - [3] ./a.js 48 bytes {1} [built] -chunk {2} default/async-b.js (async-b) 105 bytes <{4}> ={0}= [rendered] - > ./b [6] ./index.js 2:0-47 - [1] ./e.js 43 bytes {1} {2} [built] - [4] ./b.js 62 bytes {2} [built] -chunk {3} default/async-c.js (async-c) 48 bytes <{4}> ={0}= [rendered] - > ./c [6] ./index.js 3:0-47 - [5] ./c.js 48 bytes {3} [built] -chunk {4} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] - > ./ main - [6] ./index.js 147 bytes {4} [built] \ No newline at end of file diff --git a/test/statsCases/split-chunks/expected.txt b/test/statsCases/split-chunks/expected.txt deleted file mode 100644 index 154a23943..000000000 --- a/test/statsCases/split-chunks/expected.txt +++ /dev/null @@ -1,385 +0,0 @@ -Child default: - Entrypoint main = default/main.js - Entrypoint a = default/a.js - Entrypoint b = default/b.js - Entrypoint c = default/c.js - chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {4} [built] - chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] - > ./a [8] ./index.js 1:0-47 - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [5] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] - > ./c [8] ./index.js 3:0-47 - [6] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) - > ./c [8] ./index.js 3:0-47 - [4] ./node_modules/z.js 20 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} default/b.js (b) 152 bytes [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [2] ./f.js 20 bytes {2} {11} {12} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [5] ./b.js 72 bytes {6} {11} [built] - chunk {12} default/c.js (c) 152 bytes [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [2] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./node_modules/z.js 20 bytes {8} {12} [built] - [6] ./c.js 72 bytes {7} {12} [built] -Child all-chunks: - Entrypoint main = default/main.js - Entrypoint a = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a.js - Entrypoint b = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/b.js - Entrypoint c = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js - chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) - > ./a a - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} default/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g~b~c.js (async-b~async-c~async-g~b~c) 20 bytes <{0}> <{1}> <{10}> <{3}> <{8}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={6}= ={7}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~b~c) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) - > ./a a - > ./b b - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) - > ./c c - > ./c [8] ./index.js 3:0-47 - [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{8}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] - > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/a~async-a.js (a~async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: a~async-a) - > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {6} {11} [built] - chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {7} {12} [built] -Child manual: - Entrypoint main = default/main.js - Entrypoint a = default/vendors.js default/a.js - Entrypoint b = default/vendors.js default/b.js - Entrypoint c = default/vendors.js default/c.js - chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) - > ./a a - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - [3] ./node_modules/y.js 20 bytes {0} [built] - [6] ./node_modules/z.js 20 bytes {0} [built] - [10] multi x y z 52 bytes {0} [built] - chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [9] ./g.js 34 bytes {1} [built] - chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] - > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] - > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] - chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {5} [built] - chunk {6} default/a.js (a) 176 bytes ={0}= >{1}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] -Child name-too-long: - Entrypoint main = main.js - Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js - Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js - Entrypoint cccccccccccccccccccccccccccccc = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~async-c~cccccccccccccccccccccccccccccc.js cccccccccccccccccccccccccccccc.js - chunk {0} vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js (vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f) - > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - > ./c cccccccccccccccccccccccccccccc - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js (async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc) 20 bytes <{0}> <{1}> <{10}> <{3}> <{8}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={6}= ={7}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) - > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} vendors~async-c~cccccccccccccccccccccccccccccc.js (vendors~async-c~cccccccccccccccccccccccccccccc) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~cccccccccccccccccccccccccccccc) - > ./c cccccccccccccccccccccccccccccc - > ./c [8] ./index.js 3:0-47 - [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{8}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {6} {11} [built] - chunk {7} async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] - > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {7} {12} [built] - chunk {8} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a) - > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {9} main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] - > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {8} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 112 bytes ={0}= ={3}= [entry] [rendered] - > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {6} {11} [built] - chunk {12} cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 112 bytes ={0}= ={4}= [entry] [rendered] - > ./c cccccccccccccccccccccccccccccc - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {7} {12} [built] -Child custom-chunks-filter: - Entrypoint main = default/main.js - Entrypoint a = default/a.js - Entrypoint b = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-a~async-b~b.js default/b.js - Entrypoint c = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js - chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c~b~c) - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} {10} [built] - chunk {1} default/async-a~async-b~async-c~b~c.js (async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c~b~c) - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g~b~c.js (async-b~async-c~async-g~b~c) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~b~c) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~b) - > ./b b - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} {10} [built] - chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) - > ./c c - > ./c [8] ./index.js 3:0-47 - [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] - > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] - > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] - > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{5}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [2] ./node_modules/x.js 20 bytes {0} {10} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} [built] - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] - chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] -Child custom-chunks-filter-in-cache-groups: - Entrypoint main = default/main.js - Entrypoint a = default/a.js - Entrypoint b = default/vendors.js default/b.js - Entrypoint c = default/vendors.js default/c.js - chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} {6} [built] - [3] ./node_modules/y.js 20 bytes {0} {6} [built] - [6] ./node_modules/z.js 20 bytes {0} [built] - [10] multi x y z 52 bytes {0} [built] - chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [9] ./g.js 34 bytes {1} [built] - chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] - > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] - > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] - chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {5} [built] - chunk {6} default/a.js (a) 216 bytes >{1}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [2] ./node_modules/x.js 20 bytes {0} {6} [built] - [3] ./node_modules/y.js 20 bytes {0} {6} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] \ No newline at end of file diff --git a/test/statsCases/split-chunks/webpack.config.js b/test/statsCases/split-chunks/webpack.config.js index f69088f4c..5172e72b5 100644 --- a/test/statsCases/split-chunks/webpack.config.js +++ b/test/statsCases/split-chunks/webpack.config.js @@ -94,6 +94,7 @@ module.exports = [ optimization: { splitChunks: { minSize: 0, + maxInitialRequests: Infinity, chunks: "all" } }, diff --git a/test/statsCases/tree-shaking/expected.txt b/test/statsCases/tree-shaking/expected.txt deleted file mode 100644 index 8e593d527..000000000 --- a/test/statsCases/tree-shaking/expected.txt +++ /dev/null @@ -1,34 +0,0 @@ -Hash: 6877ac726b04eb5d7985 -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -bundle.js 7.27 KiB 0 [emitted] main -Entrypoint main = bundle.js - [0] ./a.js 13 bytes {0} [built] - [exports: a] - [all exports used] - [1] ./b.js 13 bytes {0} [built] - [exports: b] - [no exports used] - [2] ./unknown.js 0 bytes {0} [built] - [only some exports used: c] - [3] ./unknown2.js 0 bytes {0} [built] - [only some exports used: y] - [4] ./index.js 315 bytes {0} [built] - [no exports] - [5] ./require.include.js 36 bytes {0} [built] - [exports: a, default] - [no exports used] - [6] ./reexport-known.js 49 bytes {0} [built] - [exports: a, b] - [only some exports used: a] - [7] ./reexport-star-known.js 41 bytes {0} [built] - [exports: a, b] - [only some exports used: a] - [8] ./edge.js 45 bytes {0} [built] - [only some exports used: y] - [9] ./reexport-unknown.js 83 bytes {0} [built] - [exports: a, b, c, d] - [only some exports used: a, c] -[10] ./reexport-star-unknown.js 68 bytes {0} [built] - [only some exports used: a, c] \ No newline at end of file diff --git a/test/statsCases/warnings-uglifyjs/expected.txt b/test/statsCases/warnings-uglifyjs/expected.txt deleted file mode 100644 index 41e24319d..000000000 --- a/test/statsCases/warnings-uglifyjs/expected.txt +++ /dev/null @@ -1,16 +0,0 @@ -Hash: 5f08c421d55ae2ad3d0e -Time: Xms -Built at: Thu Jan 01 1970 00:00:00 GMT - Asset Size Chunks Chunk Names -bundle.js 2.19 KiB 0 [emitted] main -Entrypoint main = bundle.js -[0] ./index.js 299 bytes {0} [built] -[1] ./a.js 249 bytes {0} [built] -[2] (webpack)/buildin/module.js 497 bytes {0} [built] - -WARNING in bundle.js from UglifyJs -Dropping unused function someUnRemoteUsedFunction1 [./a.js:3,0] -Dropping unused function someUnRemoteUsedFunction2 [./a.js:4,0] -Dropping unused function someUnRemoteUsedFunction3 [./a.js:5,0] -Dropping unused function someUnRemoteUsedFunction4 [./a.js:6,0] -Dropping unused function someUnRemoteUsedFunction5 [./a.js:7,0] \ No newline at end of file diff --git a/test/watchCases/cache/child-compilation-cache/0/index.js b/test/watchCases/cache/child-compilation-cache/0/index.js index ff83fe133..20702978c 100644 --- a/test/watchCases/cache/child-compilation-cache/0/index.js +++ b/test/watchCases/cache/child-compilation-cache/0/index.js @@ -2,13 +2,13 @@ it("should use correct caches in compilation and child compilations", function() var x = require("./report-cache-counters-loader!./changing-file"); switch(WATCH_STEP) { case "0": - x.should.be.eql([1, 1]); + expect(x).toEqual([1, 1]); break; case "1": - x.should.be.eql([2, 1]); + expect(x).toEqual([2, 1]); break; case "2": - x.should.be.eql([3, 2]); + expect(x).toEqual([3, 2]); break; default: throw new Error("Not handled step"); diff --git a/test/watchCases/context/delete-in-context/0/index.js b/test/watchCases/context/delete-in-context/0/index.js index c6636e736..329d5b1af 100644 --- a/test/watchCases/context/delete-in-context/0/index.js +++ b/test/watchCases/context/delete-in-context/0/index.js @@ -1,4 +1,4 @@ it("should detect changes in a context", function() { var context = require.context("./directory"); - context.keys().length.should.be.eql((+WATCH_STEP) % 3 * 2); + expect(context.keys().length).toBe((+WATCH_STEP) % 3 * 2); }); diff --git a/test/watchCases/parsing/caching-harmony/0/index.js b/test/watchCases/parsing/caching-harmony/0/index.js index d14e2bd24..b03dc33d8 100644 --- a/test/watchCases/parsing/caching-harmony/0/index.js +++ b/test/watchCases/parsing/caching-harmony/0/index.js @@ -2,13 +2,13 @@ import m from "./module"; import cm from "./changing-module"; it("should flag harmony modules correctly", function() { - m.should.be.eql("module" + WATCH_STEP); + expect(m).toBe("module" + WATCH_STEP); switch(WATCH_STEP) { case "0": - cm.should.be.eql("original"); + expect(cm).toBe("original"); break; case "1": - cm.should.be.eql("change"); + expect(cm).toBe("change"); break; } }); diff --git a/test/watchCases/parsing/switching-harmony/0/index.js b/test/watchCases/parsing/switching-harmony/0/index.js index 757a543f7..fedfe818b 100644 --- a/test/watchCases/parsing/switching-harmony/0/index.js +++ b/test/watchCases/parsing/switching-harmony/0/index.js @@ -4,20 +4,20 @@ import ch from "./ch"; import cc from "./cc"; it("should flag modules correctly", function() { - hh.should.be.eql("hh" + WATCH_STEP); - cc.should.be.eql("cc" + WATCH_STEP); - hc.should.be.eql("hc" + WATCH_STEP); - ch.should.be.eql("ch" + WATCH_STEP); - require("./hh").default.should.be.eql("hh" + WATCH_STEP); - require("./cc").should.be.eql("cc" + WATCH_STEP); + expect(hh).toBe("hh" + WATCH_STEP); + expect(cc).toBe("cc" + WATCH_STEP); + expect(hc).toBe("hc" + WATCH_STEP); + expect(ch).toBe("ch" + WATCH_STEP); + expect(require("./hh").default).toBe("hh" + WATCH_STEP); + expect(require("./cc")).toBe("cc" + WATCH_STEP); switch(WATCH_STEP) { case "0": - require("./hc").default.should.be.eql("hc0"); - require("./ch").should.be.eql("ch0"); + expect(require("./hc").default).toBe("hc0"); + expect(require("./ch")).toBe("ch0"); break; case "1": - require("./hc").should.be.eql("hc1"); - require("./ch").default.should.be.eql("ch1"); + expect(require("./hc")).toBe("hc1"); + expect(require("./ch").default).toBe("ch1"); break; } }); diff --git a/test/watchCases/plugins/automatic-prefetch-plugin/0/index.js b/test/watchCases/plugins/automatic-prefetch-plugin/0/index.js index 37be56141..1af08ab64 100644 --- a/test/watchCases/plugins/automatic-prefetch-plugin/0/index.js +++ b/test/watchCases/plugins/automatic-prefetch-plugin/0/index.js @@ -1,7 +1,7 @@ it("should watch for changes", function() { - require("./foo/" + WATCH_STEP).should.be.eql('This is only a test.' + WATCH_STEP); + expect(require("./foo/" + WATCH_STEP)).toBe('This is only a test.' + WATCH_STEP); if(+WATCH_STEP > 0) { for(var m of STATS_JSON.modules.filter(m => /(a|b|c)\.js$/.test(m.identifier))) - m.prefetched.should.be.true(); + expect(m.prefetched).toBe(true); } }); diff --git a/test/watchCases/plugins/dll-reference-plugin/1/index.js b/test/watchCases/plugins/dll-reference-plugin/1/index.js index 4f865d5f4..2bbc3fd55 100644 --- a/test/watchCases/plugins/dll-reference-plugin/1/index.js +++ b/test/watchCases/plugins/dll-reference-plugin/1/index.js @@ -1,5 +1,5 @@ import value from "dll/module"; it("should have the correct default export", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/watchCases/plugins/dll-reference-plugin/2/index.js b/test/watchCases/plugins/dll-reference-plugin/2/index.js index 0b849002c..518aca8e3 100644 --- a/test/watchCases/plugins/dll-reference-plugin/2/index.js +++ b/test/watchCases/plugins/dll-reference-plugin/2/index.js @@ -1,5 +1,5 @@ import value from "dll/module"; it("should have still the correct default export", function() { - value.should.be.eql("ok"); + expect(value).toBe("ok"); }); diff --git a/test/watchCases/plugins/module-concatenation-plugin/0/index.js b/test/watchCases/plugins/module-concatenation-plugin/0/index.js index 0f5849666..43d5e57af 100644 --- a/test/watchCases/plugins/module-concatenation-plugin/0/index.js +++ b/test/watchCases/plugins/module-concatenation-plugin/0/index.js @@ -1,13 +1,13 @@ it("should watch for changes", function() { if(WATCH_STEP === '0') { - require("./foo/" + WATCH_STEP).should.be.eql('This is only a test.' + WATCH_STEP); + expect(require("./foo/" + WATCH_STEP)).toBe('This is only a test.' + WATCH_STEP); } else if(WATCH_STEP === '1') { - require("./foo/" + WATCH_STEP).should.be.eql('This should be a test.' + WATCH_STEP); + expect(require("./foo/" + WATCH_STEP)).toBe('This should be a test.' + WATCH_STEP); } else if(WATCH_STEP === '2') { - require("./foo/" + WATCH_STEP).should.be.eql('This should be working.' + WATCH_STEP); + expect(require("./foo/" + WATCH_STEP)).toBe('This should be working.' + WATCH_STEP); } - STATS_JSON.modules.length.should.equal(4 + Number(WATCH_STEP)); + expect(STATS_JSON.modules.length).toBe(4 + Number(WATCH_STEP)); }); diff --git a/test/watchCases/plugins/watch-ignore-plugin/0/index.js b/test/watchCases/plugins/watch-ignore-plugin/0/index.js index 4de0349c5..d11053521 100644 --- a/test/watchCases/plugins/watch-ignore-plugin/0/index.js +++ b/test/watchCases/plugins/watch-ignore-plugin/0/index.js @@ -2,7 +2,7 @@ import value from "./file" import a from "./a" const req = require.context("./foo", false, /^.*\.js$/); it("should ignore change to file and directory", function() { - a.should.be.eql(+WATCH_STEP); - req.keys().should.be.deepEqual(["./0.js"]) - value.should.be.eql(1); + expect(a).toBe(+WATCH_STEP); + expect(req.keys()).toEqual(["./0.js"]) + expect(value).toBe(1); }); diff --git a/test/watchCases/recover-from-error/missing-module/0/index.js b/test/watchCases/recover-from-error/missing-module/0/index.js index 43b4f5650..7b32c665c 100644 --- a/test/watchCases/recover-from-error/missing-module/0/index.js +++ b/test/watchCases/recover-from-error/missing-module/0/index.js @@ -1,12 +1,12 @@ it("should recover from missing module", function() { switch(WATCH_STEP) { case "0": - (function() { + expect(function() { require("some-module"); - }).should.throw(); + }).toThrow(); break; case "1": - require("some-module").should.be.eql("ok"); + expect(require("some-module")).toBe("ok"); break; } }); diff --git a/test/watchCases/runtime/dynamic-import/0/index.js b/test/watchCases/runtime/dynamic-import/0/index.js index 094d28192..390ef4b3b 100644 --- a/test/watchCases/runtime/dynamic-import/0/index.js +++ b/test/watchCases/runtime/dynamic-import/0/index.js @@ -1,12 +1,12 @@ it("should change chunkhash of main chunk", function () { const mainChunk = STATS_JSON.chunks.find((chunk) => chunk.names.indexOf("main") !== -1); - (!mainChunk).should.be.false("Main chunk not found"); + expect(mainChunk).toBeDefined(); switch (WATCH_STEP) { case "0": STATE.hash = mainChunk.hash; break; case "1": - mainChunk.hash.should.be.not.eql(STATE.hash); + expect(mainChunk.hash).not.toBe(STATE.hash); break; } }); @@ -17,10 +17,10 @@ it("should load additional chunk", function() { .then((dynamic) => { switch (step) { case "0": - dynamic.default.should.be.eql("Normal"); + expect(dynamic.default).toBe("Normal"); break; case "1": - dynamic.default.should.be.eql("Changed"); + expect(dynamic.default).toBe("Changed"); break; } }); diff --git a/test/watchCases/runtime/static-import/0/index.js b/test/watchCases/runtime/static-import/0/index.js index da9c2eeea..8c54dc798 100644 --- a/test/watchCases/runtime/static-import/0/index.js +++ b/test/watchCases/runtime/static-import/0/index.js @@ -1,26 +1,24 @@ -require("should"); - import * as both from './dynamic-and-static' import * as staticModule from './static' it("should not change chunkhash of manifest chunk", function () { const manifestChunk = STATS_JSON.chunks.find((chunk) => chunk.names.indexOf("runtime~main") !== -1); - (!manifestChunk).should.be.false("Main chunk not found"); + expect(!manifestChunk).toBe(false); switch (WATCH_STEP) { case "0": STATE.hash = manifestChunk.hash; - staticModule.should.be.eql("Normal"); - both.should.be.eql("Normal"); + expect(staticModule).toBe("Normal"); + expect(both).toBe("Normal"); break; case "1": - manifestChunk.hash.should.be.eql(STATE.hash); - staticModule.should.be.eql("Changed"); - both.should.be.eql("Normal"); + expect(manifestChunk.hash).toBe(STATE.hash); + expect(staticModule).toBe("Changed"); + expect(both).toBe("Normal"); break; case "2": - manifestChunk.hash.should.be.eql(STATE.hash); - staticModule.should.be.eql("Changed"); - both.should.be.eql("Changed"); + expect(manifestChunk.hash).toBe(STATE.hash); + expect(staticModule).toBe("Changed"); + expect(both).toBe("Changed"); break; } }); @@ -32,10 +30,10 @@ it("should load additional chunk", function() { switch (step) { case "0": case "1": - dynamic.default.should.be.eql("Normal"); + expect(dynamic.default).toBe("Normal"); break; case "2": - dynamic.default.should.be.eql("Changed"); + expect(dynamic.default).toBe("Changed"); break; } }); diff --git a/test/watchCases/scope-hoisting/caching-inner-source/0/index.js b/test/watchCases/scope-hoisting/caching-inner-source/0/index.js new file mode 100644 index 000000000..38f90e9d0 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/0/index.js @@ -0,0 +1,3 @@ +it("should not crash when scope-hoisted modules change", function() { + expect(require("./module").default).toBe(WATCH_STEP); +}); diff --git a/test/watchCases/scope-hoisting/caching-inner-source/0/inner.js b/test/watchCases/scope-hoisting/caching-inner-source/0/inner.js new file mode 100644 index 000000000..42a661101 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/0/inner.js @@ -0,0 +1 @@ +export { x } from "./inner1"; diff --git a/test/watchCases/scope-hoisting/caching-inner-source/0/inner1.js b/test/watchCases/scope-hoisting/caching-inner-source/0/inner1.js new file mode 100644 index 000000000..8effc5eb5 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/0/inner1.js @@ -0,0 +1 @@ +export { x } from "./inner2"; diff --git a/test/watchCases/scope-hoisting/caching-inner-source/0/inner2.js b/test/watchCases/scope-hoisting/caching-inner-source/0/inner2.js new file mode 100644 index 000000000..08a631832 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/0/inner2.js @@ -0,0 +1 @@ +export var x = "0"; diff --git a/test/watchCases/scope-hoisting/caching-inner-source/0/module.js b/test/watchCases/scope-hoisting/caching-inner-source/0/module.js new file mode 100644 index 000000000..77e0f5e73 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/0/module.js @@ -0,0 +1,3 @@ +import { x } from "./inner"; + +export default x; diff --git a/test/watchCases/scope-hoisting/caching-inner-source/1/inner1.js b/test/watchCases/scope-hoisting/caching-inner-source/1/inner1.js new file mode 100644 index 000000000..6ac155423 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/1/inner1.js @@ -0,0 +1 @@ +export var x = "1"; diff --git a/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js b/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js new file mode 100644 index 000000000..59e948b12 --- /dev/null +++ b/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + optimization: { + concatenateModules: true + } +}; diff --git a/test/watchCases/simple/multi-compiler/0/index.js b/test/watchCases/simple/multi-compiler/0/index.js index c156142d1..97de35344 100644 --- a/test/watchCases/simple/multi-compiler/0/index.js +++ b/test/watchCases/simple/multi-compiler/0/index.js @@ -2,10 +2,10 @@ require("./changing-file") it("should watch for changes", function() { switch(WATCH_STEP) { case "0": - STATS_JSON.children.should.have.size(2); + expect(STATS_JSON.children).toHaveLength(2); break; case "1": - STATS_JSON.children.should.have.size(1); + expect(STATS_JSON.children).toHaveLength(1); break; } }) diff --git a/test/watchCases/simple/simple/0/index.js b/test/watchCases/simple/simple/0/index.js index 3069c8ecb..3f40c870c 100644 --- a/test/watchCases/simple/simple/0/index.js +++ b/test/watchCases/simple/simple/0/index.js @@ -1,3 +1,3 @@ it("should watch for changes", function() { - require("./changing-file").should.be.eql(WATCH_STEP); + expect(require("./changing-file")).toBe(WATCH_STEP); }) diff --git a/test/watchCases/warnings/warnings-contribute-to-hash/0/index.js b/test/watchCases/warnings/warnings-contribute-to-hash/0/index.js index 3dc8434b9..b79d0891b 100644 --- a/test/watchCases/warnings/warnings-contribute-to-hash/0/index.js +++ b/test/watchCases/warnings/warnings-contribute-to-hash/0/index.js @@ -6,7 +6,7 @@ it("should detect a change on warnings change", function() { STATE.hash = STATS_JSON.hash; break; case "1": - STATS_JSON.hash.should.be.not.eql(STATE.hash); + expect(STATS_JSON.hash).not.toBe(STATE.hash); break; } }); diff --git a/test/watchCases/wasm/caching/0/index.js b/test/watchCases/wasm/caching/0/index.js new file mode 100644 index 000000000..21268193d --- /dev/null +++ b/test/watchCases/wasm/caching/0/index.js @@ -0,0 +1,18 @@ +it("should allow to run a WebAssembly module with imports", function() { + return import("./wasm.wasm").then(function(wasm) { + const result = wasm.get(); + switch(WATCH_STEP) { + case "0": + expect(result).toEqual(9); + break; + case "1": + expect(result).toEqual(10); + break; + case "2": + expect(result).toEqual(42); + break; + default: + throw new Error("should not happen"); + } + }); +}); diff --git a/test/watchCases/wasm/caching/0/module.js b/test/watchCases/wasm/caching/0/module.js new file mode 100644 index 000000000..7eaa835a3 --- /dev/null +++ b/test/watchCases/wasm/caching/0/module.js @@ -0,0 +1,3 @@ +export function getNumber() { + return 8; +} diff --git a/test/watchCases/wasm/caching/0/wasm.wasm b/test/watchCases/wasm/caching/0/wasm.wasm new file mode 100644 index 000000000..2ff39aa41 Binary files /dev/null and b/test/watchCases/wasm/caching/0/wasm.wasm differ diff --git a/test/watchCases/wasm/caching/1/wasm.wasm b/test/watchCases/wasm/caching/1/wasm.wasm new file mode 100644 index 000000000..016201831 Binary files /dev/null and b/test/watchCases/wasm/caching/1/wasm.wasm differ diff --git a/test/watchCases/wasm/caching/2/module.js b/test/watchCases/wasm/caching/2/module.js new file mode 100644 index 000000000..bc5c5b2f2 --- /dev/null +++ b/test/watchCases/wasm/caching/2/module.js @@ -0,0 +1,3 @@ +export function getNumber() { + return 40; +} diff --git a/test/watchCases/wasm/caching/test.filter.js b/test/watchCases/wasm/caching/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/watchCases/wasm/caching/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/yarn.lock b/yarn.lock index 2cea93369..56a5a9bb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,151 @@ # yarn lockfile v1 +"@babel/code-frame@^7.0.0-beta.35": + version "7.0.0-beta.38" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.38.tgz#c0af5930617e55e050336838e3a3670983b0b2b2" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@types/babel-types@*", "@types/babel-types@^7.0.0": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.2.tgz#63dc3e5e7f6367e1819d2bba5213783cd926c5d5" + +"@types/babylon@^6.16.2": + version "6.16.2" + resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.2.tgz#062ce63b693d9af1c246f5aedf928bc9c30589c8" + dependencies: + "@types/babel-types" "*" + "@types/node@^9.6.4": - version "9.6.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.4.tgz#0ef7b4cfc3499881c81e0ea1ce61a23f6f4f5b42" + version "9.6.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.6.tgz#439b91f9caf3983cad2eef1e11f6bedcbf9431d2" "@types/tapable@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.1.tgz#938bfcc018eda2f386c34e37f084e6e961c08ca6" + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.2.tgz#e13182e1b69871a422d7863e11a4a6f5b814a4bd" + +"@webassemblyjs/ast@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.4.3.tgz#3b3f6fced944d8660273347533e6d4d315b5934a" + dependencies: + "@webassemblyjs/helper-wasm-bytecode" "1.4.3" + "@webassemblyjs/wast-parser" "1.4.3" + debug "^3.1.0" + webassemblyjs "1.4.3" + +"@webassemblyjs/floating-point-hex-parser@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.4.3.tgz#f5aee4c376a717c74264d7bacada981e7e44faad" + +"@webassemblyjs/helper-buffer@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.4.3.tgz#0434b55958519bf503697d3824857b1dea80b729" + dependencies: + debug "^3.1.0" + +"@webassemblyjs/helper-code-frame@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.4.3.tgz#f1349ca3e01a8e29ee2098c770773ef97af43641" + dependencies: + "@webassemblyjs/wast-printer" "1.4.3" + +"@webassemblyjs/helper-fsm@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.4.3.tgz#65a921db48fb43e868f17b27497870bdcae22b79" + +"@webassemblyjs/helper-wasm-bytecode@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.4.3.tgz#0e5b4b5418e33f8a26e940b7809862828c3721a5" + +"@webassemblyjs/helper-wasm-section@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.4.3.tgz#9ceedd53a3f152c3412e072887ade668d0b1acbf" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/helper-buffer" "1.4.3" + "@webassemblyjs/helper-wasm-bytecode" "1.4.3" + "@webassemblyjs/wasm-gen" "1.4.3" + debug "^3.1.0" + +"@webassemblyjs/leb128@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.4.3.tgz#5a5e5949dbb5adfe3ae95664d0439927ac557fb8" + dependencies: + leb "^0.3.0" + +"@webassemblyjs/validation@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/validation/-/validation-1.4.3.tgz#9e66c9b3079d7bbcf2070c1bf52a54af2a09aac9" + dependencies: + "@webassemblyjs/ast" "1.4.3" + +"@webassemblyjs/wasm-edit@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.4.3.tgz#87febd565e0ffb5ae25f6495bb3958d17aa0a779" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/helper-buffer" "1.4.3" + "@webassemblyjs/helper-wasm-bytecode" "1.4.3" + "@webassemblyjs/helper-wasm-section" "1.4.3" + "@webassemblyjs/wasm-gen" "1.4.3" + "@webassemblyjs/wasm-opt" "1.4.3" + "@webassemblyjs/wasm-parser" "1.4.3" + "@webassemblyjs/wast-printer" "1.4.3" + debug "^3.1.0" + +"@webassemblyjs/wasm-gen@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.4.3.tgz#8553164d0154a6be8f74d653d7ab355f73240aa4" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/helper-wasm-bytecode" "1.4.3" + "@webassemblyjs/leb128" "1.4.3" + +"@webassemblyjs/wasm-opt@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.4.3.tgz#26c7a23bfb136aa405b1d3410e63408ec60894b8" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/helper-buffer" "1.4.3" + "@webassemblyjs/wasm-gen" "1.4.3" + "@webassemblyjs/wasm-parser" "1.4.3" + debug "^3.1.0" + +"@webassemblyjs/wasm-parser@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.4.3.tgz#7ddd3e408f8542647ed612019cfb780830993698" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/helper-wasm-bytecode" "1.4.3" + "@webassemblyjs/leb128" "1.4.3" + "@webassemblyjs/wasm-parser" "1.4.3" + webassemblyjs "1.4.3" + +"@webassemblyjs/wast-parser@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.4.3.tgz#3250402e2c5ed53dbe2233c9de1fe1f9f0d51745" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/floating-point-hex-parser" "1.4.3" + "@webassemblyjs/helper-code-frame" "1.4.3" + "@webassemblyjs/helper-fsm" "1.4.3" + long "^3.2.0" + webassemblyjs "1.4.3" + +"@webassemblyjs/wast-printer@1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.4.3.tgz#3d59aa8d0252d6814a3ef4e6d2a34c9ded3904e0" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/wast-parser" "1.4.3" + long "^3.2.0" + +abab@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" abbrev@1: version "1.1.1" @@ -37,6 +175,18 @@ acorn-globals@^1.0.3: dependencies: acorn "^2.1.0" +acorn-globals@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + +acorn-globals@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + dependencies: + acorn "^5.0.0" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -51,18 +201,22 @@ acorn@^2.1.0: version "2.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" -acorn@^3.0.4: +acorn@^3.0.4, acorn@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.0.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" +acorn@^4.0.4, acorn@~4.0.2: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" -acorn@^5.5.0: +acorn@^5.0.0, acorn@^5.5.0: version "5.5.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" +acorn@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" + ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" @@ -78,16 +232,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.0.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.2.tgz#47c68d69e86f5d953103b0074a9430dc63da5e39" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - json-schema-traverse "^0.3.0" - json-stable-stringify "^1.0.1" - -ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: +ajv@^5.0.0, ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -97,12 +242,13 @@ ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: json-schema-traverse "^0.3.0" ajv@^6.1.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.1.1.tgz#978d597fbc2b7d0e5a5c3ddeb149a682f2abfa0e" + version "6.4.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.4.0.tgz#d3aff78e9277549771daf0164cff48482b754fc6" dependencies: fast-deep-equal "^1.0.0" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" + uri-js "^3.0.2" align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" @@ -121,8 +267,8 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" ansi-escapes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" ansi-regex@^2.0.0: version "2.1.1" @@ -136,12 +282,25 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.1.0: +ansi-styles@^3.1.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +ansi-styles@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: color-convert "^1.9.0" +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -149,6 +308,12 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -161,16 +326,22 @@ are-we-there-yet@~1.1.2: readable-stream "^2.0.6" argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" dependencies: sprintf-js "~1.0.2" +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" -arr-flatten@^1.1.0: +arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" @@ -178,6 +349,10 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -192,11 +367,15 @@ array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -arrify@^1.0.0: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -209,8 +388,8 @@ asap@~2.0.3: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" asn1.js@^4.0.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" dependencies: bn.js "^4.0.0" inherits "^2.0.1" @@ -238,21 +417,35 @@ assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + async@1.x, async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@^2.1.4: + version "2.6.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" + dependencies: + lodash "^4.14.0" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" atob@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" + version "2.1.0" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.0.tgz#ab2b150e51d7b122b9efc8d7340c06b6c41076bc" autoprefixer@^6.3.1: version "6.7.7" @@ -274,10 +467,10 @@ aws-sign2@~0.7.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" aws4@^1.2.1, aws4@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + version "1.7.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" -babel-code-frame@^6.11.0, babel-code-frame@^6.22.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -285,6 +478,151 @@ babel-code-frame@^6.11.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.6" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.0.0-alpha.5.tgz#acf85d6e69b96755fb8f89542251349718620615" + dependencies: + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.0.0-alpha.5" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.5" + test-exclude "^4.1.1" + +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.0.0-alpha.5.tgz#d3ac1b55cfcf78d1418629b5cbd8f82d97f1545e" + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-preset-jest@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.0.0-alpha.5.tgz#2acb14805bfcb73b4884e8fadc776bae26e30a50" + dependencies: + babel-plugin-jest-hoist "^23.0.0-alpha.5" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + balanced-match@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -294,8 +632,8 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" base64-js@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" base@^0.11.1: version "0.11.2" @@ -336,11 +674,7 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@^2.3, bluebird@^2.9.x: - version "2.11.0" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" - -bluebird@^3.5.1: +bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3.5.x: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -367,23 +701,29 @@ boom@5.x.x: hoek "4.x.x" brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" dependencies: balanced-match "^1.0.0" concat-map "0.0.1" +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + braces@^2.3.0, braces@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb" + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" - define-property "^1.0.0" extend-shallow "^2.0.1" fill-range "^4.0.0" isobject "^3.0.1" - kind-of "^6.0.2" repeat-element "^1.1.2" snapdragon "^0.8.1" snapdragon-node "^2.0.1" @@ -394,13 +734,19 @@ brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +browser-process-hrtime@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + +browser-resolve@^1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -410,16 +756,16 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4: safe-buffer "^5.0.1" browserify-cipher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" dependencies: browserify-aes "^1.0.4" browserify-des "^1.0.0" evp_bytestokey "^1.0.0" browserify-des@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.1.tgz#3343124db6d7ad53e26a8826318712bdc8450f9c" dependencies: cipher-base "^1.0.1" des.js "^1.0.0" @@ -457,6 +803,16 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: caniuse-db "^1.0.30000639" electron-to-chromium "^1.2.7" +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" + buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -469,15 +825,19 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" bundle-loader@~0.5.0: - version "0.5.5" - resolved "https://registry.yarnpkg.com/bundle-loader/-/bundle-loader-0.5.5.tgz#11fd7b08edf86a1d708efcb1eca62ca51f6c368a" + version "0.5.6" + resolved "https://registry.yarnpkg.com/bundle-loader/-/bundle-loader-0.5.6.tgz#6c9042e62f1c89941458805a3a479d10f34c71fd" dependencies: - loader-utils "^1.0.2" + loader-utils "^1.1.0" cacache@^10.0.4: version "10.0.4" @@ -521,10 +881,18 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + caniuse-api@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-1.6.1.tgz#b534e7c734c4f81ec5fbe8aca2ad24354b962c6c" @@ -535,8 +903,8 @@ caniuse-api@^1.5.2: lodash.uniq "^4.5.0" caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: - version "1.0.30000787" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000787.tgz#ca07a281be536a88bd7fac96ba895f3cf53f811b" + version "1.0.30000830" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000830.tgz#6e45255b345649fd15ff59072da1e12bb3de2f13" caseless@~0.11.0: version "0.11.0" @@ -553,7 +921,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -563,7 +931,15 @@ chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.3.2: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^2.0.1, chalk@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" dependencies: @@ -571,17 +947,31 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + character-parser@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/character-parser/-/character-parser-1.2.1.tgz#c0dde4ab182713b919b970959a123ecc1a30fcd6" +character-parser@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/character-parser/-/character-parser-2.2.0.tgz#c7ce28f36d4bcd9744e5ffc2c5fcde1c73261fc0" + dependencies: + is-regex "^1.0.3" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" chokidar@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7" + version "2.0.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.3.tgz#dcbd4f6cbb2a55b4799ba8a840ac527e5f4b1176" dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -595,15 +985,19 @@ chokidar@^2.0.2: readdirp "^2.0.0" upath "^1.0.0" optionalDependencies: - fsevents "^1.0.0" + fsevents "^1.1.2" chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" chrome-trace-event@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.1.tgz#651f4d115902160b0b33aca136574b17d1519c98" + version "0.1.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.3.tgz#d395af2d31c87b90a716c831fe326f69768ec084" + +ci-info@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -638,6 +1032,12 @@ clean-css@^3.1.9: commander "2.8.x" source-map "0.4.x" +clean-css@^4.1.11: + version "4.1.11" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.11.tgz#2ecdf145aba38f54740f26cefd0ff3e03e125d6a" + dependencies: + source-map "0.5.x" + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -656,13 +1056,21 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" +cliui@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + clone@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" clone@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" co@^4.6.0: version "4.6.0" @@ -675,16 +1083,17 @@ coa@~1.0.1: q "^1.1.2" codacy-coverage@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/codacy-coverage/-/codacy-coverage-2.0.3.tgz#5635af71391d2f55c3fc284f72a13c2250c47c76" + version "2.1.1" + resolved "https://registry.yarnpkg.com/codacy-coverage/-/codacy-coverage-2.1.1.tgz#8d22a58ef6858602d01de2ff2563be06c57e29a3" dependencies: - bluebird "^2.9.x" + bluebird "^3.5.x" commander "^2.x" - joi "^6.4.x" - lcov-parse "0.x" + joi "^12.x" + lcov-parse "^1.x" lodash "^4.17.4" log-driver "^1.x" - request-promise "^0.x" + request "^2.83.0" + request-promise "^4.x" code-point-at@^1.0.0: version "1.1.0" @@ -743,9 +1152,9 @@ colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" -combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: delayed-stream "~1.0.0" @@ -755,15 +1164,9 @@ commander@2.8.x: dependencies: graceful-readlink ">= 1.0.0" -commander@2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" - commander@^2.9.0, commander@^2.x: - version "2.12.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" commander@~2.13.0: version "2.13.0" @@ -777,6 +1180,10 @@ commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" +compare-versions@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.1.0.tgz#43310256a5c555aaed4193c04d8f154cf9c6efd5" + component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -786,9 +1193,10 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" concat-stream@^1.5.0, concat-stream@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: + buffer-from "^1.0.0" inherits "^2.0.3" readable-stream "^2.2.2" typedarray "^0.0.6" @@ -803,6 +1211,15 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" +constantinople@^3.0.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/constantinople/-/constantinople-3.1.2.tgz#d45ed724f57d3d10500017a7d3a889c1381ae647" + dependencies: + "@types/babel-types" "^7.0.0" + "@types/babylon" "^6.16.2" + babel-types "^6.26.0" + babylon "^6.18.0" + constantinople@~3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/constantinople/-/constantinople-3.0.2.tgz#4b945d9937907bcd98ee575122c3817516544141" @@ -817,10 +1234,18 @@ content-disposition@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.1.tgz#87476c6a67c8daa87e32e87616df883ba7fb071b" +content-type-parser@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7" + content-type@~1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" +convert-source-map@^1.4.0, convert-source-map@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -848,6 +1273,10 @@ core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -863,24 +1292,25 @@ coveralls@^2.11.2: request "2.79.0" create-ecdh@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + version "4.0.1" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.1.tgz#44223dfed533193ba5ba54e0df5709b89acf1f82" dependencies: bn.js "^4.1.0" elliptic "^6.0.0" create-hash@^1.1.0, create-hash@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" dependencies: cipher-base "^1.0.1" inherits "^2.0.1" - ripemd160 "^2.0.0" + md5.js "^1.3.4" + ripemd160 "^2.0.1" sha.js "^2.4.0" create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.6" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" dependencies: cipher-base "^1.0.3" create-hash "^1.1.0" @@ -890,14 +1320,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: sha.js "^2.4.8" create-react-class@^15.6.0: - version "15.6.2" - resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a" + version "15.6.3" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" dependencies: fbjs "^0.8.9" loose-envify "^1.3.1" object-assign "^4.1.1" -cross-spawn@^5.1.0: +cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -938,21 +1368,21 @@ css-color-names@0.0.4: resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" css-loader@^0.28.3: - version "0.28.7" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.7.tgz#5f2ee989dd32edd907717f953317656160999c1b" + version "0.28.11" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.11.tgz#c3f9864a700be2711bb5a2462b2389b1a392dab7" dependencies: - babel-code-frame "^6.11.0" + babel-code-frame "^6.26.0" css-selector-tokenizer "^0.7.0" - cssnano ">=2.6.1 <4" + cssnano "^3.10.0" icss-utils "^2.1.0" loader-utils "^1.0.2" lodash.camelcase "^4.3.0" - object-assign "^4.0.1" + object-assign "^4.1.1" postcss "^5.0.6" - postcss-modules-extract-imports "^1.0.0" - postcss-modules-local-by-default "^1.0.1" - postcss-modules-scope "^1.0.0" - postcss-modules-values "^1.1.0" + postcss-modules-extract-imports "^1.2.0" + postcss-modules-local-by-default "^1.2.0" + postcss-modules-scope "^1.1.0" + postcss-modules-values "^1.3.0" postcss-value-parser "^3.3.0" source-list-map "^2.0.0" @@ -983,7 +1413,7 @@ cssesc@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" -"cssnano@>=2.6.1 <4": +cssnano@^3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.10.0.tgz#4f38f6cea2b9b17fa01490f23f1dc68ea65c1c38" dependencies: @@ -1027,7 +1457,17 @@ csso@~2.3.1: clap "^1.0.9" source-map "^0.5.3" -cuint@latest: +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + +cuint@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" @@ -1045,13 +1485,7 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@2.6.8: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - -debug@^2.2.0, debug@^2.3.3: +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1069,7 +1503,7 @@ debug@~2.2.0: dependencies: ms "0.7.1" -decamelize@^1.0.0, decamelize@^1.1.2: +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1077,14 +1511,27 @@ decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" -deep-extend@~0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" +deep-extend@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.5.1.tgz#b894a9dd90d3023fbf1c55a394fb858eb2066f1f" deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -1129,8 +1576,8 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" depd@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" des.js@^1.0.0: version "1.0.0" @@ -1143,21 +1590,27 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" -diff@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" -diff@^3.1.0: +diff@^3.2.0: version "3.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" diffie-hellman@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" dependencies: bn.js "^4.1.0" miller-rabin "^4.0.0" @@ -1169,13 +1622,23 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -domain-browser@^1.1.1: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" +doctypes@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" -duplexify@^3.1.2, duplexify@^3.4.2: - version "3.5.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + +domexception@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + dependencies: + webidl-conversions "^4.0.2" + +duplexify@^3.4.2, duplexify@^3.5.3: + version "3.5.4" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.4.tgz#4bb46c1796eabebeec4ca9a2e66b808cb7a3d8b4" dependencies: end-of-stream "^1.0.0" inherits "^2.0.1" @@ -1192,15 +1655,9 @@ ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" -electron-releases@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/electron-releases/-/electron-releases-2.1.0.tgz#c5614bf811f176ce3c836e368a0625782341fd4e" - electron-to-chromium@^1.2.7: - version "1.3.30" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.30.tgz#9666f532a64586651fc56a72513692e820d06a80" - dependencies: - electron-releases "^2.1.0" + version "1.3.42" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.42.tgz#95c33bf01d0cc405556aec899fe61fd4d76ea0f9" elliptic@^6.0.0: version "6.4.0" @@ -1225,8 +1682,8 @@ encoding@^0.1.11: iconv-lite "~0.4.13" end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" dependencies: once "^1.4.0" @@ -1238,18 +1695,36 @@ enhanced-resolve@^4.0.0: memory-fs "^0.4.0" tapable "^1.0.0" -errno@^0.1.1, errno@^0.1.3: - version "0.1.6" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.6.tgz#c386ce8a6283f14fc09563b71560908c9bf53026" - dependencies: - prr "~1.0.1" - -errno@~0.1.7: +errno@^0.1.1, errno@^0.1.3, errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" dependencies: prr "~1.0.1" +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.5.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + es6-promise-polyfill@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/es6-promise-polyfill/-/es6-promise-polyfill-1.2.0.tgz#f38925f23cb3e3e8ce6cda8ff774fcebbb090cde" @@ -1258,7 +1733,7 @@ escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1273,12 +1748,27 @@ escodegen@1.8.x: optionalDependencies: source-map "~0.2.0" +escodegen@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.5.6" + eslint-config-prettier@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3" dependencies: get-stdin "^5.0.1" +eslint-plugin-jest@21.12.2: + version "21.12.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.12.2.tgz#325f7c6a5078aed51ea087c33c26792337b5ba37" + eslint-plugin-node@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" @@ -1360,28 +1850,31 @@ esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" esquery@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" dependencies: estraverse "^4.0.0" esrecurse@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" dependencies: estraverse "^4.1.0" - object-assign "^4.0.1" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1404,6 +1897,34 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +exec-sh@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.1.tgz#163b98a6e89e6b65b47c2a28d215bc1f63989c38" + dependencies: + merge "^1.1.3" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -1416,6 +1937,23 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +expect@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.0.0-alpha.5.tgz#514d9f37b77c86f7d4386c2116de2abce795284c" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^23.0.0-alpha.5" + jest-get-type "^22.1.0" + jest-matcher-utils "^23.0.0-alpha.5" + jest-message-util "^23.0.0-alpha.5" + jest-regex-util "^23.0.0-alpha.5" + express@~4.13.1: version "4.13.4" resolved "https://registry.yarnpkg.com/express/-/express-4.13.4.tgz#3c0b76f3c77590c8345739061ec0bd3ba067ec24" @@ -1464,13 +2002,19 @@ extend@~3.0.0, extend@~3.0.1: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" external-editor@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" + version "2.2.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" dependencies: chardet "^0.4.0" iconv-lite "^0.4.17" tmp "^0.0.33" +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -1493,8 +2037,8 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" fast-deep-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" fast-diff@^1.1.1: version "1.1.2" @@ -1512,6 +2056,12 @@ fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + fbjs@^0.8.16, fbjs@^0.8.9: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" @@ -1538,11 +2088,32 @@ file-entry-cache@^2.0.0: object-assign "^4.0.1" file-loader@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.6.tgz#7b9a8f2c58f00a77fddf49e940f7ac978a3ea0e8" + version "1.1.11" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.11.tgz#6fe886449b0f2a936e43cabaac0cdbfb369506f8" dependencies: loader-utils "^1.0.2" - schema-utils "^0.3.0" + schema-utils "^0.4.5" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" fill-range@^4.0.0: version "4.0.0" @@ -1570,6 +2141,13 @@ find-cache-dir@^1.0.0: make-dir "^1.0.0" pkg-dir "^2.0.0" +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -1590,16 +2168,26 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" flush-write-stream@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417" + version "1.0.3" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" dependencies: inherits "^2.0.1" readable-stream "^2.0.4" -for-in@^1.0.2: +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -1613,19 +2201,13 @@ form-data@~2.1.1: mime-types "^2.1.12" form-data@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: asynckit "^0.4.0" - combined-stream "^1.0.5" + combined-stream "1.0.6" mime-types "^2.1.12" -formatio@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.2.0.tgz#f3b2167d9068c4698a8d51f4f760a39a54d818eb" - dependencies: - samsam "1.x" - forwarded@~0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" @@ -1647,6 +2229,12 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -1660,13 +2248,20 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" dependencies: nan "^2.3.0" node-pre-gyp "^0.6.39" +fsevents@^1.1.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.2.tgz#4f598f0f69b273188ef4a62ca4e9e08ace314bbf" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.9.0" + fstream-ignore@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" @@ -1684,7 +2279,7 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" -function-bind@^1.0.2: +function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -1715,10 +2310,18 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -1729,6 +2332,19 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -1736,17 +2352,6 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" @@ -1757,7 +2362,7 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -1769,8 +2374,12 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: path-is-absolute "^1.0.0" globals@^11.0.1: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" + version "11.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" globby@^5.0.0: version "5.0.0" @@ -1791,11 +2400,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -handlebars@^4.0.1: +handlebars@^4.0.1, handlebars@^4.0.3: version "4.0.11" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" dependencies: @@ -1850,6 +2459,10 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -1887,12 +2500,6 @@ has@^1.0.1: dependencies: function-bind "^1.0.2" -hash-base@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" - dependencies: - inherits "^2.0.1" - hash-base@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" @@ -1925,10 +2532,6 @@ hawk@~6.0.2: hoek "4.x.x" sntp "2.x.x" -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -1942,13 +2545,30 @@ hoek@2.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" hoek@4.x.x: - version "4.2.0" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + version "4.2.1" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" html-comment-regex@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + http-errors@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.3.1.tgz#197e22cdebd4198585e8694ef6786197b91ed942" @@ -1980,10 +2600,16 @@ i18n-webpack-plugin@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/i18n-webpack-plugin/-/i18n-webpack-plugin-1.0.0.tgz#0ca12296ec937a4f94325cd0264d08f4e0549831" -iconv-lite@^0.4.17, iconv-lite@~0.4.13: +iconv-lite@0.4.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.21" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.21.tgz#c47f8733d02171189ebc4a400f3218d348094798" + dependencies: + safer-buffer "^2.1.0" + icss-replace-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" @@ -1995,21 +2621,34 @@ icss-utils@^2.1.0: postcss "^6.0.1" ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + version "1.1.11" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455" iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + ignore@^3.3.3, ignore@^3.3.6: - version "3.3.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" + version "3.3.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.8.tgz#3f8e9c35d38708a3a7e0e9abb6c73e7ee7707b2b" image-size@~0.5.0: version "0.5.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -2038,8 +2677,8 @@ inherits@2.0.1: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" ini@~1.3.0: - version "1.3.4" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" inquirer@^3.0.6: version "3.3.0" @@ -2060,6 +2699,16 @@ inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" +invariant@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + ipaddr.js@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.0.5.tgz#5fa78cf301b825c78abc3042d812723049ea23c7" @@ -2080,6 +2729,10 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" @@ -2090,6 +2743,22 @@ is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-ci@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + dependencies: + ci-info "^1.0.0" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -2102,6 +2771,10 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -2118,6 +2791,23 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-expression@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-expression/-/is-expression-3.0.0.tgz#39acaa6be7fd1f3471dc42c7416e61c24317ac9f" + dependencies: + acorn "~4.0.2" + object-assign "^4.0.1" + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -2128,10 +2818,20 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -2142,6 +2842,16 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" +is-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -2154,15 +2864,26 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-my-ip-valid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" + is-my-json-valid@^2.12.4: - version "2.17.1" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz#3da98914a70a22f0a8563ef1511a246c6fc55471" + version "2.17.2" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz#6b2103a288e94ef3de5cf15d29dd85fc4b78d65c" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" + is-my-ip-valid "^1.0.0" jsonpointer "^4.0.0" xtend "^4.0.0" +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -2184,8 +2905,8 @@ is-path-cwd@^1.0.0: resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" dependencies: is-path-inside "^1.0.0" @@ -2205,6 +2926,14 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + is-promise@^2.0.0, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -2217,11 +2946,17 @@ is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" -is-resolvable@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.1.tgz#acca1cd36dbe44b974b924321555a70ba03b1cf4" +is-regex@^1.0.3, is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" -is-stream@^1.0.1: +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2231,25 +2966,31 @@ is-svg@^2.0.0: dependencies: html-comment-regex "^1.1.0" +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -isemail@1.x.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/isemail/-/isemail-1.2.0.tgz#be03df8cc3e29de4d2c5df6501263f1fa4595e9a" +isemail@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.2.tgz#937cf919002077999a73ea8b1951d590e84e01dd" + dependencies: + punycode "2.x.x" isexe@^2.0.0: version "2.0.0" @@ -2276,6 +3017,96 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" +istanbul-api@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" + dependencies: + async "^2.1.4" + compare-versions "^3.1.0" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-hook "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-report "^1.1.4" + istanbul-lib-source-maps "^1.2.4" + istanbul-reports "^1.3.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-coverage@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" + +istanbul-lib-hook@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.0.tgz#ae556fd5a41a6e8efa0b1002b1e416dfeaf9816c" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.0" + semver "^5.3.0" + +istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" + dependencies: + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-lib-source-maps@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.4.tgz#cc7ccad61629f4efff8e2f78adb8c522c9976ec7" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" + dependencies: + handlebars "^4.0.3" + istanbul@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" @@ -2316,22 +3147,317 @@ jade@^1.11.0: void-elements "~2.0.1" with "~4.0.0" +jest-changed-files@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.2.0.tgz#517610c4a8ca0925bdc88b0ca53bd678aa8d019e" + dependencies: + throat "^4.0.0" + +jest-cli@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.0.0-alpha.5.tgz#713d38a20f046a595e4411ff9c3c26f7cc05b202" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-instrument "^1.8.0" + istanbul-lib-source-maps "^1.2.1" + jest-changed-files "^22.2.0" + jest-config "^23.0.0-alpha.5" + jest-environment-jsdom "^23.0.0-alpha.5" + jest-get-type "^22.1.0" + jest-haste-map "^23.0.0-alpha.5" + jest-message-util "^23.0.0-alpha.5" + jest-regex-util "^23.0.0-alpha.5" + jest-resolve-dependencies "^23.0.0-alpha.5" + jest-runner "^23.0.0-alpha.5" + jest-runtime "^23.0.0-alpha.5" + jest-snapshot "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + jest-validate "^23.0.0-alpha.5" + jest-worker "^23.0.0-alpha.5" + micromatch "^2.3.11" + node-notifier "^5.2.1" + realpath-native "^1.0.0" + rimraf "^2.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^11.0.0" + +jest-config@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.0.0-alpha.5.tgz#8e3aab4fdd36dedcc17b4462e74313b201740e8a" + dependencies: + babel-core "^6.0.0" + babel-jest "^23.0.0-alpha.5" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^23.0.0-alpha.5" + jest-environment-node "^23.0.0-alpha.5" + jest-get-type "^22.1.0" + jest-jasmine2 "^23.0.0-alpha.5" + jest-regex-util "^23.0.0-alpha.5" + jest-resolve "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + jest-validate "^23.0.0-alpha.5" + pretty-format "^23.0.0-alpha.5" + +jest-diff@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.0.0-alpha.5.tgz#65c40a2f83ae763167f3b22cbe546d11e879fd21" + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^23.0.0-alpha.5" + jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" -joi@^6.4.x: - version "6.10.1" - resolved "https://registry.yarnpkg.com/joi/-/joi-6.10.1.tgz#4d50c318079122000fe5f16af1ff8e1917b77e06" +jest-docblock@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.4.0.tgz#dbf1877e2550070cfc4d9b07a55775a0483159b8" dependencies: - hoek "2.x.x" - isemail "1.x.x" - moment "2.x.x" - topo "1.x.x" + detect-newline "^2.1.0" + +jest-environment-jsdom@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.0.0-alpha.5.tgz#5703be9552c971eb21a6d127ba61a0aef00376e4" + dependencies: + jest-mock "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + jsdom "^11.5.1" + +jest-environment-node@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.0.0-alpha.5.tgz#a843ff68af484289493366923ed9c3fb13df38bd" + dependencies: + jest-mock "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + +jest-get-type@^22.1.0: + version "22.1.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9" + +jest-haste-map@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.0.0-alpha.5.tgz#6602742b99a4a90f40775560b44294455acd55cd" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^22.4.0" + jest-serializer "^22.4.0" + jest-worker "^23.0.0-alpha.5" + micromatch "^2.3.11" + sane "^2.0.0" + +jest-jasmine2@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.0.0-alpha.5.tgz#99757191bdadd54885217b239a9d2dc3045cd4c8" + dependencies: + chalk "^2.0.1" + co "^4.6.0" + expect "^23.0.0-alpha.5" + graceful-fs "^4.1.11" + is-generator-fn "^1.0.0" + jest-diff "^23.0.0-alpha.5" + jest-matcher-utils "^23.0.0-alpha.5" + jest-message-util "^23.0.0-alpha.5" + jest-snapshot "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + source-map-support "^0.5.0" + +jest-leak-detector@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.0.0-alpha.5.tgz#0f35047e4734671c676e7e95661cd0e8a6c4fdfb" + dependencies: + pretty-format "^23.0.0-alpha.5" + +jest-matcher-utils@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.0.0-alpha.5.tgz#300c31dde2fa3402f0b217add320cb7f101fa627" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^23.0.0-alpha.5" + +jest-message-util@^22.4.3: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.4.3.tgz#cf3d38aafe4befddbfc455e57d65d5239e399eb7" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-message-util@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.0.0-alpha.5.tgz#72e56d5ffb196c1fc018a6c7ac49b94ddc5bf974" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.0.0-alpha.5.tgz#3c3ad13f69019ed3002ad84a8fded5676fc2ab4a" + +jest-regex-util@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.0.0-alpha.5.tgz#6dbe0dcb23c9389a2f979c7e293ead3e91052e14" + +jest-resolve-dependencies@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.0.0-alpha.5.tgz#5f371c22d35e3fb3d5e2ed0f580bff60b8f0f144" + dependencies: + jest-regex-util "^23.0.0-alpha.5" + jest-snapshot "^23.0.0-alpha.5" + +jest-resolve@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.0.0-alpha.5.tgz#31f484b3c6fa2c2be112092e0da4d898e482b95a" + dependencies: + browser-resolve "^1.11.2" + chalk "^2.0.1" + realpath-native "^1.0.0" + +jest-runner@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.0.0-alpha.5.tgz#bc18404f0ad7016c2b641908240face3ca16c117" + dependencies: + exit "^0.1.2" + jest-config "^23.0.0-alpha.5" + jest-docblock "^22.4.0" + jest-haste-map "^23.0.0-alpha.5" + jest-jasmine2 "^23.0.0-alpha.5" + jest-leak-detector "^23.0.0-alpha.5" + jest-message-util "^23.0.0-alpha.5" + jest-runtime "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + jest-worker "^23.0.0-alpha.5" + throat "^4.0.0" + +jest-runtime@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.0.0-alpha.5.tgz#8a8def856cf9be87d154f13b47d6e2551e0a55ac" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.1.5" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + graceful-fs "^4.1.11" + jest-config "^23.0.0-alpha.5" + jest-haste-map "^23.0.0-alpha.5" + jest-regex-util "^23.0.0-alpha.5" + jest-resolve "^23.0.0-alpha.5" + jest-snapshot "^23.0.0-alpha.5" + jest-util "^23.0.0-alpha.5" + jest-validate "^23.0.0-alpha.5" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + realpath-native "^1.0.0" + slash "^1.0.0" + strip-bom "3.0.0" + write-file-atomic "^2.1.0" + yargs "^11.0.0" + +jest-serializer@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-22.4.0.tgz#b5d145b98c4b0d2c20ab686609adbb81fe23b566" + +jest-silent-reporter@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/jest-silent-reporter/-/jest-silent-reporter-0.0.4.tgz#906f41790ee758cd1682d33263538df20d43074e" + dependencies: + chalk "^2.3.1" + jest-util "^22.3.0" + +jest-snapshot@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.0.0-alpha.5.tgz#98ba2e55c2dca0837782a83bcfd880d125f7d849" + dependencies: + chalk "^2.0.1" + jest-diff "^23.0.0-alpha.5" + jest-matcher-utils "^23.0.0-alpha.5" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^23.0.0-alpha.5" + +jest-util@^22.3.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.4.3.tgz#c70fec8eec487c37b10b0809dc064a7ecf6aafac" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^22.4.3" + mkdirp "^0.5.1" + source-map "^0.6.0" + +jest-util@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.0.0-alpha.5.tgz#2ac78c3d6c9e459cae7c100e028f271f954b4b15" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^23.0.0-alpha.5" + mkdirp "^0.5.1" + source-map "^0.6.0" + +jest-validate@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.0.0-alpha.5.tgz#c95ec2032b0971af8baa0978de67598ccffdaa8d" + dependencies: + chalk "^2.0.1" + jest-config "^23.0.0-alpha.5" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.0.0-alpha.5" + +jest-worker@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.0.0-alpha.5.tgz#003d3b106b126070c5c563b20d48cf2141df0f44" + dependencies: + merge-stream "^1.0.1" + +jest@23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.0.0-alpha.5.tgz#f3c1a5add21f22a10e1159650ccf6312d2bdde58" + dependencies: + import-local "^1.0.0" + jest-cli "^23.0.0-alpha.5" + +joi@^12.x: + version "12.0.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-12.0.0.tgz#46f55e68f4d9628f01bbb695902c8b307ad8d33a" + dependencies: + hoek "4.x.x" + isemail "3.x.x" + topo "2.x.x" js-base64@^2.1.9: - version "2.4.0" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.0.tgz#9e566fee624751a1d720c966cd6226d29d4025aa" + version "2.4.3" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.3.tgz#2e545ec2b0f2957f41356510205214e98fad6582" + +js-stringify@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/js-stringify/-/js-stringify-1.0.2.tgz#1736fddfd9724f28a3682adc6230ae7e4e9679db" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" @@ -2345,6 +3471,13 @@ js-yaml@3.6.1: esprima "^2.6.0" js-yaml@3.x, js-yaml@^3.9.1: + version "3.11.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^3.7.0: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -2362,6 +3495,41 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jsdom@^11.5.1: + version "11.6.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.0.tgz#7334781595ee8bdeea9742fc33fab5cdad6d195f" + dependencies: + abab "^1.0.4" + acorn "^5.3.0" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + browser-process-hrtime "^0.1.2" + content-type-parser "^1.0.2" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + domexception "^1.0.0" + escodegen "^1.9.0" + html-encoding-sniffer "^1.0.2" + left-pad "^1.2.0" + nwmatcher "^1.4.3" + parse5 "^4.0.0" + pn "^1.1.0" + request "^2.83.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.3" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-url "^6.4.0" + ws "^4.0.0" + xml-name-validator "^3.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" @@ -2392,11 +3560,7 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - -json5@^0.5.0: +json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2424,6 +3588,13 @@ jstransformer@0.0.2: is-promise "^2.0.0" promise "^6.0.1" +jstransformer@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/jstransformer/-/jstransformer-1.0.0.tgz#ed8bf0921e2f3f1ed4d5c1a44f68709ed24722c3" + dependencies: + is-promise "^2.0.0" + promise "^7.0.1" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -2448,23 +3619,35 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lazy-cache@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" dependencies: - set-getter "^0.1.0" + invert-kv "^1.0.0" -lcov-parse@0.0.10, lcov-parse@0.x: +lcov-parse@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" +lcov-parse@^1.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" + +leb@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/leb/-/leb-0.3.0.tgz#32bee9fad168328d6aea8522d833f4180eed1da3" + +left-pad@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee" + less-loader@^4.0.3: - version "4.0.5" - resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-4.0.5.tgz#ae155a7406cac6acd293d785587fcff0f478c4dd" + version "4.1.0" + resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-4.1.0.tgz#2c1352c5b09a4f84101490274fd51674de41363e" dependencies: clone "^2.1.1" loader-utils "^1.1.0" - pify "^2.3.0" + pify "^3.0.0" less@^2.5.1: version "2.7.3" @@ -2479,6 +3662,10 @@ less@^2.5.1: request "2.81.0" source-map "^0.5.3" +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -2486,6 +3673,16 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + loader-runner@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" @@ -2514,80 +3711,41 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -lodash@^3.10.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" +lodash@^4.13.1, lodash@^4.17.4, lodash@^4.3.0: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" -lodash@^4.17.4, lodash@^4.3.0: +lodash@^4.14.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -log-driver@1.2.5, log-driver@^1.x: +log-driver@1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" -lolex@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6" +log-driver@^1.x: + version "1.2.7" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + +long@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" longest@^1.0.1: version "1.0.1" @@ -2600,8 +3758,8 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: js-tokens "^3.0.0" lru-cache@^4.0.1, lru-cache@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + version "4.1.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f" dependencies: pseudomap "^1.0.2" yallist "^2.1.2" @@ -2611,11 +3769,17 @@ macaddress@^0.2.8: resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" make-dir@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" + version "1.2.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b" dependencies: pify "^3.0.0" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -2641,6 +3805,12 @@ media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -2652,31 +3822,41 @@ merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" -micromatch@^3.1.4: - version "3.1.9" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" +micromatch@^2.1.5, micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" -micromatch@^3.1.8: - version "3.1.8" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.8.tgz#5c8caa008de588eebb395e8c0ad12c128f25fff1" +micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -2690,7 +3870,7 @@ micromatch@^3.1.8: object.pick "^1.3.0" regex-not "^1.0.0" snapdragon "^0.8.1" - to-regex "^3.0.1" + to-regex "^3.0.2" miller-rabin@^4.0.0: version "4.0.1" @@ -2699,15 +3879,15 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@~1.30.0: - version "1.30.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" -mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.17, mime-types@~2.1.6, mime-types@~2.1.7: - version "2.1.17" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.6, mime-types@~2.1.7: + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: - mime-db "~1.30.0" + mime-db "~1.33.0" mime@1.3.4: version "1.3.4" @@ -2718,18 +3898,18 @@ mime@^1.2.11, mime@^1.4.1, mime@^1.5.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" minimalistic-assert@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2739,7 +3919,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.1.1, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -2747,6 +3927,19 @@ minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" +minipass@^2.2.1, minipass@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.2.4.tgz#03c824d84551ec38a8d1bb5bc350a5a30a354a40" + dependencies: + safe-buffer "^5.1.1" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + mississippi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" @@ -2769,37 +3962,12 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -mocha-lcov-reporter@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz#469bdef4f8afc9a116056f079df6182d0afb0384" - -mocha@^3.2.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" - dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.8" - diff "3.2.0" - escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - he "1.1.1" - json3 "3.3.2" - lodash.create "3.1.1" - mkdirp "0.5.1" - supports-color "3.1.2" - -moment@2.x.x: - version "2.20.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd" - move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -2823,9 +3991,9 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@^2.3.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" +nan@^2.3.0, nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" nanomatch@^1.2.9: version "1.2.9" @@ -2844,21 +4012,25 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -native-promise-only@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11" - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +needle@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.0.tgz#f14efc69cee1024b72c8b21c7bdf94a731dc12fa" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + negotiator@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.5.3.tgz#269d5c476810ec92edbe7b6c2f28316384f9a7e8" neo-async@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f" + version "2.5.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.1.tgz#acb909e327b1e87ec9ef15f41b8a269512ad41ee" node-fetch@^1.0.1: version "1.7.3" @@ -2867,6 +4039,10 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + node-libs-browser@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" @@ -2895,6 +4071,15 @@ node-libs-browser@^2.0.0: util "^0.10.3" vm-browserify "0.0.4" +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + node-pre-gyp@^0.6.39: version "0.6.39" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" @@ -2911,6 +4096,21 @@ node-pre-gyp@^0.6.39: tar "^2.2.1" tar-pack "^3.4.0" +node-pre-gyp@^0.9.0: + version "0.9.1" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.9.1.tgz#f11c07516dd92f87199dbc7e1838eab7cd56c9e0" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.0" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.1.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + nopt@3.x: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -2924,7 +4124,16 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-path@^2.1.1: +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -2943,6 +4152,23 @@ normalize-url@^1.4.0: query-string "^4.1.0" sort-keys "^1.0.0" +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-packlist@^1.1.6: + version "1.1.10" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -2960,6 +4186,10 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" +nwmatcher@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" + oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -2976,12 +4206,30 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" +object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" dependencies: isobject "^3.0.0" +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -3038,17 +4286,29 @@ os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" osenv@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + p-limit@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" @@ -3078,8 +4338,8 @@ parallel-transform@^1.1.0: readable-stream "^2.1.5" parse-asn1@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -3087,6 +4347,25 @@ parse-asn1@^5.0.0: evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse5@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + parseurl@~1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -3103,11 +4382,17 @@ path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3115,6 +4400,10 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -3123,15 +4412,17 @@ path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" -path-to-regexp@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d" +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" dependencies: - isarray "0.0.1" + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" pbkdf2@^3.0.3: - version "3.0.14" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" + version "3.0.16" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -3147,7 +4438,7 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -pify@^2.0.0, pify@^2.3.0: +pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -3172,13 +4463,17 @@ pkg-dir@^2.0.0: find-up "^2.1.0" platform@^1.3.3: - version "1.3.4" - resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.4.tgz#6f0fb17edaaa48f21442b3a975c063130f1c3ebd" + version "1.3.5" + resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -3305,27 +4600,27 @@ postcss-minify-selectors@^2.0.4: postcss "^5.0.14" postcss-selector-parser "^2.0.0" -postcss-modules-extract-imports@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.1.0.tgz#b614c9720be6816eaee35fb3a5faa1dba6a05ddb" +postcss-modules-extract-imports@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz#66140ecece38ef06bf0d3e355d69bf59d141ea85" dependencies: postcss "^6.0.1" -postcss-modules-local-by-default@^1.0.1: +postcss-modules-local-by-default@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz#f7d80c398c5a393fa7964466bd19500a7d61c069" dependencies: css-selector-tokenizer "^0.7.0" postcss "^6.0.1" -postcss-modules-scope@^1.0.0: +postcss-modules-scope@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz#d6ea64994c79f97b62a72b426fbe6056a194bb90" dependencies: css-selector-tokenizer "^0.7.0" postcss "^6.0.1" -postcss-modules-values@^1.1.0: +postcss-modules-values@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz#ecffa9d7e192518389f42ad0e83f72aec456ea20" dependencies: @@ -3422,12 +4717,12 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 supports-color "^3.2.3" postcss@^6.0.1: - version "6.0.15" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.15.tgz#f460cd6269fede0d1bf6defff0b934a9845d974d" + version "6.0.21" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.21.tgz#8265662694eddf9e9a5960db6da33c39e4cd069d" dependencies: - chalk "^2.3.0" + chalk "^2.3.2" source-map "^0.6.1" - supports-color "^5.1.0" + supports-color "^5.3.0" prelude-ls@~1.1.2: version "1.1.2" @@ -3437,13 +4732,28 @@ prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" -prettier@^1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +prettier@^1.11.1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325" + +pretty-format@^23.0.0-alpha.5: + version "23.0.0-alpha.5" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.0.0-alpha.5.tgz#49441032994ce2b1cfa74531c1c9d9a36fe59e90" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +private@^0.1.7: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" process@^0.11.10: version "0.11.10" @@ -3463,7 +4773,7 @@ promise@^6.0.1: dependencies: asap "~1.0.0" -promise@^7.1.1: +promise@^7.0.1, promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" dependencies: @@ -3476,8 +4786,8 @@ promise@~2.0: is-promise "~1" prop-types@^15.5.10: - version "15.6.0" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" + version "15.6.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" dependencies: fbjs "^0.8.16" loose-envify "^1.3.1" @@ -3499,8 +4809,8 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" public-encrypt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + version "4.0.2" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" dependencies: bn.js "^4.1.0" browserify-rsa "^4.0.0" @@ -3508,14 +4818,108 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" -pump@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" +pug-attrs@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/pug-attrs/-/pug-attrs-2.0.3.tgz#a3095f970e64151f7bdad957eef55fb5d7905d15" dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" + constantinople "^3.0.1" + js-stringify "^1.0.1" + pug-runtime "^2.0.4" -pump@^2.0.1: +pug-code-gen@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pug-code-gen/-/pug-code-gen-2.0.1.tgz#0951ec83225d74d8cfc476a7f99a259b5f7d050c" + dependencies: + constantinople "^3.0.1" + doctypes "^1.1.0" + js-stringify "^1.0.1" + pug-attrs "^2.0.3" + pug-error "^1.3.2" + pug-runtime "^2.0.4" + void-elements "^2.0.1" + with "^5.0.0" + +pug-error@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/pug-error/-/pug-error-1.3.2.tgz#53ae7d9d29bb03cf564493a026109f54c47f5f26" + +pug-filters@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/pug-filters/-/pug-filters-3.1.0.tgz#27165555bc04c236e4aa2b0366246dfa021b626e" + dependencies: + clean-css "^4.1.11" + constantinople "^3.0.1" + jstransformer "1.0.0" + pug-error "^1.3.2" + pug-walk "^1.1.7" + resolve "^1.1.6" + uglify-js "^2.6.1" + +pug-lexer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pug-lexer/-/pug-lexer-4.0.0.tgz#210c18457ef2e1760242740c5e647bd794cec278" + dependencies: + character-parser "^2.1.1" + is-expression "^3.0.0" + pug-error "^1.3.2" + +pug-linker@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/pug-linker/-/pug-linker-3.0.5.tgz#9e9a7ae4005682d027deeb96b000f88eeb83a02f" + dependencies: + pug-error "^1.3.2" + pug-walk "^1.1.7" + +pug-load@^2.0.11: + version "2.0.11" + resolved "https://registry.yarnpkg.com/pug-load/-/pug-load-2.0.11.tgz#e648e57ed113fe2c1f45d57858ea2bad6bc01527" + dependencies: + object-assign "^4.1.0" + pug-walk "^1.1.7" + +pug-loader@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/pug-loader/-/pug-loader-2.4.0.tgz#18eebdda045d9c31c2856f1cc3ceb8d3df7ca49a" + dependencies: + loader-utils "^1.1.0" + pug-walk "^1.0.0" + resolve "^1.1.7" + +pug-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pug-parser/-/pug-parser-5.0.0.tgz#e394ad9b3fca93123940aff885c06e44ab7e68e4" + dependencies: + pug-error "^1.3.2" + token-stream "0.0.1" + +pug-runtime@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pug-runtime/-/pug-runtime-2.0.4.tgz#e178e1bda68ab2e8c0acfc9bced2c54fd88ceb58" + +pug-strip-comments@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pug-strip-comments/-/pug-strip-comments-1.0.3.tgz#f1559592206edc6f85310dacf4afb48a025af59f" + dependencies: + pug-error "^1.3.2" + +pug-walk@^1.0.0, pug-walk@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/pug-walk/-/pug-walk-1.1.7.tgz#c00d5c5128bac5806bec15d2b7e7cdabe42531f3" + +pug@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/pug/-/pug-2.0.3.tgz#71cba82537c95a5eab7ed04696e4221f53aa878e" + dependencies: + pug-code-gen "^2.0.1" + pug-filters "^3.1.0" + pug-lexer "^4.0.0" + pug-linker "^3.0.5" + pug-load "^2.0.11" + pug-parser "^5.0.0" + pug-runtime "^2.0.4" + pug-strip-comments "^1.0.3" + +pump@^2.0.0, pump@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" dependencies: @@ -3523,17 +4927,21 @@ pump@^2.0.1: once "^1.3.1" pumpify@^1.3.3: - version "1.3.5" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.5.tgz#1b671c619940abcaeac0ad0e3a3c164be760993b" + version "1.4.0" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.4.0.tgz#80b7c5df7e24153d03f0e7ac8a05a5d068bd07fb" dependencies: - duplexify "^3.1.2" - inherits "^2.0.1" - pump "^1.0.0" + duplexify "^3.5.3" + inherits "^2.0.3" + pump "^2.0.0" punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" +punycode@2.x.x, punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -3573,15 +4981,22 @@ querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79" + version "2.0.6" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" dependencies: safe-buffer "^5.1.0" randomfill@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.3.tgz#b96b7df587f01dd91726c418f30553b1418e3d62" + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" dependencies: randombytes "^2.0.5" safe-buffer "^5.1.0" @@ -3599,10 +5014,10 @@ raw-loader@~0.5.0, raw-loader@~0.5.1: resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa" rc@^1.1.7: - version "1.2.2" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" + version "1.2.7" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.7.tgz#8a10ca30d588d00464360372b890d06dacd02297" dependencies: - deep-extend "~0.4.0" + deep-extend "^0.5.1" ini "~1.3.0" minimist "^1.2.0" strip-json-comments "~2.0.1" @@ -3626,16 +5041,31 @@ react@^15.2.1: object-assign "^4.1.0" prop-types "^15.5.10" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: core-util-is "~1.0.0" inherits "~2.0.3" isarray "~1.0.0" - process-nextick-args "~1.0.6" + process-nextick-args "~2.0.0" safe-buffer "~5.1.1" - string_decoder "~1.0.3" + string_decoder "~1.1.1" util-deprecate "~1.0.1" readdirp@^2.0.0: @@ -3647,6 +5077,12 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +realpath-native@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.0.tgz#7885721a83b43bd5327609f0ddecb2482305fdf0" + dependencies: + util.promisify "^1.0.0" + reduce-css-calc@^1.2.6: version "1.3.0" resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" @@ -3665,7 +5101,17 @@ regenerate@^1.2.1: version "1.3.3" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" -regex-not@^1.0.0: +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" dependencies: @@ -3673,8 +5119,8 @@ regex-not@^1.0.0: safe-regex "^1.1.0" regexpp@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43" + version "1.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" regexpu-core@^1.0.0: version "1.0.0" @@ -3706,14 +5152,34 @@ repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" -request-promise@^0.x: - version "0.4.3" - resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-0.4.3.tgz#3c8ddc82f06f8908d720aede1d6794258e22121c" +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" dependencies: - bluebird "^2.3" - chalk "^1.1.0" - lodash "^3.10.0" - request "^2.34" + is-finite "^1.0.0" + +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + +request-promise@^4.x: + version "4.2.2" + resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" + dependencies: + bluebird "^3.5.0" + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" request@2.79.0: version "2.79.0" @@ -3767,9 +5233,9 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" -request@^2.34: - version "2.83.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" +request@^2.83.0: + version "2.85.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" dependencies: aws-sign2 "~0.7.0" aws4 "^1.6.0" @@ -3794,6 +5260,14 @@ request@^2.34: tunnel-agent "^0.6.0" uuid "^3.1.0" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -3801,21 +5275,31 @@ require-uncached@^1.0.3: caller-path "^0.1.0" resolve-from "^1.0.0" +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" -resolve@1.1.x: +resolve@1.1.7, resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.3.3: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.3: + version "1.7.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" dependencies: path-parse "^1.0.5" @@ -3843,10 +5327,10 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2. glob "^7.0.5" ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" dependencies: - hash-base "^2.0.0" + hash-base "^3.0.0" inherits "^2.0.1" run-async@^2.2.0: @@ -3872,8 +5356,8 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" safe-regex@^1.1.0: version "1.1.0" @@ -3881,11 +5365,25 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -samsam@1.x, samsam@^1.1.3: - version "1.3.0" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" +safer-buffer@^2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" -sax@~1.2.1: +sane@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.3.0.tgz#3f3df584abf69e63d4bb74f0f8c42468e4d7d46b" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.1.1" + +sax@^1.2.4, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -3908,11 +5406,7 @@ script-loader@~0.7.0: dependencies: raw-loader "~0.5.1" -semver@^5.3.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - -semver@^5.4.1: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" @@ -3951,8 +5445,8 @@ send@0.13.2: statuses "~1.2.1" serialize-javascript@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005" + version "1.5.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" serve-static@~1.10.2: version "1.10.3" @@ -3962,16 +5456,10 @@ serve-static@~1.10.2: parseurl "~1.3.1" send "0.13.2" -set-blocking@~2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" -set-getter@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" - dependencies: - to-object-path "^0.3.0" - set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" @@ -3999,8 +5487,8 @@ setimmediate@^1.0.4, setimmediate@^1.0.5: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.9" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d" + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -4015,66 +5503,23 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -should-equal@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-1.0.1.tgz#0b6e9516f2601a9fb0bb2dcc369afa1c7e200af7" - dependencies: - should-type "^1.0.0" - -should-format@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/should-format/-/should-format-3.0.3.tgz#9bfc8f74fa39205c53d38c34d717303e277124f1" - dependencies: - should-type "^1.3.0" - should-type-adaptors "^1.0.1" - -should-type-adaptors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz#401e7f33b5533033944d5cd8bf2b65027792e27a" - dependencies: - should-type "^1.3.0" - should-util "^1.0.0" - -should-type@^1.0.0, should-type@^1.3.0, should-type@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/should-type/-/should-type-1.4.0.tgz#0756d8ce846dfd09843a6947719dfa0d4cff5cf3" - -should-util@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/should-util/-/should-util-1.0.0.tgz#c98cda374aa6b190df8ba87c9889c2b4db620063" - -should@^11.1.1: - version "11.2.1" - resolved "https://registry.yarnpkg.com/should/-/should-11.2.1.tgz#90f55145552d01cfc200666e4e818a1c9670eda2" - dependencies: - should-equal "^1.0.0" - should-format "^3.0.2" - should-type "^1.4.0" - should-type-adaptors "^1.0.1" - should-util "^1.0.0" +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" simple-git@^1.65.0: - version "1.85.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.85.0.tgz#563ad291efc8a127735e8fbcd796967377614cd4" + version "1.92.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.92.0.tgz#6061468eb7d19f0141078fc742e62457e910f547" dependencies: debug "^3.1.0" -sinon@^2.3.2: - version "2.4.1" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.4.1.tgz#021fd64b54cb77d9d2fb0d43cdedfae7629c3a36" - dependencies: - diff "^3.1.0" - formatio "1.2.0" - lolex "^1.6.0" - native-promise-only "^0.8.1" - path-to-regexp "^1.7.0" - samsam "^1.1.3" - text-encoding "0.6.4" - type-detect "^4.0.0" +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" slice-ansi@1.0.0: version "1.0.0" @@ -4097,8 +5542,8 @@ snapdragon-util@^3.0.1: kind-of "^3.2.0" snapdragon@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370" + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" dependencies: base "^0.11.1" debug "^2.2.0" @@ -4107,7 +5552,7 @@ snapdragon@^0.8.1: map-cache "^0.2.2" source-map "^0.5.6" source-map-resolve "^0.5.0" - use "^2.0.0" + use "^3.1.0" sntp@1.x.x: version "1.0.9" @@ -4141,6 +5586,18 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.2.tgz#1a6297fd5b2e762b39688c7fc91233b60984f0a5" + dependencies: + source-map "^0.6.0" + source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" @@ -4151,11 +5608,11 @@ source-map@0.4.x, source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: +source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -4171,6 +5628,20 @@ source-map@~0.2.0: dependencies: amdefine ">=0.0.4" +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -4182,8 +5653,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + version "1.14.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -4201,6 +5672,10 @@ ssri@^5.2.4: dependencies: safe-buffer "^5.1.1" +stack-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -4209,13 +5684,17 @@ static-extend@^0.1.1: object-copy "^0.1.0" statuses@1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" statuses@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.2.1.tgz#dded45cc18256d51ed40aec142489d5c61026d28" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" @@ -4231,12 +5710,12 @@ stream-each@^1.1.0: stream-shift "^1.0.0" stream-http@^2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" + version "2.8.1" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.1.tgz#d0441be1a457a73a733a8a7b53570bebd9ef66a4" dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" - readable-stream "^2.2.6" + readable-stream "^2.3.3" to-arraybuffer "^1.0.0" xtend "^4.0.0" @@ -4248,6 +5727,13 @@ strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -4256,16 +5742,16 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.1.0, string-width@^2.1.1: +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string_decoder@^1.0.0, string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" +string_decoder@^1.0.0, string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" dependencies: safe-buffer "~5.1.0" @@ -4285,6 +5771,20 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -4296,17 +5796,11 @@ style-loader@^0.19.1: loader-utils "^1.0.2" schema-utils "^0.3.0" -supports-color@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - dependencies: - has-flag "^1.0.0" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0, supports-color@^3.2.3: +supports-color@^3.1.0, supports-color@^3.1.2, supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -4318,11 +5812,11 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" -supports-color@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.1.0.tgz#058a021d1b619f7ddf3980d712ea3590ce7de3d5" +supports-color@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" dependencies: - has-flag "^2.0.0" + has-flag "^3.0.0" svgo@^0.7.0: version "0.7.2" @@ -4336,6 +5830,10 @@ svgo@^0.7.0: sax "~1.2.1" whet.extend "~0.9.9" +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" @@ -4372,14 +5870,46 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -text-encoding@0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" +tar@^4: + version "4.4.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.1.tgz#b25d5a8470c976fd7a9a8a350f42c59e9fa81749" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.2.4" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.1" + yallist "^3.0.2" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +test-exclude@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" + dependencies: + arrify "^1.0.1" + micromatch "^3.1.8" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -4396,8 +5926,8 @@ time-stamp@^2.0.0: resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357" timers-browserify@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.4.tgz#96ca53f4b794a5e7c0e1bd7cc88a372298fa01e6" + version "2.0.10" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" dependencies: setimmediate "^1.0.4" @@ -4407,10 +5937,18 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -4424,26 +5962,43 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" -to-regex@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.1.tgz#15358bee4a2c83bd76377ba1dc049d0f18837aae" +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" dependencies: - define-property "^0.2.5" - extend-shallow "^2.0.1" - regex-not "^1.0.0" + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" -topo@1.x.x: - version "1.1.0" - resolved "https://registry.yarnpkg.com/topo/-/topo-1.1.0.tgz#e9d751615d1bb87dc865db182fa1ca0a5ef536d5" +token-stream@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a" + +topo@2.x.x: + version "2.0.2" + resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182" dependencies: - hoek "2.x.x" + hoek "4.x.x" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: +tough-cookie@>=2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + +tough-cookie@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: punycode "^1.4.1" +tr46@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + transformers@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/transformers/-/transformers-2.1.0.tgz#5d23cb35561dd85dc67fb8482309b47d53cce9a7" @@ -4452,6 +6007,10 @@ transformers@2.1.0: promise "~2.0" uglify-js "~2.2.5" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -4476,24 +6035,20 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^4.0.0: - version "4.0.5" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.5.tgz#d70e5bc81db6de2a381bcaca0c6e0cbdc7635de2" - type-is@~1.6.6: - version "1.6.15" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" + version "1.6.16" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" dependencies: media-typer "0.3.0" - mime-types "~2.1.15" + mime-types "~2.1.18" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@^2.9.0-dev.20180412: - version "2.9.0-dev.20180412" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.0-dev.20180412.tgz#5380b2afb44b720b0d8164f844b90ebd81948a7e" +typescript@^2.9.0-dev.20180511: + version "2.9.0-dev.20180511" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.0-dev.20180511.tgz#e864f6b9bf9e7f654d26f5401e74b76871f5a8e2" ua-parser-js@^0.7.9: version "0.7.17" @@ -4506,7 +6061,7 @@ uglify-es@^3.3.4: commander "~2.13.0" source-map "~0.6.1" -uglify-js@^2.4.19, uglify-js@^2.6: +uglify-js@^2.4.19, uglify-js@^2.6, uglify-js@^2.6.1: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" dependencies: @@ -4543,6 +6098,10 @@ uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -4590,8 +6149,14 @@ unset-value@^1.0.0: isobject "^3.0.0" upath@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" + version "1.0.5" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.5.tgz#02cab9ecebe95bbec6d5fc2566325725ab6d1a73" + +uri-js@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-3.0.2.tgz#f90b858507f81dea4dcfbb3c4c3dbfa2b557faaa" + dependencies: + punycode "^2.1.0" urix@^0.1.0: version "0.1.0" @@ -4612,18 +6177,23 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -use@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8" +use@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.0.tgz#14716bf03fdfefd03040aef58d8b4b85f3a7c544" dependencies: - define-property "^0.2.5" - isobject "^3.0.0" - lazy-cache "^2.0.2" + kind-of "^6.0.2" util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + util@0.10.3, util@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" @@ -4635,8 +6205,8 @@ utils-merge@1.0.0: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" uuid@^3.0.0, uuid@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + version "3.2.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" val-loader@^1.0.2: version "1.1.0" @@ -4644,13 +6214,20 @@ val-loader@^1.0.2: dependencies: loader-utils "^1.0.0" +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + vary@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/vary/-/vary-1.0.1.tgz#99e4981566a286118dfb2b817357df7993376d10" vendors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.1.tgz#37ad73c8ee417fb3d580e785312307d274847f22" + version "1.0.2" + resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.2.tgz#7fcb5eef9f5623b156bcea89ec37d63676f21801" verror@1.10.0: version "1.10.0" @@ -4666,18 +6243,51 @@ vm-browserify@0.0.4, vm-browserify@~0.0.0: dependencies: indexof "0.0.1" -void-elements@~2.0.1: +void-elements@^2.0.1, void-elements@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + dependencies: + browser-process-hrtime "^0.1.2" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + watchpack@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed" + version "1.6.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" dependencies: chokidar "^2.0.2" graceful-fs "^4.1.2" neo-async "^2.5.0" +webassemblyjs@1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/webassemblyjs/-/webassemblyjs-1.4.3.tgz#0591893efb8fbde74498251cbe4b2d83df9239cb" + dependencies: + "@webassemblyjs/ast" "1.4.3" + "@webassemblyjs/validation" "1.4.3" + "@webassemblyjs/wasm-parser" "1.4.3" + "@webassemblyjs/wast-parser" "1.4.3" + long "^3.2.0" + +webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + webpack-dev-middleware@^1.9.0: version "1.12.2" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz#f8fc1120ce3b4fc5680ceecb43d777966b21105e" @@ -4695,15 +6305,33 @@ webpack-sources@^1.0.1, webpack-sources@^1.1.0: source-list-map "^2.0.0" source-map "~0.6.1" +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + dependencies: + iconv-lite "0.4.19" + whatwg-fetch@>=0.10.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + +whatwg-url@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.0" + webidl-conversions "^4.0.1" whet.extend@~0.9.9: version "0.9.9" resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" -which@^1.1.1, which@^1.2.9: +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.1.1, which@^1.2.12, which@^1.2.9, which@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: @@ -4719,6 +6347,13 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +with@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/with/-/with-5.1.1.tgz#fa4daa92daf32c4ea94ed453c81f04686b575dfe" + dependencies: + acorn "^3.1.0" + acorn-globals "^3.0.0" + with@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/with/-/with-4.0.3.tgz#eefd154e9e79d2c8d3417b647a8f14d9fecce14e" @@ -4751,25 +6386,56 @@ worker-loader@^1.1.1: loader-utils "^1.0.0" schema-utils "^0.4.0" +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" dependencies: mkdirp "^0.5.1" +ws@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-4.0.0.tgz#bfe1da4c08eeb9780b986e0e4d10eccd7345999f" + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" xxhashjs@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/xxhashjs/-/xxhashjs-0.2.1.tgz#9bbe9be896142976dfa34c061b2d068c43d30de0" + version "0.2.2" + resolved "https://registry.yarnpkg.com/xxhashjs/-/xxhashjs-0.2.2.tgz#8a6251567621a1c46a5ae204da0249c7f8caa9d8" dependencies: - cuint latest + cuint "^0.2.2" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" y18n@^4.0.0: version "4.0.0" @@ -4779,6 +6445,33 @@ yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + +yargs@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"