diff --git a/contributing.md b/contributing.md index 10432b1b2..2f80f4d86 100644 --- a/contributing.md +++ b/contributing.md @@ -28,7 +28,6 @@ The [`question` label](https://github.com/avajs/ava/labels/question) is a good p You can use issue labels to discover issues you could help out with: -* [`babel` issues](https://github.com/avajs/ava/labels/babel) relate to our Babel infrastructure * [`blocked` issues](https://github.com/avajs/ava/labels/blocked) need help getting unstuck * [`bug` issues](https://github.com/avajs/ava/labels/bug) are known bugs we'd like to fix * [`enhancement` issues](https://github.com/avajs/ava/labels/enhancement) are features we're open to including diff --git a/docs/01-writing-tests.md b/docs/01-writing-tests.md index f01f71fb7..9743a0725 100644 --- a/docs/01-writing-tests.md +++ b/docs/01-writing-tests.md @@ -12,7 +12,7 @@ AVA tries to run test files with their current working directory set to the dire Each test file is run in a separate Node.js process. This allows you to change the global state or overriding a built-in in one test file, without affecting another. It's also great for performance on modern multi-core processors, allowing multiple test files to execute in parallel. -AVA will set `process.env.NODE_ENV` to `test`, unless the `NODE_ENV` environment variable has been set. This is useful if the code you're testing has test defaults (for example when picking what database to connect to, or environment-specific Babel options). It may cause your code or its dependencies to behave differently though. Note that `'NODE_ENV' in process.env` will always be `true`. +AVA will set `process.env.NODE_ENV` to `test`, unless the `NODE_ENV` environment variable has been set. This is useful if the code you're testing has test defaults (for example when picking what database to connect to). It may cause your code or its dependencies to behave differently though. Note that `'NODE_ENV' in process.env` will always be `true`. ## Declaring tests diff --git a/docs/03-assertions.md b/docs/03-assertions.md index 5d1039bf5..bfb513674 100644 --- a/docs/03-assertions.md +++ b/docs/03-assertions.md @@ -84,7 +84,7 @@ test('skip assertion', t => { ## Enhanced assertion messages -AVA comes with [`power-assert`](https://github.com/power-assert-js/power-assert) built-in, giving you more descriptive assertion messages. +Enabling [Babel](./recipes/babel.md) will also enable [`power-assert`](https://github.com/power-assert-js/power-assert), giving you more descriptive assertion messages. Let's take this example, using Node's standard [`assert` library](https://nodejs.org/api/assert.html): diff --git a/docs/05-command-line.md b/docs/05-command-line.md index cd88183ad..683a564cc 100644 --- a/docs/05-command-line.md +++ b/docs/05-command-line.md @@ -133,7 +133,13 @@ test(function foo(t) { ## Resetting AVA's cache -AVA caches the compiled test and helper files. It automatically recompiles these files when you change them. AVA tries its best to detect changes to your Babel configuration files, plugins and presets. If it seems like your latest Babel configuration isn't being applied, however, you can run AVA with the `--reset-cache` flag to reset AVA's cache. If set, all files in the `node_modules/.cache/ava` directory are deleted. Run AVA as normal to apply your new Babel configuration. +AVA may cache certain files, especially when you use our [`@ava/babel`](https://github.com/avajs/babel) provider. If it seems like your latest changes aren't being picked up by AVA you can reset the cache by running: + +```console +npx ava reset-cache +``` + +This deletes all files in the `node_modules/.cache/ava` directory. ## Reporters diff --git a/docs/06-configuration.md b/docs/06-configuration.md index 8b08af336..9ef87d562 100644 --- a/docs/06-configuration.md +++ b/docs/06-configuration.md @@ -26,25 +26,16 @@ To ignore files, prefix the pattern with an `!` (exclamation mark). "*oo", "!foo" ], - "cache": true, "concurrency": 5, "failFast": true, "failWithoutAssertions": false, "environmentVariables": { "MY_ENVIRONMENT_VARIABLE": "some value" }, - "tap": true, "verbose": true, - "compileEnhancements": false, "require": [ - "@babel/register" - ], - "babel": { - "extensions": ["js", "jsx"], - "testOptions": { - "babelrc": false - } - } + "./my-helper-module.js" + ] } } ``` @@ -53,8 +44,8 @@ Arguments passed to the CLI will always take precedence over the CLI options con ## Options -- `files`: an array of glob patterns to select test files. Files with an underscore prefix are ignored. By default only selects files with `js` extensions, even if the pattern matches other files. Specify `extensions` and `babel.extensions` to allow other file extensions -- `helpers`: an array of glob patterns to select helper files. Files matched here are never considered as tests. By default only selects files with `js` extensions, even if the pattern matches other files. Specify `extensions` and `babel.extensions` to allow other file extensions +- `files`: an array of glob patterns to select test files. Files with an underscore prefix are ignored. By default only selects files with `js` extensions, even if the pattern matches other files. Specify `extensions` to allow other file extensions +- `helpers`: an array of glob patterns to select helper files. Files matched here are never considered as tests. By default only selects files with `js` extensions, even if the pattern matches other files. Specify `extensions` to allow other file extensions - `sources`: an array of glob patterns to match files that, when changed, cause tests to be re-run (when in watch mode). See the [watch mode recipe for details](https://github.com/avajs/ava/blob/master/docs/recipes/watch-mode.md#source-files-and-test-files) - `match`: not typically useful in the `package.json` configuration, but equivalent to [specifying `--match` on the CLI](./05-command-line.md#running-tests-with-matching-titles) - `cache`: cache compiled test and helper files under `node_modules/.cache/ava`. If `false`, files are cached in a temporary directory instead @@ -64,15 +55,14 @@ Arguments passed to the CLI will always take precedence over the CLI options con - `tap`: if `true`, enables the [TAP reporter](./05-command-line.md#tap-reporter) - `verbose`: if `true`, enables verbose output - `snapshotDir`: specifies a fixed location for storing snapshot files. Use this if your snapshots are ending up in the wrong location -- `compileEnhancements`: if `false`, disables [`power-assert`](./03-assertions.md#enhanced-assertion-messages) — which otherwise helps provide more descriptive error messages — and detection of improper use of the `t.throws()` assertion -- `extensions`: extensions of test files that are not precompiled using AVA's Babel presets. Note that files are still compiled to enable `power-assert` and other features, so you may also need to set `compileEnhancements` to `false` if your files are not valid JavaScript. Setting this overrides the default `"js"` value, so make sure to include that extension in the list, as long as it's not included in `babel.extensions` +- `extensions`: extensions of test files. Setting this overrides the default `"js"` value, so make sure to include that extension in the list - `require`: extra modules to require before tests are run. Modules are required in the [worker processes](./01-writing-tests.md#process-isolation) -- `babel`: test file specific Babel options. See our [Babel recipe](./recipes/babel.md#configuring-babel) for more details -- `babel.extensions`: extensions of test files that will be precompiled using AVA's Babel presets. Setting this overrides the default `"js"` value, so make sure to include that extension in the list - `timeout`: Timeouts in AVA behave differently than in other test frameworks. AVA resets a timer after each test, forcing tests to quit if no new test results were received within the specified timeout. This can be used to handle stalled tests. See our [timeout documentation](./07-test-timeouts.md) for more options. Note that providing files on the CLI overrides the `files` option. +Provide the `babel` option (and install [`@ava/babel`](https://github.com/avajs/babel) as an additional dependency) to enable Babel compilation. + ## Using `ava.config.js` To use an `ava.config.js` file: diff --git a/docs/08-common-pitfalls.md b/docs/08-common-pitfalls.md index a6ada0ed5..6d77526ab 100644 --- a/docs/08-common-pitfalls.md +++ b/docs/08-common-pitfalls.md @@ -4,14 +4,6 @@ Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/do If you use [ESLint](http://eslint.org/), you can install [eslint-plugin-ava](https://github.com/avajs/eslint-plugin-ava). It will help you use AVA correctly and avoid some common pitfalls. -## Transpiling imported modules - -AVA currently only transpiles test and helper files. *It will not transpile modules you `import` from outside of the test.* This may be unexpected but there are workarounds. - -If you use Babel you can use its [require hook](https://babeljs.io/docs/usage/require/) to transpile imported modules on-the-fly. To add it, [configure it in your `package.json`](./06-configuration.md). - -You can also transpile your modules in a separate process and refer to the transpiled files rather than the sources from your tests. - ## AVA in Docker If you run AVA in Docker as part of your CI, you need to fix the appropriate environment variables. Specifically, adding `-e CI=true` in the `docker exec` command. See [#751](https://github.com/avajs/ava/issues/751). @@ -81,6 +73,8 @@ test('one is one', t => { }); ``` +Also make sure to enable [Babel](./recipes/babel.md). + ## Sharing variables between asynchronous tests By default AVA executes tests concurrently. This can cause problems if your tests are asynchronous and share variables. diff --git a/docs/recipes/babel.md b/docs/recipes/babel.md index f3504669a..b65e2937d 100644 --- a/docs/recipes/babel.md +++ b/docs/recipes/babel.md @@ -2,285 +2,18 @@ Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/docs/recipes/babel.md) -AVA uses [Babel 7](https://babeljs.io) so you can use the latest JavaScript syntax in your tests. We do this by compiling test and helper files using our [`@ava/stage-4`](https://github.com/avajs/babel-preset-stage-4) preset. We also use a [second preset, `@ava/transform-test-files`](https://github.com/avajs/babel-preset-transform-test-files) to enable [enhanced assertion messages](../03-assertions.md#enhanced-assertion-messages) and detect improper use of `t.throws()` assertions. +**The upcoming AVA 3 release removes built-in Babel support. See the [AVA 2](https://github.com/avajs/ava/blob/v2.4.0/docs/recipes/babel.md) documentation instead.** -By default our Babel pipeline is applied to test and helper files ending in `.js`. If your project uses Babel then we'll automatically compile these files using your project's Babel configuration. The `@ava/transform-helper-files` preset is applied first, and the `@ava/stage-4` last. - -If you are using Babel for your source files then you must also [configure source compilation](#compile-sources). - -## Customize how AVA compiles your test files - -You can override the default Babel configuration AVA uses for test file compilation in `package.json` or `ava.config.js`. For example, the configuration below adds support for JSX syntax and stage 3 features. - -**`package.json`:** - -```json -{ - "ava": { - "babel": { - "testOptions": { - "plugins": ["@babel/plugin-syntax-jsx"], - "presets": ["@babel/preset-stage-3"] - } - } - } -} -``` - -All [Babel options] are allowed inside the `testOptions` object. - -## Reset AVA's cache - -AVA caches the compiled test and helper files. It automatically recompiles these files when you change them. AVA tries its best to detect changes to your Babel configuration files, plugins and presets. If it seems like your latest Babel configuration isn't being applied, however, you can reset AVA's cache: - -```console -$ npx ava --reset-cache -``` - -## Add additional extensions - -You can configure AVA to recognize additional file extensions and compile those test & helper files using Babel. - -**`package.json`:** - -```json -{ - "ava": { - "babel": { - "extensions": [ - "js", - "jsx" - ] - } - } -} -``` - -See also AVA's [`extensions` option](../06-configuration.md#options). - -## Make AVA skip your project's Babel options - -You may not want AVA to use your project's Babel options, for example if your project is relying on Babel 6. Set the `babelrc` and `configFile` options to `false`. - -**`package.json`:** - -```json -{ - "ava": { - "babel": { - "testOptions": { - "babelrc": false, - "configFile": false - } - } - } -} -``` - -## Disable AVA's stage-4 preset - -You can disable AVA's stage-4 preset. - -**`package.json`:** - -```json -{ - "ava": { - "babel": { - "testOptions": { - "presets": [ - ["module:ava/stage-4", false] - ] - } - } - } -} -``` - -Note that this *does not* stop AVA from compiling your test files using Babel. - -If you want, you can disable the preset in your project's Babel configuration. - -## Preserve ES module syntax - -By default AVA's stage-4 preset will convert ES module syntax to CommonJS. This can be disabled. - -**`package.json`:** - -```json -{ - "ava": { - "babel": { - "testOptions": { - "presets": [ - ["module:ava/stage-4", {"modules": false}] - ] - } - } - } -} -``` - -You'll have to use the [`esm`](https://github.com/standard-things/esm) module so that AVA can still load your test files. [See our recipe for details](./es-modules.md). - -## Disable AVA's Babel pipeline - -You can completely disable AVA's use of Babel. - -**`package.json`:** - -```json -{ - "ava": { - "babel": false, - "compileEnhancements": false - } -} -``` - -## Experimental feature: No Babel out of the box - -A future release of AVA will not use Babel out of the box. You can opt in to this feature. **This feature may change or be removed at any time**: - -**`package.json`:** - -```js -{ - "ava": { - "nonSemVerExperiments": { - "noBabelOutOfTheBox": true - } - } -} -``` - -This disables AVA's Babel pipeline, though you can still enable it by configuring it as described above. - -`compileEnhancements` can no longer be configured on the top-level AVA configuration. It must be configured in AVA's `babel` configuration instead. It defaults to `true`. - -**`package.json`:** - -```json -{ - "ava": { - "nonSemVerExperiments": { - "noBabelOutOfTheBox": true - }, - "babel": { - "compileEnhancements": false - } - } -} -``` - -You can disable the non-enhancement compilation of your test files by setting `testOptions` to `false`. - -```json -{ - "ava": { - "nonSemVerExperiments": { - "noBabelOutOfTheBox": true - }, - "babel": { - "testOptions": false - } - } -} -``` - -## Use Babel polyfills - -AVA lets you write your tests using new JavaScript syntax, even on Node.js versions that otherwise wouldn't support it. However, it doesn't add or modify built-ins of your current environment. Using AVA would, for example, not provide modern features such as `Object.entries()` to an underlying Node.js 6 environment. - -By loading [Babel's `polyfill` module](https://babeljs.io/docs/usage/polyfill/) you can opt in to these features. Note that this will modify the environment, which may influence how your program behaves. - -You can enable the `polyfill` module by adding it to AVA's `require` option. - -**`package.json`:** - -```json -{ - "ava": { - "require": [ - "@babel/polyfill" - ] - } -} -``` - -You'll need to install `@babel/polyfill` yourself. - -## Compile sources - -AVA does not currently compile source files. You'll have to load [Babel's `register` module](http://babeljs.io/docs/usage/require/), which will compile source files as needed. - -You can enable the `register` module by adding it to AVA's `require` option. +You can enable Babel support by installing `@ava/babel`, and then in AVA's configuration setting `babel` to `true`: **`package.json`:** ```json { "ava": { - "require": [ - "@babel/register" - ] - } -} -``` - -You'll need to install `@babel/register` yourself. - -`@babel/register` will *also* process your test and helper files. For most use cases this is unnecessary. If you create a new file that requires `@babel/register` you can tell it which file paths to ignore. For instance in your `test` directory create `_register.js`: - -```js -// test/_register.js: -require('@babel/register')({ - // These patterns are relative to the project directory (where the `package.json` file lives): - ignore: ['node_modules/*', 'test/*'] -}); -``` - -Now instead of requiring `@babel/register`, require `./test/_register` instead. - -**`package.json`:** - -```json -{ - "ava": { - "require": [ - "./test/_register.js" - ] - } -} -``` - -Note that loading `@babel/register` in every worker process has a non-trivial performance cost. If you have lots of test files, you may want to consider using a build step to compile your sources *before* running your tests. This isn't ideal, since it complicates using AVA's watch mode, so we recommend using `@babel/register` until the performance penalty becomes too great. Setting up a precompilation step is out of scope for this document, but we recommend you check out one of the many [build systems that support Babel](http://babeljs.io/docs/setup/). There is an [issue](https://github.com/avajs/ava/issues/577) discussing ways we could make this experience better. - -## Webpack aliases - -[Webpack aliases](https://webpack.js.org/configuration/resolve/#resolve-alias) can be used to provide a shortcut to deeply nested or otherwise inconvenient paths. If you already use aliases in your source files, you'll need to make sure you can use the same aliases in your test files. - -Install `babel-plugin-webpack-alias-7` as a dev-dependency. Then add the plugin to AVA's Babel config: - -`package.json`: - -```json -{ - "ava": { - "babel": { - "testOptions": { - "plugins": [ - [ - "babel-plugin-webpack-alias-7", - { - "config": "./path/to/webpack.config.test.js" - } - ] - ] - } - } + "babel": true } } ``` -[Babel options]: https://babeljs.io/docs/en/options +Find out more in [`@ava/babel`](https://github.com/avajs/babel). diff --git a/docs/recipes/babelrc.md b/docs/recipes/babelrc.md deleted file mode 100644 index 9b5eb91ec..000000000 --- a/docs/recipes/babelrc.md +++ /dev/null @@ -1,5 +0,0 @@ -# Configuring Babel - -Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/docs/recipes/babelrc.md) - -This recipe has moved. Please see our [new Babel recipe](babel.md). diff --git a/docs/recipes/code-coverage.md b/docs/recipes/code-coverage.md index 6e42ffab2..de8fbd4d1 100644 --- a/docs/recipes/code-coverage.md +++ b/docs/recipes/code-coverage.md @@ -2,15 +2,15 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/docs/recipes/code-coverage.md), [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/docs/recipes/code-coverage.md), [Italiano](https://github.com/avajs/ava-docs/blob/master/it_IT/docs/recipes/code-coverage.md), [日本語](https://github.com/avajs/ava-docs/blob/master/ja_JP/docs/recipes/code-coverage.md), [Português](https://github.com/avajs/ava-docs/blob/master/pt_BR/docs/recipes/code-coverage.md), [Русский](https://github.com/avajs/ava-docs/blob/master/ru_RU/docs/recipes/code-coverage.md), [简体中文](https://github.com/avajs/ava-docs/blob/master/zh_CN/docs/recipes/code-coverage.md) -Use the [nyc] command-line-client for [Istanbul] to compute the code coverage of your tests. +Use [`nyc`] to compute the code coverage of your tests. -First install [nyc]: +First install [`nyc`]: ``` $ npm install --save-dev nyc ``` -At its simplest run AVA through [nyc]. In your `package.json` file: +At its simplest run AVA through [`nyc`]. In your `package.json` file: ```json { @@ -27,7 +27,4 @@ You may want to exclude the `.nyc_output` and `coverage` directories from source coverage ``` -If you're compiling your source files using Babel you may want to apply Istanbul's instrumentation as part of the source file compilation. This will yield better results than instrumenting Babel's output. See Istanbul's [*Using Istanbul With ES2015+* tutorial](https://istanbul.js.org/docs/tutorials/es2015/). AVA sets `NODE_ENV=test` for you. Note that as of February 2018 this tutorial hasn't yet been updated for Babel 7. - -[Istanbul]: https://istanbul.js.org/ -[nyc]: https://github.com/istanbuljs/nyc +[`nyc`]: https://github.com/istanbuljs/nyc diff --git a/docs/recipes/es-modules.md b/docs/recipes/es-modules.md index fbb8a4b8f..6227ed50d 100644 --- a/docs/recipes/es-modules.md +++ b/docs/recipes/es-modules.md @@ -26,8 +26,6 @@ Configure it in your `package.json` or `ava.config.js` file, and add it to AVA's } ``` -By default AVA converts ES module syntax to CommonJS. [You can disable this](./babel.md#preserve-es-module-syntax). - You can now use native ES modules with AVA: ```js @@ -47,29 +45,13 @@ test('2 + 2 = 4', t => { }); ``` -You need to configure AVA to recognize `.mjs` extensions. If you want AVA to apply its Babel presets use the following. +You need to configure AVA to recognize `.mjs` extensions; **`package.json`:** ```json { "ava": { - "babel": { - "extensions": [ - "js", - "mjs" - ] - } - } -} -``` - -Alternatively you can use: - -```json -{ - "ava": { - "babel": false, "extensions": [ "js", "mjs" @@ -77,15 +59,3 @@ Alternatively you can use: } } ``` - -Or leave Babel enabled (which means it's applied to `.js` files), but don't apply it to `.mjs` files: - -```json -{ - "ava": { - "extensions": [ - "mjs" - ] - } -} -``` diff --git a/docs/recipes/flow.md b/docs/recipes/flow.md index 41d74bbe5..9d2b62e84 100644 --- a/docs/recipes/flow.md +++ b/docs/recipes/flow.md @@ -8,7 +8,7 @@ Until [1.4.1](https://github.com/avajs/ava/releases/tag/v1.4.1) AVA came bundled This guide assumes you've already set up Flow for your project. Note that AVA's definition as been tested with version 0.95.1. -We recommend you use AVA's built-in Babel pipeline to strip Flow type annotations and declarations. AVA automatically applies your project's Babel configuration, so everything may just work without changes. Alternatively install [`@babel/plugin-transform-flow-strip-types`](https://www.npmjs.com/package/@babel/plugin-transform-flow-strip-types) and customize AVA's configuration in the `package.json` file (or the `ava.config.js` file) as follows. +We recommend you use AVA's [Babel support](https://github.com/avajs/babel) to strip Flow type annotations and declarations. AVA automatically applies your project's Babel configuration, so everything may just work without changes. Alternatively install [`@babel/plugin-transform-flow-strip-types`](https://www.npmjs.com/package/@babel/plugin-transform-flow-strip-types) and customize AVA's configuration in the `package.json` file (or the `ava.config.js` file) as follows. **`package.json`:** @@ -26,7 +26,7 @@ We recommend you use AVA's built-in Babel pipeline to strip Flow type annotation } ``` -See our [Babel documentation](babel.md) for more details. +See our [`@ava/babel`](https://github.com/avajs/babel) for more details. ## Writing tests diff --git a/docs/recipes/jspm-systemjs.md b/docs/recipes/jspm-systemjs.md deleted file mode 100644 index fbe71e910..000000000 --- a/docs/recipes/jspm-systemjs.md +++ /dev/null @@ -1,67 +0,0 @@ -# JSPM and SystemJS for ES2015 - -Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/docs/recipes/jspm-systemjs.md) - -It requires a special loader helper to correctly resolve `import`s of JSPM packages when using AVA. The purpose of the loader is to allow you to run your tests without having to pre-build your JSPM project. - -## Setup - -This recipe has only been tested with JSPM v0.17.0-beta.22, but it should work with any version of JSPM v0.17 and may work with v0.16. - -### Babel - -Set up your Babel options to work with AVA if you have not already. NOTE: You can keep additional configuration in your JSPM config files to override these settings during bundling and building. - -``` -$ npm install --save-dev @babel/preset-env -``` - -```json -{ - "presets": ["@babel/preset-env"] -} -``` - -You can find more information about setting up Babel with AVA in the [Babel recipe](babel.md). - -### JSPM Loader Helper - -You will need to install the [AVA JSPM loader](https://github.com/skorlir/ava-jspm-loader) as a dev dependency. You will also need to install [`@babel/register`](https://www.npmjs.com/package/@babel/register). - -``` -$ npm install --save-dev ava-jspm-loader @babel/register -``` -You will also need to update your AVA config in the `package.json` or `ava.config.js` to use the JSPM loader. - -**`package.json`:** - -```json -{ - "ava": { - "require": [ - "@babel/register", - "ava-jspm-loader" - ] - } -} -``` - -NOTE: If you use async/await in your source code (not in your test code), you will need to install [`@babel/polyfill`](https://www.npmjs.com/package/@babel/polyfill) and add it to your `require` array. - -### Example test file - -Note that you will need to use `System.import` paths for all of your project files. So, if you named your project `app` and you want to import your `main.js` into a test file, you will need to `import main from 'app/main'`. - -```js -import test from 'ava'; -import main from 'app/main'; // Maps to your JSPM config for "app/main.js" -import BigNumber from 'bignumber.js'; // In jspm_packages - -function fn() { - return Promise.resolve(new BigNumber('1234567890.123456789')); -} - -test('example test', async t => { - t.is((await fn()).toString(), '1234567890.123456789'); -}); -``` diff --git a/docs/recipes/react.md b/docs/recipes/react.md index 7993235cb..91770e1aa 100644 --- a/docs/recipes/react.md +++ b/docs/recipes/react.md @@ -4,7 +4,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/doc ## Setting up Babel -AVA automatically extends your regular (project-level) Babel configuration. You should be able to use React in your test files without any additional configuration. +When you [enable Babel](https://github.com/avajs/babel), AVA will automatically extend your regular (project-level) Babel configuration. You should be able to use React in your test files without any additional configuration. However if you want to set it up explicitly, add the preset to the test options in AVA's Babel pipeline by modifying your `package.json` or `ava.config.js` file. @@ -22,7 +22,7 @@ However if you want to set it up explicitly, add the preset to the test options } ``` -You can find more information about setting up Babel with AVA in the [Babel recipe](babel.md). +You can find more information in [`@ava/babel`](https://github.com/avajs/babel). ## Using [Enzyme](https://github.com/airbnb/enzyme) diff --git a/docs/recipes/vue.md b/docs/recipes/vue.md index eb8d31244..43d05f9eb 100644 --- a/docs/recipes/vue.md +++ b/docs/recipes/vue.md @@ -48,7 +48,7 @@ hooks(['vue', 'js']).exclude(({filename}) => filename.match(/\/node_modules\//)) **Note:** If you are using _babel-plugin-webpack-alias-7_, you must also exclude your webpack file - e.g. `filename.includes(/\/node_modules\//) || filename.includes('webpack.config.test.js')` -You can find more information about setting up Babel with AVA in the [Babel recipe](babel.md). +You can find more information about setting up Babel with AVA in [`@ava/babel`](https://github.com/avajs/babel). ## Sample snapshot test diff --git a/eslint-plugin-helper.js b/eslint-plugin-helper.js index 352a9c598..92e685d5a 100644 --- a/eslint-plugin-helper.js +++ b/eslint-plugin-helper.js @@ -19,11 +19,10 @@ function load(projectDir, overrides) { ({conf, babelProvider} = configCache.get(projectDir)); } else { conf = loadConfig({resolveFrom: projectDir}); - const {nonSemVerExperiments: experiments} = conf; - if (!experiments.noBabelOutOfTheBox || conf.babel !== undefined) { - babelProvider = babelManager({experiments, projectDir}); - babelProvider.validateConfig(conf.babel, conf.compileEnhancements !== false); + if (Reflect.has(conf, 'babel')) { + babelProvider = babelManager({projectDir}); + babelProvider.validateConfig(conf.babel); } configCache.set(projectDir, {conf, babelProvider}); @@ -38,7 +37,7 @@ function load(projectDir, overrides) { } } - const extensions = normalizeExtensions(conf.extensions, babelProvider, {experiments: conf.nonSemVerExperiments}); + const extensions = normalizeExtensions(conf.extensions, babelProvider); const globs = {cwd: projectDir, ...normalizeGlobs(conf.files, conf.helpers, conf.sources, extensions.all)}; const helper = Object.freeze({ diff --git a/lib/api.js b/lib/api.js index 502120ede..c33ed5aaa 100644 --- a/lib/api.js +++ b/lib/api.js @@ -57,7 +57,7 @@ class Api extends Emittery { } } - async run(files = [], runtimeOptions = {}) { // eslint-disable-line complexity + async run(files = [], runtimeOptions = {}) { let setupOrGlobError; files = files.map(file => path.resolve(this.options.resolveTestsFrom, file)); @@ -118,11 +118,7 @@ class Api extends Emittery { let helpers; const {babelProvider} = this.options; - const enabledBabelProvider = babelProvider !== undefined && ( - babelProvider.isEnabled() || (babelProvider.legacy && babelProvider.compileEnhancements !== null) - ) ? - babelProvider : - null; + const enabledBabelProvider = babelProvider !== undefined && babelProvider.isEnabled() ? babelProvider : null; try { cacheDir = this._createCacheDir(); @@ -210,44 +206,13 @@ class Api extends Emittery { const testFiles = files.map(file => fs.realpathSync(file)); const helperFiles = helpers.map(file => fs.realpathSync(file)); - if (enabledBabelProvider.legacy) { - const full = {testFiles: [], helperFiles: []}; - const enhancements = {testFiles: [], helperFiles: []}; - for (const realpath of testFiles) { - if (this._regexpBabelExtensions.test(path.basename(realpath))) { // eslint-disable-line max-depth - full.testFiles.push(realpath); - } else { - enhancements.testFiles.push(realpath); - } - } - - for (const realpath of helperFiles) { - if (this._regexpBabelExtensions.test(path.basename(realpath))) { // eslint-disable-line max-depth - full.helperFiles.push(realpath); - } else { - enhancements.helperFiles.push(realpath); - } - } - - babelState = { - ...enabledBabelProvider.isEnabled() && enabledBabelProvider.compile({ - cacheDir, - ...full - }), - ...enabledBabelProvider.compileEnhancements !== null && enabledBabelProvider.compileEnhancements({ - cacheDir, - ...enhancements - }) - }; - } else { - babelState = { - ...enabledBabelProvider.compile({ - cacheDir, - testFiles: testFiles.filter(realpath => this._regexpBabelExtensions.test(path.basename(realpath))), - helperFiles: helperFiles.filter(realpath => this._regexpBabelExtensions.test(path.basename(realpath))) - }) - }; - } + babelState = { + ...enabledBabelProvider.compile({ + cacheDir, + testFiles: testFiles.filter(realpath => this._regexpBabelExtensions.test(path.basename(realpath))), + helperFiles: helperFiles.filter(realpath => this._regexpBabelExtensions.test(path.basename(realpath))) + }) + }; } // Resolve the correct concurrency value. diff --git a/lib/assert.js b/lib/assert.js index 439e2c0e9..98559a49c 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -1,11 +1,9 @@ 'use strict'; const concordance = require('concordance'); -const empower = require('empower-core'); const isError = require('is-error'); const isPromise = require('is-promise'); const concordanceOptions = require('./concordance-options').default; const concordanceDiffOptions = require('./concordance-options').diff; -const enhanceAssert = require('./enhance-assert'); const snapshotManager = require('./snapshot-manager'); function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) { @@ -27,6 +25,10 @@ function formatWithLabel(label, value) { return formatDescriptorWithLabel(label, concordance.describe(value, concordanceOptions)); } +function formatPowerAssertValue(value) { + return concordance.format(value, concordanceOptions); +} + const hasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); const noop = () => {}; const notImplemented = () => { @@ -236,20 +238,20 @@ class Assertions { pending = notImplemented, fail = notImplemented, skip = notImplemented, - compareWithSnapshot = notImplemented + compareWithSnapshot = notImplemented, + powerAssert } = {}) { const withSkip = assertionFn => { assertionFn.skip = skip; return assertionFn; }; - // When adding new enhanced functions with new patterns, don't forget to add to - // https://github.com/avajs/babel-preset-transform-test-files/blob/master/espower-patterns.json - // Then release a new version of that preset and bump the SemVer range here. - const withPowerAssert = (pattern, assertionFn) => empower(assertionFn, { + // When adding new enhanced functions with new patterns, don't forget to + // enable the pattern in the power-assert compilation step in @ava/babel. + const withPowerAssert = (pattern, assertionFn) => powerAssert.empower(assertionFn, { onError: event => { if (event.powerAssertContext) { - event.error.statements = enhanceAssert.formatter(event.powerAssertContext); + event.error.statements = powerAssert.format(event.powerAssertContext, formatPowerAssertValue); } fail(event.error); @@ -835,21 +837,38 @@ class Assertions { pass(); }); - this.assert = withSkip(withPowerAssert( - 'assert(value, [message])', - (actual, message) => { - checkMessage('assert', message, true); + if (powerAssert === undefined) { + this.assert = withSkip((actual, message) => { + if (!checkMessage('assert', message)) { + return; + } if (!actual) { - throw new AssertionError({ + fail(new AssertionError({ assertion: 'assert', message, operator: '!!', values: [formatWithLabel('Value is not truthy:', actual)] - }); + })); } - }) - ); + }); + } else { + this.assert = withSkip(withPowerAssert( + 'assert(value, [message])', + (actual, message) => { + checkMessage('assert', message, true); + + if (!actual) { + throw new AssertionError({ + assertion: 'assert', + message, + operator: '!!', + values: [formatWithLabel('Value is not truthy:', actual)] + }); + } + }) + ); + } } } exports.Assertions = Assertions; diff --git a/lib/babel-manager.js b/lib/babel-manager.js index 520139eb4..f0846dd55 100644 --- a/lib/babel-manager.js +++ b/lib/babel-manager.js @@ -1,63 +1,25 @@ const pkg = require('../package.json'); -module.exports = ({experiments, projectDir}) => { +module.exports = ({projectDir}) => { const ava = {version: pkg.version}; const makeProvider = require('@ava/babel'); - if (experiments.noBabelOutOfTheBox) { - let fatal; - const provider = makeProvider({ - negotiateProtocol(identifiers) { - if (!identifiers.includes('noBabelOutOfTheBox')) { - fatal = new Error('TODO: Throw error when @ava/babel does not negotiate the expected protocol'); - return null; - } - - return {identifier: 'noBabelOutOfTheBox', ava, projectDir}; + let fatal; + const provider = makeProvider({ + negotiateProtocol(identifiers) { + // TODO: Settle on a identifier before releasing AVA@3; fix error message. + if (!identifiers.includes('noBabelOutOfTheBox')) { + fatal = new Error('TODO: Throw error when @ava/babel does not negotiate the expected protocol'); + return null; } - }); - - if (fatal) { - throw fatal; - } - - return { - legacy: false, - ...provider, - // Don't pass the legacy compileEnhancements value. - validateConfig: babelConfig => provider.validateConfig(babelConfig) - }; - } - let fatal; - const negotiateProtocol = identifiers => { - if (!identifiers.includes('legacy')) { - fatal = new Error('TODO: Throw error when @ava/babel does not negotiate the expected protocol'); - return null; + return {identifier: 'noBabelOutOfTheBox', ava, projectDir}; } - - return {identifier: 'legacy', ava, projectDir}; - }; - - const [full, enhancementsOnly] = [makeProvider({negotiateProtocol}), makeProvider({negotiateProtocol})]; + }); if (fatal) { throw fatal; } - return { - legacy: true, - ...full, - validateConfig(babelConfig, compileEnhancements) { - full.validateConfig({babelConfig, compileEnhancements, enhancementsOnly: false}); - enhancementsOnly.validateConfig({compileEnhancements, enhancementsOnly: true}); - }, - get compileEnhancements() { - if (enhancementsOnly.isEnabled()) { - return enhancementsOnly.compile; - } - - return null; - } - }; + return provider; }; diff --git a/lib/cli.js b/lib/cli.js index cabf2ab3b..dcd35f9ef 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -232,7 +232,7 @@ exports.run = async () => { // eslint-disable-line complexity console.log(chalk.magenta(` ${figures.warning} Experiments are enabled. These are unsupported and may change or be removed at any time.`)); } - if (experiments.noBabelOutOfTheBox && typeof conf.compileEnhancements === 'boolean') { + if (typeof conf.compileEnhancements === 'boolean') { exit('Enhancement compilation must be configured in AVA’s Babel options'); } @@ -248,10 +248,10 @@ exports.run = async () => { // eslint-disable-line complexity const validateEnvironmentVariables = require('./environment-variables'); let babelProvider; - if (!experiments.noBabelOutOfTheBox || conf.babel !== undefined) { + if (Reflect.has(conf, 'babel')) { try { - babelProvider = babelManager({experiments, projectDir}); - babelProvider.validateConfig(conf.babel, conf.compileEnhancements !== false); + babelProvider = babelManager({projectDir}); + babelProvider.validateConfig(conf.babel); } catch (error) { exit(error.message); } @@ -266,7 +266,7 @@ exports.run = async () => { // eslint-disable-line complexity let extensions; try { - extensions = normalizeExtensions(conf.extensions, babelProvider, {experiments}); + extensions = normalizeExtensions(conf.extensions, babelProvider); } catch (error) { exit(error.message); } @@ -313,7 +313,6 @@ exports.run = async () => { // eslint-disable-line complexity babelProvider, cacheEnabled: combined.cache !== false, color: combined.color, - compileEnhancements: combined.compileEnhancements !== false, concurrency: combined.concurrency || 0, debug, experiments, diff --git a/lib/enhance-assert.js b/lib/enhance-assert.js deleted file mode 100644 index e15f3ec95..000000000 --- a/lib/enhance-assert.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const concordance = require('concordance'); -const dotProp = require('dot-prop'); -const generate = require('@babel/generator').default; -const concordanceOptions = require('./concordance-options').default; - -const computeStatement = node => generate(node).code; -const getNode = (ast, path) => dotProp.get(ast, path.replace(/\//g, '.')); - -const formatter = context => { - const ast = JSON.parse(context.source.ast); - const args = context.args[0].events; - return args - .map(arg => { - const node = getNode(ast, arg.espath); - const statement = computeStatement(node); - const formatted = concordance.format(arg.value, concordanceOptions); - return [statement, formatted]; - }) - .reverse(); -}; - -module.exports.formatter = formatter; diff --git a/lib/extensions.js b/lib/extensions.js index 232958bbf..33c150dfb 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -1,47 +1,10 @@ -const legacy = (enhancementsOnly, babelIsEnabled, babelOnly) => { - // Combine all extensions possible for testing. Remove duplicate extensions. - const duplicates = []; - const seen = new Set(); - for (const ext of [...enhancementsOnly, ...babelOnly]) { - if (seen.has(ext)) { - duplicates.push(ext); - } else { - seen.add(ext); - } - } - - // Decide if and where to add the default `js` extension. Keep in mind it's not - // added if extensions have been explicitly given. - if (!seen.has('js')) { - if (babelIsEnabled && babelOnly.length === 0) { - seen.add('js'); - babelOnly.push('js'); - } +module.exports = (configuredExtensions = [], babelProvider = null) => { + const babelExtensions = babelProvider !== null && babelProvider.isEnabled() ? babelProvider.getExtensions() : []; - if (!babelIsEnabled && enhancementsOnly.length === 0) { - seen.add('js'); - enhancementsOnly.push('js'); - } - } else if (babelIsEnabled && babelOnly.length === 0) { - // If Babel is not disabled, and has the default extensions (or, explicitly, - // no configured extensions), then the `js` extension must have come from - // the `enhancementsOnly` value. That's not allowed since it'd be a - // roundabout way of disabling Babel. - throw new Error('Cannot specify generic \'js\' extension without disabling AVA\'s Babel usage.'); - } - - if (duplicates.length > 0) { - throw new Error(`Unexpected duplicate extensions in options: '${duplicates.join('\', \'')}'.`); - } - - return {all: [...seen], enhancementsOnly, babelOnly}; -}; - -const noBabelOutOfTheBox = (extensions = [], babelOnly = []) => { // Combine all extensions possible for testing. Remove duplicate extensions. const duplicates = []; const seen = new Set(); - for (const ext of [...extensions, ...babelOnly]) { + for (const ext of [...configuredExtensions, ...babelExtensions]) { if (seen.has(ext)) { duplicates.push(ext); } else { @@ -54,21 +17,10 @@ const noBabelOutOfTheBox = (extensions = [], babelOnly = []) => { } // Assume `babelOnly` would contain the `js` extension, so if it was not seen - // and `extensions` has not been explicitly given, default it to `js`. - if (!seen.has('js') && extensions === undefined) { + // and `extensions` is empty, default it to `js`. + if (!seen.has('js') && configuredExtensions.length === 0) { seen.add('js'); } - return {all: [...seen], babelOnly}; -}; - -module.exports = (configuredExtensions, babelProvider, {experiments = {}} = {}) => { - const babelIsEnabled = babelProvider !== undefined && babelProvider.isEnabled(); - const babelExtensions = babelIsEnabled ? babelProvider.getExtensions() : []; - - if (experiments.noBabelOutOfTheBox) { - return noBabelOutOfTheBox(configuredExtensions, babelExtensions); - } - - return legacy(configuredExtensions || [], babelIsEnabled, babelExtensions); + return {all: [...seen], babelOnly: babelExtensions}; }; diff --git a/lib/load-config.js b/lib/load-config.js index feacc7375..17cf53dc0 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -6,7 +6,7 @@ const pkgConf = require('pkg-conf'); const NO_SUCH_FILE = Symbol('no ava.config.js file'); const MISSING_DEFAULT_EXPORT = Symbol('missing default export'); -const EXPERIMENTS = new Set(['noBabelOutOfTheBox', 'tryAssertion']); +const EXPERIMENTS = new Set(['tryAssertion']); function loadConfig({configFile, resolveFrom = process.cwd(), defaults = {}} = {}) { // eslint-disable-line complexity let packageConf = pkgConf.sync('ava', {cwd: resolveFrom}); diff --git a/lib/runner.js b/lib/runner.js index cfb9cdcde..75face13b 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -17,6 +17,7 @@ class Runner extends Emittery { this.failWithoutAssertions = options.failWithoutAssertions !== false; this.file = options.file; this.match = options.match || []; + this.powerAssert = undefined; // Assigned later. this.projectDir = options.projectDir; this.recordNewSnapshots = options.recordNewSnapshots === true; this.runOnlyExclusive = options.runOnlyExclusive === true; @@ -276,6 +277,7 @@ class Runner extends Emittery { compareTestSnapshot: this.boundCompareTestSnapshot, updateSnapshots: this.updateSnapshots, metadata: task.metadata, + powerAssert: this.powerAssert, title: `${task.title}${titleSuffix || ''}` })); const outcome = await this.runMultiple(hooks, this.serial); @@ -317,6 +319,7 @@ class Runner extends Emittery { compareTestSnapshot: this.boundCompareTestSnapshot, updateSnapshots: this.updateSnapshots, metadata: task.metadata, + powerAssert: this.powerAssert, title: task.title, registerUniqueTitle: this.registerUniqueTitle }); diff --git a/lib/test.js b/lib/test.js index 303e0d2e7..f1f9fb563 100644 --- a/lib/test.js +++ b/lib/test.js @@ -40,7 +40,8 @@ class ExecutionContext extends assert.Assertions { }, compareWithSnapshot: options => { return test.compareWithSnapshot(options); - } + }, + powerAssert: test.powerAssert }); testMap.set(this, test); @@ -193,6 +194,7 @@ class Test { this.failWithoutAssertions = options.failWithoutAssertions; this.fn = options.fn; this.metadata = options.metadata; + this.powerAssert = options.powerAssert; this.title = options.title; this.registerUniqueTitle = options.registerUniqueTitle; this.logs = []; diff --git a/lib/worker/subprocess.js b/lib/worker/subprocess.js index 27745e821..f1f85cd2d 100644 --- a/lib/worker/subprocess.js +++ b/lib/worker/subprocess.js @@ -104,11 +104,19 @@ ipc.options.then(options => { // Store value in case to prevent required modules from modifying it. const testPath = options.file; + // Install basic source map support. + const sourceMapSupport = require('source-map-support'); + sourceMapSupport.install({ + environment: 'node', + handleUncaughtExceptions: false + }); + // Install before processing options.require, so if helpers are added to the // require configuration the *compiled* helper will be loaded. if (options.babelState !== null) { - const {experiments, projectDir} = options; - const babelProvider = babelManager({experiments, projectDir}); + const {projectDir} = options; + const babelProvider = babelManager({projectDir}); + runner.powerAssert = babelProvider.powerAssert; babelProvider.installHook(options.babelState); } diff --git a/package-lock.json b/package-lock.json index 7bc054a0f..06b56758b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,15 +5,19 @@ "requires": true, "dependencies": { "@ava/babel": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@ava/babel/-/babel-0.1.0.tgz", - "integrity": "sha512-xFaysHVFf4bwJEfcPpzJykhFewbUpoRm2Bf4ox7l1Um+Y2+LlM1XgAoN2QM8h0Cse+y8ygmVpfULy0l1BVF6yw==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@ava/babel/-/babel-0.2.0.tgz", + "integrity": "sha512-kilrbMp3zvOw5VI+ZVH+QQ3/K3oqbkctL3EC8nzr5f1wFhE++90ST24PlbS/AuIAoK9E2HJ4UJUvdH7guAkr7g==", + "dev": true, "requires": { "@ava/babel-preset-stage-4": "^4.0.0", "@ava/babel-preset-transform-test-files": "^6.0.0", "@babel/core": "^7.6.4", + "@babel/generator": "^7.7.7", "concordance": "^4.0.0", "convert-source-map": "^1.6.0", + "dot-prop": "^5.2.0", + "empower-core": "^1.2.0", "find-up": "^4.1.0", "is-plain-object": "^3.0.0", "md5-hex": "^3.0.1", @@ -28,12 +32,14 @@ "@ava/babel-plugin-throws-helper": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-4.0.0.tgz", - "integrity": "sha512-3diBLIVBPPh3j4+hb5lo0I1D+S/O/VDJPI4Y502apBxmwEqjyXG4gTSPFUlm41sSZeZzMarT/Gzovw9kV7An0w==" + "integrity": "sha512-3diBLIVBPPh3j4+hb5lo0I1D+S/O/VDJPI4Y502apBxmwEqjyXG4gTSPFUlm41sSZeZzMarT/Gzovw9kV7An0w==", + "dev": true }, "@ava/babel-preset-stage-4": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-4.0.0.tgz", "integrity": "sha512-lZEV1ZANzfzSYBU6WHSErsy7jLPbD1iIgAboASPMcKo7woVni5/5IKWeT0RxC8rY802MFktur3OKEw2JY1Tv2w==", + "dev": true, "requires": { "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-dynamic-import": "^7.5.0", @@ -46,6 +52,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-6.0.0.tgz", "integrity": "sha512-8eKhFzZp7Qcq1VLfoC75ggGT8nQs9q8fIxltU47yCB7Wi7Y8Qf6oqY1Bm0z04fIec24vEgr0ENhDHEOUGVDqnA==", + "dev": true, "requires": { "@ava/babel-plugin-throws-helper": "^4.0.0", "babel-plugin-espower": "^3.0.1" @@ -55,6 +62,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -63,6 +71,7 @@ "version": "7.7.7", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", + "dev": true, "requires": { "@babel/code-frame": "^7.5.5", "@babel/generator": "^7.7.7", @@ -84,6 +93,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -92,6 +102,7 @@ "version": "7.7.7", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "dev": true, "requires": { "@babel/types": "^7.7.4", "jsesc": "^2.5.1", @@ -103,6 +114,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.7.4", "@babel/template": "^7.7.4", @@ -113,6 +125,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "dev": true, "requires": { "@babel/types": "^7.7.4" } @@ -121,6 +134,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, "requires": { "@babel/types": "^7.7.4" } @@ -128,12 +142,14 @@ "@babel/parser": { "version": "7.7.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", - "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==" + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "dev": true }, "@babel/template": { "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.7.4", @@ -144,6 +160,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "dev": true, "requires": { "@babel/code-frame": "^7.5.5", "@babel/generator": "^7.7.4", @@ -160,6 +177,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -170,6 +188,7 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -180,6 +199,7 @@ "version": "7.7.7", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "dev": true, "requires": { "@babel/types": "^7.7.4", "jsesc": "^2.5.1", @@ -191,6 +211,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -200,17 +221,42 @@ } }, "@babel/helper-annotate-as-pure": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", - "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz", + "integrity": "sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og==", + "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz", + "integrity": "sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A==", + "dev": true, + "requires": { + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.6.0" } }, "@babel/helper-function-name": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.0.0", "@babel/template": "^7.1.0", @@ -221,50 +267,78 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@babel/helper-module-imports": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", - "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz", + "integrity": "sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ==", + "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-module-transforms": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz", - "integrity": "sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.7.5.tgz", + "integrity": "sha512-A7pSxyJf1gN5qXVcidwLWydjftUN878VkalhXX5iQDuGyiGK3sOrrKKHF4/A4fwHtnsotv/NipwAeLzY4KQPvw==", + "dev": true, "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/template": "^7.4.4", - "@babel/types": "^7.5.5", + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-simple-access": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4", "lodash": "^4.17.13" }, "dependencies": { + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==" + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "dev": true }, "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -276,41 +350,163 @@ "@babel/helper-plugin-utils": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", - "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==" + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true }, "@babel/helper-regex": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz", "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==", + "dev": true, "requires": { "lodash": "^4.17.13" } }, "@babel/helper-remap-async-to-generator": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", - "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz", + "integrity": "sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw==", + "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-wrap-function": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-wrap-function": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + }, + "dependencies": { + "@babel/helper-function-name": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/parser": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "dev": true + }, + "@babel/template": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/traverse": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + } + } + }, + "@babel/types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-simple-access": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", - "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz", + "integrity": "sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A==", + "dev": true, "requires": { - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + }, + "dependencies": { + "@babel/parser": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "dev": true + }, + "@babel/template": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-split-export-declaration": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, "requires": { "@babel/types": "^7.4.4" }, @@ -319,6 +515,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -328,20 +525,96 @@ } }, "@babel/helper-wrap-function": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", - "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz", + "integrity": "sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg==", + "dev": true, "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.2.0" + "@babel/helper-function-name": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" }, "dependencies": { + "@babel/helper-function-name": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/parser": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "dev": true + }, + "@babel/template": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/traverse": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + } + } + }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -354,6 +627,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", + "dev": true, "requires": { "@babel/template": "^7.7.4", "@babel/traverse": "^7.7.4", @@ -364,6 +638,7 @@ "version": "7.7.7", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "dev": true, "requires": { "@babel/types": "^7.7.4", "jsesc": "^2.5.1", @@ -375,6 +650,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.7.4", "@babel/template": "^7.7.4", @@ -385,6 +661,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "dev": true, "requires": { "@babel/types": "^7.7.4" } @@ -393,6 +670,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, "requires": { "@babel/types": "^7.7.4" } @@ -400,12 +678,14 @@ "@babel/parser": { "version": "7.7.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", - "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==" + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "dev": true }, "@babel/template": { "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.7.4", @@ -416,6 +696,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "dev": true, "requires": { "@babel/code-frame": "^7.5.5", "@babel/generator": "^7.7.4", @@ -432,6 +713,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -442,6 +724,7 @@ "version": "7.7.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -454,6 +737,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", @@ -464,6 +748,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -472,6 +757,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -482,6 +768,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "requires": { "color-name": "1.1.3" } @@ -489,17 +776,20 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -509,78 +799,86 @@ "@babel/parser": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.3.tgz", - "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==" + "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==", + "dev": true }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", - "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz", + "integrity": "sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0", - "@babel/plugin-syntax-async-generators": "^7.2.0" + "@babel/helper-remap-async-to-generator": "^7.7.4", + "@babel/plugin-syntax-async-generators": "^7.7.4" } }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz", - "integrity": "sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.4.tgz", + "integrity": "sha512-StH+nGAdO6qDB1l8sZ5UBV8AC3F2VW2I8Vfld73TMKyptMU9DY5YsJAS8U81+vEtxcH3Y/La0wG0btDrhpnhjQ==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0" + "@babel/plugin-syntax-dynamic-import": "^7.7.4" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", - "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.7.4.tgz", + "integrity": "sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" } }, "@babel/plugin-syntax-async-generators": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", - "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz", + "integrity": "sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-dynamic-import": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", - "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz", + "integrity": "sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", - "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz", + "integrity": "sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.6.2.tgz", - "integrity": "sha512-KGKT9aqKV+9YMZSkowzYoYEiHqgaDhGmPNZlZxX6UeHC4z30nC1J9IrZuGqbYFB1jaIGdv91ujpze0exiVK8bA==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.7.tgz", + "integrity": "sha512-b4in+YlTeE/QmTgrllnb3bHA0HntYvjz8O3Mcbx75UBPJA2xhb5A8nle498VhxSXJHQefjtQxpnLPehDJ4TRlg==", + "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.6.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz", - "integrity": "sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==", + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.5.tgz", + "integrity": "sha512-9Cq4zTFExwFhQI6MT1aFxgqhIsMWQWDVwOgLzl7PTWJHsNaqFvklAU+Oz6AQLAS0dJKTwZSOCo20INwktxpi3Q==", + "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.4.4", + "@babel/helper-module-transforms": "^7.7.5", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-simple-access": "^7.7.4", "babel-plugin-dynamic-import-node": "^2.3.0" } }, @@ -597,6 +895,7 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==", + "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.1.2", @@ -607,6 +906,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", + "dev": true, "requires": { "@babel/code-frame": "^7.5.5", "@babel/generator": "^7.5.5", @@ -623,6 +923,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -630,12 +931,14 @@ "@babel/parser": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==" + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", + "dev": true }, "@babel/types": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -648,6 +951,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.3.tgz", "integrity": "sha512-RpPOVfK+yatXyn8n4PB1NW6k9qjinrXrRR8ugBN8fD6hCy5RXI6PSbVqpOJBO9oSaY7Nom4ohj35feb0UR9hSA==", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.10", @@ -1075,6 +1379,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "dev": true, "requires": { "object.assign": "^4.1.0" } @@ -1083,6 +1388,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-3.0.1.tgz", "integrity": "sha512-Ms49U7VIAtQ/TtcqRbD6UBmJBUCSxiC3+zPc+eGqxKUIFO1lTshyEDRUjhoAbd2rWfwYf3cZ62oXozrd8W6J0A==", + "dev": true, "requires": { "@babel/generator": "^7.0.0", "@babel/parser": "^7.0.0", @@ -1352,6 +1658,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.1.0.tgz", "integrity": "sha512-IoQLeNwwf9KTNbtSA7aEBb1yfDbdnzwjCetjkC8io5oGeOmK2CBNdg0xr+tadRYKO0p7uQyZzvon0kXlZbvGrw==", + "dev": true, "requires": { "core-js": "^2.0.0", "deep-equal": "^1.0.0", @@ -1368,7 +1675,8 @@ "call-signature": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" + "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=", + "dev": true }, "callsites": { "version": "3.1.0", @@ -1918,9 +2226,10 @@ } }, "core-js": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=" + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -2099,9 +2408,10 @@ } }, "deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", - "integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, "requires": { "is-arguments": "^1.0.4", "is-date-object": "^1.0.1", @@ -2157,6 +2467,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -2322,6 +2633,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", + "dev": true, "requires": { "call-signature": "0.0.2", "core-js": "^2.0.0" @@ -2413,7 +2725,8 @@ "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==" + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true }, "escape-string-regexp": { "version": "2.0.0", @@ -3286,6 +3599,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", + "dev": true, "requires": { "is-url": "^1.2.1", "path-is-absolute": "^1.0.0", @@ -3313,6 +3627,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", + "dev": true, "requires": { "core-js": "^2.0.0" } @@ -3338,7 +3653,8 @@ "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true }, "esutils": { "version": "2.0.2", @@ -4264,7 +4580,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "function-loop": { "version": "1.0.2", @@ -4395,7 +4712,8 @@ "globals": { "version": "11.3.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", - "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==" + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "dev": true }, "globby": { "version": "10.0.1", @@ -4539,6 +4857,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -4568,7 +4887,8 @@ "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true }, "has-value": { "version": "1.0.0", @@ -4925,7 +5245,8 @@ "is-arguments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true }, "is-arrayish": { "version": "0.2.1", @@ -4989,7 +5310,8 @@ "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true }, "is-descriptor": { "version": "1.0.2", @@ -5177,11 +5499,12 @@ } }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, "is-stream": { @@ -5215,12 +5538,14 @@ "is-url": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==" + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true }, "is-windows": { "version": "1.0.2", @@ -5458,7 +5783,8 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "js-types": { "version": "1.0.0", @@ -5484,7 +5810,8 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true }, "json-buffer": { "version": "3.0.0", @@ -5524,6 +5851,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "dev": true, "requires": { "minimist": "^1.2.0" }, @@ -5531,7 +5859,8 @@ "minimist": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true } } }, @@ -6571,14 +6900,16 @@ "dev": true }, "object-is": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", - "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==", + "dev": true }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true }, "object-visit": { "version": "1.0.1", @@ -6601,6 +6932,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -6854,6 +7186,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, "requires": { "graceful-fs": "^4.1.15", "hasha": "^5.0.0", @@ -6864,12 +7197,14 @@ "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true }, "hasha": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", + "dev": true, "requires": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" @@ -6878,12 +7213,14 @@ "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true } } }, @@ -6972,7 +7309,8 @@ "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true }, "path-to-regexp": { "version": "1.7.0", @@ -7411,12 +7749,14 @@ "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true }, "regenerate-unicode-properties": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "dev": true, "requires": { "regenerate": "^1.4.0" } @@ -7443,11 +7783,13 @@ "dev": true }, "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, "requires": { - "define-properties": "^1.1.2" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "regexpp": { @@ -7460,6 +7802,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", + "dev": true, "requires": { "regenerate": "^1.4.0", "regenerate-unicode-properties": "^8.1.0", @@ -7489,12 +7832,14 @@ "regjsgen": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==" + "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "dev": true }, "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.2.tgz", + "integrity": "sha512-E9ghzUtoLwDekPT0DYCp+c4h+bvuUpe6rRHCTYn6eGoqj1LgKXxT6I0Il4WbjhQkOghzi/V+y03bPKvbllL93Q==", + "dev": true, "requires": { "jsesc": "~0.5.0" }, @@ -7502,7 +7847,8 @@ "jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true } } }, @@ -7510,6 +7856,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, "requires": { "es6-error": "^4.0.1" } @@ -7581,7 +7928,8 @@ "require-precompiled": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", - "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=" + "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", + "dev": true }, "reserved-words": { "version": "0.1.2", @@ -7593,6 +7941,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, "requires": { "path-parse": "^1.0.5" } @@ -7734,7 +8083,8 @@ "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true }, "semver-diff": { "version": "3.1.1", @@ -8026,7 +8376,8 @@ "source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=" + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "dev": true }, "source-map-fixtures": { "version": "2.1.0", @@ -8339,6 +8690,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-2.0.0.tgz", "integrity": "sha512-gLFNHucd6gzb8jMsl5QmZ3QgnUJmp7qn4uUSHNwEXumAp7YizoGYw19ZUVfuq4aBOQUtyn2k8X/CwzWB73W2lQ==", + "dev": true, "requires": { "is-utf8": "^0.2.1" } @@ -9733,7 +10085,8 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true }, "to-object-path": { "version": "0.3.0", @@ -9996,7 +10349,8 @@ "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true }, "unicode-length": { "version": "1.0.3", @@ -10035,6 +10389,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, "requires": { "unicode-canonical-property-names-ecmascript": "^1.0.4", "unicode-property-aliases-ecmascript": "^1.0.4" @@ -10043,12 +10398,14 @@ "unicode-match-property-value-ecmascript": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", - "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==" + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "dev": true }, "unicode-property-aliases-ecmascript": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", - "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==" + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true }, "union-value": { "version": "1.0.1", @@ -11278,7 +11635,8 @@ "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true }, "y18n": { "version": "4.0.0", diff --git a/package.json b/package.json index 9a4d4f049..834ff6d6d 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,6 @@ "typescript" ], "dependencies": { - "@ava/babel": "^0.1.0", - "@babel/generator": "^7.7.7", "@concordance/react": "^2.0.0", "ansi-escapes": "^4.3.0", "ansi-styles": "^4.2.0", @@ -80,9 +78,7 @@ "currently-unhandled": "^0.4.1", "debug": "^4.1.1", "del": "^5.1.0", - "dot-prop": "^5.2.0", "emittery": "^0.5.1", - "empower-core": "^1.2.0", "equal-length": "^1.0.0", "escape-string-regexp": "^2.0.0", "esm": "^3.2.25", @@ -111,6 +107,7 @@ "pretty-ms": "^5.1.0", "resolve-cwd": "^3.0.0", "slash": "^3.0.0", + "source-map-support": "^0.5.16", "stack-utils": "^2.0.1", "strip-ansi": "^6.0.0", "supertap": "^1.0.0", @@ -123,6 +120,7 @@ "yargs": "^15.0.2" }, "devDependencies": { + "@ava/babel": "^0.2.0", "@babel/core": "^7.7.7", "@types/node": "^10.17.11", "cli-table3": "^0.5.1", @@ -139,7 +137,6 @@ "signal-exit": "^3.0.0", "sinon": "^7.5.0", "source-map-fixtures": "^2.1.0", - "source-map-support": "^0.5.16", "tap": "^14.10.5", "temp-write": "^4.0.0", "touch": "^3.1.0", diff --git a/readme.md b/readme.md index 7bcfa9b96..a3c3e45c9 100644 --- a/readme.md +++ b/readme.md @@ -25,7 +25,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/rea - Includes TypeScript definitions - [Magic assert](#magic-assert) - [Isolated environment for each test file](./docs/01-writing-tests.md#process-isolation) -- [Write your tests using the latest JavaScript syntax](#latest-javascript-support) +- [Write your tests using the latest JavaScript syntax](https://github.com/avajs/babel) - [Promise support](./docs/01-writing-tests.md#promise-support) - [Async function support](./docs/01-writing-tests.md#async-function-support) - [Observable support](./docs/01-writing-tests.md#observable-support) @@ -121,16 +121,6 @@ AVA adds code excerpts and clean diffs for actual and expected values. If values AVA automatically removes unrelated lines in stack traces, allowing you to find the source of an error much faster, as seen above. -### Latest JavaScript support - -AVA uses [Babel 7](https://babeljs.io) so you can use the latest JavaScript syntax in your tests. There is no extra setup required. You don't need to be using Babel in your own project for this to work either. - -We aim to support all [finished syntax proposals](https://github.com/tc39/proposals/blob/master/finished-proposals.md), as well as all syntax from ratified JavaScript versions (e.g. ES2017). See our [`@ava/stage-4`](https://github.com/avajs/babel-preset-stage-4) preset for the currently supported proposals. - -Please note that we do not add or modify built-ins. For example, if you use [`Object.fromEntries()`](https://github.com/tc39/proposal-object-from-entries) in your tests, they will crash in Node.js 10 which does not implement this method. - -You can disable this syntax support, or otherwise customize AVA's Babel pipeline. See our [Babel recipe] for more details. - ### Parallel runs in CI AVA automatically detects whether your CI environment supports parallel builds. Each build will run a subset of all test files, while still making sure all tests get executed. See the [`ci-parallel-vars`](https://www.npmjs.com/package/ci-parallel-vars) package for a list of supported CI environments. @@ -161,7 +151,7 @@ We have a growing list of [common pitfalls](docs/08-common-pitfalls.md) you may - [Browser testing](docs/recipes/browser-testing.md) - [TypeScript](docs/recipes/typescript.md) - [Flow](docs/recipes/flow.md) -- [Configuring Babel][Babel recipe] +- [Configuring Babel](https://github.com/avajs/babel) - [Using ES modules](docs/recipes/es-modules.md) - [Passing arguments to your test files](docs/recipes/passing-arguments-to-your-test-files.md) - [Testing React components](docs/recipes/react.md) @@ -243,5 +233,3 @@ It's the [Andromeda galaxy](https://simple.wikipedia.org/wiki/Andromeda_galaxy).

- -[Babel recipe]: docs/recipes/babel.md diff --git a/stage-4.js b/stage-4.js deleted file mode 100644 index 261f4b380..000000000 --- a/stage-4.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@ava/babel/stage-4'); diff --git a/test/api.js b/test/api.js index f3b1508ca..d2cb35aa9 100644 --- a/test/api.js +++ b/test/api.js @@ -1,7 +1,6 @@ 'use strict'; require('../lib/chalk').set(); -const assert = require('assert'); const path = require('path'); const fs = require('fs'); const del = require('del'); @@ -10,71 +9,25 @@ const Api = require('../lib/api'); const babelManager = require('../lib/babel-manager'); const {normalizeGlobs} = require('../lib/globs'); -const testCapitalizerPlugin = require.resolve('./fixture/babel-plugin-test-capitalizer'); - const ROOT_DIR = path.join(__dirname, '..'); -function withNodeEnv(value, run) { - assert(!('NODE_ENV' in process.env)); - process.env.NODE_ENV = value; - const reset = () => { - delete process.env.NODE_ENV; - }; - - const promise = new Promise(resolve => { - resolve(run()); - }); - promise.then(reset, reset); - return promise; -} - function apiCreator(options = {}) { options.projectDir = options.projectDir || ROOT_DIR; - options.babelProvider = babelManager({experiments: {}, projectDir: options.projectDir}); - options.babelProvider.validateConfig(options.babelConfig, options.compileEnhancements !== false); + if (options.babelConfig !== undefined) { + options.babelProvider = babelManager({projectDir: options.projectDir}); + options.babelProvider.validateConfig(options.babelConfig); + } + options.concurrency = 2; options.extensions = options.extensions || {all: ['js'], enhancementsOnly: [], babelOnly: ['js']}; options.experiments = {}; options.globs = normalizeGlobs(options.files, options.helpers, options.sources, options.extensions.all); options.resolveTestsFrom = options.resolveTestsFrom || options.projectDir; const instance = new Api(options); - if (!options.precompileHelpers) { - instance._precompileHelpers = () => Promise.resolve(); - } return instance; } -test('ES2015 support', t => { - const api = apiCreator(); - - return api.run([path.join(__dirname, 'fixture/es2015.js')]) - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - -test('precompile helpers', t => { - const api = apiCreator({ - precompileHelpers: true, - resolveTestsFrom: path.join(__dirname, 'fixture/precompile-helpers') - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - -test('async/await support', t => { - const api = apiCreator(); - - return api.run([path.join(__dirname, 'fixture/async-await.js')]) - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - test('test.meta.file', t => { const api = apiCreator(); @@ -367,7 +320,7 @@ test('stack traces for exceptions are corrected using a source map file', t => { plan.status.on('stateChange', evt => { if (evt.type === 'uncaught-exception') { t.match(evt.err.message, /Thrown by source-map-fixtures/); - t.match(evt.err.stack, /^.*?Object\.run\b.*source-map-fixtures.src.throws.js:1.*$/m); + t.match(evt.err.stack, /^.*?\brun\b.*source-map-fixtures.src.throws.js:1.*$/m); t.match(evt.err.stack, /^.*?Immediate\b.*source-map-file.js:4.*$/m); } }); @@ -379,33 +332,6 @@ test('stack traces for exceptions are corrected using a source map file', t => { }); }); -test('babel.testOptions can disable sourceMaps', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: { - sourceMaps: false - } - }, - cacheEnabled: true - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'uncaught-exception') { - t.match(evt.err.message, /Thrown by source-map-fixtures/); - t.match(evt.err.stack, /^.*?Immediate\b.*source-map-file.js:7.*$/m); - } - }); - }); - - return api.run([path.join(__dirname, 'fixture/source-map-file.js')]) - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - test('stack traces for exceptions are corrected using a source map file in what looks like a browser env', t => { t.plan(4); @@ -417,7 +343,7 @@ test('stack traces for exceptions are corrected using a source map file in what plan.status.on('stateChange', evt => { if (evt.type === 'uncaught-exception') { t.match(evt.err.message, /Thrown by source-map-fixtures/); - t.match(evt.err.stack, /^.*?Object\.run\b.*source-map-fixtures.src.throws.js:1.*$/m); + t.match(evt.err.stack, /^.*?\brun\b.*source-map-fixtures.src.throws.js:1.*$/m); t.match(evt.err.stack, /^.*?Immediate\b.*source-map-file-browser-env.js:7.*$/m); } }); @@ -453,7 +379,7 @@ test('enhanced assertion formatting necessary whitespace and empty strings', t = ]; t.plan(15); - const api = apiCreator(); + const api = apiCreator({babelConfig: true}); const errors = []; api.on('run', plan => { plan.status.on('stateChange', evt => { @@ -486,7 +412,7 @@ test('stack traces for exceptions are corrected using a source map file (cache o plan.status.on('stateChange', evt => { if (evt.type === 'uncaught-exception') { t.match(evt.err.message, /Thrown by source-map-fixtures/); - t.match(evt.err.stack, /^.*?Object\.run\b.*source-map-fixtures.src.throws.js:1.*$/m); + t.match(evt.err.stack, /^.*?\brun\b.*source-map-fixtures.src.throws.js:1.*$/m); t.match(evt.err.stack, /^.*?Immediate\b.*source-map-file.js:4.*$/m); } }); @@ -509,7 +435,7 @@ test('stack traces for exceptions are corrected using a source map, taking an in plan.status.on('stateChange', evt => { if (evt.type === 'uncaught-exception') { t.match(evt.err.message, /Thrown by source-map-fixtures/); - t.match(evt.err.stack, /^.*?Object\.t.*?\[?as run\]?\b.*source-map-fixtures.src.throws.js:1.*$/m); + t.match(evt.err.stack, /^.*?\brun\b.*source-map-fixtures.src.throws.js:1.*$/m); t.match(evt.err.stack, /^.*?Immediate\b.*source-map-initial-input.js:14.*$/m); } }); @@ -532,7 +458,7 @@ test('stack traces for exceptions are corrected using a source map, taking an in plan.status.on('stateChange', evt => { if (evt.type === 'uncaught-exception') { t.match(evt.err.message, /Thrown by source-map-fixtures/); - t.match(evt.err.stack, /^.*?Object\.t.*?\[?as run\]?\b.*source-map-fixtures.src.throws.js:1.*$/m); + t.match(evt.err.stack, /^.*?\brun\b.*source-map-fixtures.src.throws.js:1.*$/m); t.match(evt.err.stack, /^.*?Immediate\b.*source-map-initial-input.js:14.*$/m); } }); @@ -616,6 +542,7 @@ test('caching is enabled by default', t => { del.sync(path.join(__dirname, 'fixture/caching/node_modules')); const api = apiCreator({ + babelConfig: true, projectDir: path.join(__dirname, 'fixture/caching') }); @@ -716,442 +643,6 @@ test('verify test count', t => { }); }); -test('babel.testOptions with a custom plugin', t => { - t.plan(2); - - const api = apiCreator({ - babelConfig: { - testOptions: { - plugins: [testCapitalizerPlugin] - } - }, - cacheEnabled: false, - projectDir: __dirname - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.is(evt.title, 'FOO'); - } - }); - }); - - return api.run([path.join(__dirname, 'fixture/babelrc/test.js')]) - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }, t.threw); -}); - -test('babel.testOptions.babelrc effectively defaults to true', t => { - t.plan(3); - - const api = apiCreator({ - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok((evt.title === 'foo') || (evt.title === 'repeated test: foo')); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions.babelrc can explicitly be true', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: {babelrc: true} - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'foo' || evt.title === 'repeated test: foo'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions.babelrc can explicitly be false', t => { - t.plan(2); - - const api = apiCreator({ - babelConfig: { - testOptions: {babelrc: false} - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.is(evt.title, 'foo'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - -test('babel.testOptions merges plugins with .babelrc', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: { - babelrc: true, - plugins: [testCapitalizerPlugin] - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'FOO' || evt.title === 'repeated test: foo'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions.babelrc (when true) picks up .babelrc.js files', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: { - babelrc: true - } - }, - projectDir: path.join(__dirname, 'fixture/babelrc-js') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok((evt.title === 'foo') || (evt.title === 'repeated test: foo')); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions.configFile effectively defaults to true', t => { - t.plan(3); - - const api = apiCreator({ - projectDir: path.join(__dirname, 'fixture/babel-config') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok((evt.title === 'foo') || (evt.title === 'repeated test: foo')); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions.configFile can explicitly be true', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: {configFile: true} - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babel-config') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'foo' || evt.title === 'repeated test: foo'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions.configFile can explicitly be false', t => { - t.plan(2); - - const api = apiCreator({ - babelConfig: { - testOptions: {configFile: false} - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babel-config') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.is(evt.title, 'foo'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - -test('babel.testOptions merges plugins with babel.config.js', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: { - babelrc: true, - plugins: [testCapitalizerPlugin] - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babel-config') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'FOO' || evt.title === 'repeated test: foo'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions can disable ava/stage-4', t => { - t.plan(1); - - const api = apiCreator({ - babelConfig: { - testOptions: { - babelrc: false, - presets: [[require.resolve('../stage-4'), false]] - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'uncaught-exception') { - t.is(evt.err.name, 'SyntaxError'); - } - }); - }); - - return api.run(); -}); - -test('babel.testOptions with extends still merges plugins with .babelrc', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: { - plugins: [testCapitalizerPlugin], - extends: path.join(__dirname, 'fixture/babelrc/.alt-babelrc') - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'BAR' || evt.title === 'repeated test: bar'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('babel.testOptions with extends still merges plugins with babel.config.js', t => { - t.plan(3); - - const api = apiCreator({ - babelConfig: { - testOptions: { - plugins: [testCapitalizerPlugin], - extends: path.join(__dirname, 'fixture/babel-config/.alt-babelrc') - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babel-config') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'BAR' || evt.title === 'repeated test: bar'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 2); - }); -}); - -test('extended config can disable ava/stage-4', t => { - t.plan(1); - - const api = apiCreator({ - babelConfig: { - testOptions: { - babelrc: false, - extends: path.join(__dirname, 'fixture/babelrc/disable-stage-4.babelrc') - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'uncaught-exception') { - t.is(evt.err.name, 'SyntaxError'); - } - }); - }); - - return api.run(); -}); - -test('babel can be disabled for particular files', t => { - t.plan(1); - - const api = apiCreator({ - babelConfig: { - testOptions: { - babelrc: false, - ignore: [path.join(__dirname, 'fixture/babelrc/test.js')] - } - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'uncaught-exception') { - t.is(evt.err.name, 'SyntaxError'); - } - }); - }); - - return api.run(); -}); - -test('uses "development" Babel environment if NODE_ENV is the empty string', t => { - t.plan(2); - - const api = apiCreator({ - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/babelrc') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.is(evt.title, 'FOO'); - } - }); - }); - - return withNodeEnv('', () => api.run()) - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - -test('babelOnly extensions take precedence over enhancements-only', t => { - t.plan(2); - - const api = apiCreator({ - babelConfig: { - testOptions: { - plugins: [testCapitalizerPlugin] - } - }, - extensions: { - all: ['foo.bar', 'bar'], - enhancementsOnly: ['bar'], - babelOnly: ['foo.bar'] - }, - cacheEnabled: false, - projectDir: path.join(__dirname, 'fixture/extensions') - }); - - api.on('run', plan => { - plan.status.on('stateChange', evt => { - if (evt.type === 'test-passed') { - t.ok(evt.title === 'FOO'); - } - }); - }); - - return api.run() - .then(runStatus => { - t.is(runStatus.stats.passedTests, 1); - }); -}); - test('using --match with matching tests will only report those passing tests', t => { t.plan(3); diff --git a/test/fixture/async-await.js b/test/fixture/async-await.js deleted file mode 100644 index ce69fe867..000000000 --- a/test/fixture/async-await.js +++ /dev/null @@ -1,13 +0,0 @@ -import test from '../..'; - -test('async function', async t => { - t.plan(1); - const value = await Promise.resolve(1); - t.is(value, 1); -}); - -test('arrow async function', async t => { - t.plan(1); - const value = await Promise.resolve(1); - t.is(value, 1); -}); diff --git a/test/fixture/ava-paths/target/test.js b/test/fixture/ava-paths/target/test.js index 5950a2850..5ca41efa1 100644 --- a/test/fixture/ava-paths/target/test.js +++ b/test/fixture/ava-paths/target/test.js @@ -1,4 +1,4 @@ -import test from 'ava'; +const test = require('ava'); test('test', t => { t.pass(); diff --git a/test/fixture/babel-config/.alt-babelrc b/test/fixture/babel-config/.alt-babelrc deleted file mode 100644 index dfbee3980..000000000 --- a/test/fixture/babel-config/.alt-babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["../babel-plugin-foo-to-bar"] -} diff --git a/test/fixture/babel-config/babel.config.js b/test/fixture/babel-config/babel.config.js deleted file mode 100644 index 00fbd29d0..000000000 --- a/test/fixture/babel-config/babel.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - presets: ['@ava/stage-4'], - env: { - development: { - plugins: ['../babel-plugin-test-capitalizer'] - }, - test: { - plugins: ['../babel-plugin-test-doubler'] - } - } -}; diff --git a/test/fixture/babel-config/package.json b/test/fixture/babel-config/package.json deleted file mode 100644 index daa8ae391..000000000 --- a/test/fixture/babel-config/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "application-name", - "version": "0.0.1" -} diff --git a/test/fixture/babel-config/test.js b/test/fixture/babel-config/test.js deleted file mode 100644 index f5ccda0fc..000000000 --- a/test/fixture/babel-config/test.js +++ /dev/null @@ -1,11 +0,0 @@ -import test from '../../..'; - -test('foo', t => { - // Using optional catch-binding to ensure it transpiles on Node.js 8, since this - // is a Node.js 10 feature - try { - throw new Error('test'); - } catch { - t.pass(); - } -}); diff --git a/test/fixture/babel-hook-imported.js b/test/fixture/babel-hook-imported.js deleted file mode 100644 index 2d1ec2382..000000000 --- a/test/fixture/babel-hook-imported.js +++ /dev/null @@ -1 +0,0 @@ -export default () => {}; diff --git a/test/fixture/babel-hook.js b/test/fixture/babel-hook.js deleted file mode 100644 index 61aaa04ea..000000000 --- a/test/fixture/babel-hook.js +++ /dev/null @@ -1 +0,0 @@ -import './babel-hook-imported'; // eslint-disable-line import/no-unassigned-import diff --git a/test/fixture/babel-noop-plugin-or-preset.js b/test/fixture/babel-noop-plugin-or-preset.js deleted file mode 100644 index 17f95feab..000000000 --- a/test/fixture/babel-noop-plugin-or-preset.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => ({}); diff --git a/test/fixture/babel-plugin-foo-to-bar.js b/test/fixture/babel-plugin-foo-to-bar.js deleted file mode 100644 index 4d6829710..000000000 --- a/test/fixture/babel-plugin-foo-to-bar.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -function isRequire(path) { - return path.isCallExpression() && path.get('callee').isIdentifier() && (path.get('callee').node.name === 'require'); -} - -module.exports = babel => { - const t = babel.types; - - return { - visitor: { - CallExpression: path => { - // Skip require calls - const firstArg = path.get('arguments')[0]; - - if (!isRequire(path) && firstArg && firstArg.isStringLiteral() && /foo/i.test(firstArg.node.value)) { - firstArg.replaceWith(t.stringLiteral(firstArg.node.value.replace('foo', 'bar').replace('FOO', 'BAR'))); - } - } - } - }; -}; diff --git a/test/fixture/babel-plugin-test-capitalizer.js b/test/fixture/babel-plugin-test-capitalizer.js deleted file mode 100644 index 0fc511bd1..000000000 --- a/test/fixture/babel-plugin-test-capitalizer.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -function isRequire(path) { - return path.isCallExpression() && path.get('callee').isIdentifier() && (path.get('callee').node.name === 'require'); -} - -module.exports = babel => { - const t = babel.types; - - return { - visitor: { - CallExpression: path => { - // Skip require calls - const firstArg = path.get('arguments')[0]; - - if (!isRequire(path) && firstArg && firstArg.isStringLiteral() && !firstArg.node.value.includes('repeated test')) { - firstArg.replaceWith(t.stringLiteral(firstArg.node.value.toUpperCase())); - } - } - } - }; -}; diff --git a/test/fixture/babel-plugin-test-doubler.js b/test/fixture/babel-plugin-test-doubler.js deleted file mode 100644 index ea37dd92a..000000000 --- a/test/fixture/babel-plugin-test-doubler.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint-disable new-cap */ -'use strict'; - -/* - A Babel plugin that causes each AVA test to be duplicated with a new title. - - test('foo', t => {}); - - becomes - - test('foo', t => {}); - test('repeated test: foo', t => {}); - - This is used by some integration tests to validate correct handling of Babel config options. -*/ -module.exports = babel => { - const t = babel.types; - let anonCount = 1; - - return { - visitor: { - CallExpression: path => { - const {node} = path; - const {callee} = node; - let args = node.arguments; - - if (callee.type === 'Identifier' && callee.name === 'test') { - if (args.length === 1) { - args = [t.StringLiteral(`repeated test: anonymous${anonCount++}`), args[0]]; - } else if (args.length === 2 && args[0].type === 'StringLiteral') { - if (args[0].value.startsWith('repeated test')) { - return; - } - - args = args.slice(); - args[0] = t.StringLiteral(`repeated test: ${args[0].value}`); - } else { - throw new Error('The plugin does not know how to handle this call to test'); - } - - path.insertAfter(t.CallExpression( - t.Identifier('test'), - args - )); - } - } - } - }; -}; diff --git a/test/fixture/babelrc-js/.babelrc.js b/test/fixture/babelrc-js/.babelrc.js deleted file mode 100644 index 7c8af964c..000000000 --- a/test/fixture/babelrc-js/.babelrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = api => { - api.cache.forever(); - return { - 'plugins': ['../babel-plugin-test-doubler'], - 'presets': ['@ava/stage-4'] - }; -}; diff --git a/test/fixture/babelrc-js/package.json b/test/fixture/babelrc-js/package.json deleted file mode 100644 index daa8ae391..000000000 --- a/test/fixture/babelrc-js/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "application-name", - "version": "0.0.1" -} diff --git a/test/fixture/babelrc-js/test.js b/test/fixture/babelrc-js/test.js deleted file mode 100644 index f5ccda0fc..000000000 --- a/test/fixture/babelrc-js/test.js +++ /dev/null @@ -1,11 +0,0 @@ -import test from '../../..'; - -test('foo', t => { - // Using optional catch-binding to ensure it transpiles on Node.js 8, since this - // is a Node.js 10 feature - try { - throw new Error('test'); - } catch { - t.pass(); - } -}); diff --git a/test/fixture/babelrc/.alt-babelrc b/test/fixture/babelrc/.alt-babelrc deleted file mode 100644 index dfbee3980..000000000 --- a/test/fixture/babelrc/.alt-babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["../babel-plugin-foo-to-bar"] -} diff --git a/test/fixture/babelrc/.babelrc b/test/fixture/babelrc/.babelrc deleted file mode 100644 index 08776fc24..000000000 --- a/test/fixture/babelrc/.babelrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "presets": ["@ava/stage-4"], - "env": { - "development": { - "plugins": ["../babel-plugin-test-capitalizer"] - }, - "test": { - "plugins": ["../babel-plugin-test-doubler"], - } - } -} diff --git a/test/fixture/babelrc/disable-stage-4.babelrc b/test/fixture/babelrc/disable-stage-4.babelrc deleted file mode 100644 index 228f9e627..000000000 --- a/test/fixture/babelrc/disable-stage-4.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": [["../../../stage-4", false]] -} diff --git a/test/fixture/babelrc/package.json b/test/fixture/babelrc/package.json deleted file mode 100644 index daa8ae391..000000000 --- a/test/fixture/babelrc/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "application-name", - "version": "0.0.1" -} diff --git a/test/fixture/babelrc/test.js b/test/fixture/babelrc/test.js deleted file mode 100644 index f5ccda0fc..000000000 --- a/test/fixture/babelrc/test.js +++ /dev/null @@ -1,11 +0,0 @@ -import test from '../../..'; - -test('foo', t => { - // Using optional catch-binding to ensure it transpiles on Node.js 8, since this - // is a Node.js 10 feature - try { - throw new Error('test'); - } catch { - t.pass(); - } -}); diff --git a/test/fixture/caching/test.js b/test/fixture/caching/test.js index 61051370c..21615cece 100644 --- a/test/fixture/caching/test.js +++ b/test/fixture/caching/test.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { t.true(2 + 2 === 4); diff --git a/test/fixture/concurrency/test.js b/test/fixture/concurrency/test.js index 035e8bb9c..5743bf4e2 100644 --- a/test/fixture/concurrency/test.js +++ b/test/fixture/concurrency/test.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('works', t => { t.pass(); diff --git a/test/fixture/correct-sources-in-source-map/package.json b/test/fixture/correct-sources-in-source-map/package.json deleted file mode 100644 index 0967ef424..000000000 --- a/test/fixture/correct-sources-in-source-map/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/fixture/correct-sources-in-source-map/test/path-to/the/test-file.js b/test/fixture/correct-sources-in-source-map/test/path-to/the/test-file.js deleted file mode 100644 index 388a09c54..000000000 --- a/test/fixture/correct-sources-in-source-map/test/path-to/the/test-file.js +++ /dev/null @@ -1,3 +0,0 @@ -import test from '../../../../../..'; - -test('ok', t => t.pass()); diff --git a/test/fixture/enhanced-assertion-formatting.js b/test/fixture/enhanced-assertion-formatting.js index db544cb73..cdd82041e 100644 --- a/test/fixture/enhanced-assertion-formatting.js +++ b/test/fixture/enhanced-assertion-formatting.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); const foo = 'foo'; diff --git a/test/fixture/environment-variables/test.js b/test/fixture/environment-variables/test.js index de7d2dfb7..32649d148 100644 --- a/test/fixture/environment-variables/test.js +++ b/test/fixture/environment-variables/test.js @@ -1,5 +1,5 @@ -import test from '../../..'; -import {name, value} from '.'; +const test = require('../../..'); +const {name, value} = require('.'); test('works', t => { t.is(process.env[name], value); diff --git a/test/fixture/error-in-anonymous-function.js b/test/fixture/error-in-anonymous-function.js index 0a6e54242..0f076c0d4 100644 --- a/test/fixture/error-in-anonymous-function.js +++ b/test/fixture/error-in-anonymous-function.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); const getAnonymousFn = () => () => { throw new Error(); // eslint-disable-line unicorn/error-message diff --git a/test/fixture/es2015-source-maps.js b/test/fixture/es2015-source-maps.js deleted file mode 100644 index 385e483d0..000000000 --- a/test/fixture/es2015-source-maps.js +++ /dev/null @@ -1,8 +0,0 @@ -import test from '../..'; - -test('test', t => { - t.pass(); -}); - -// eslint-disable-next-line spaced-comment -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzMjAxNS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLElBQUksTUFBTSxRQUFRLENBQUM7O0FBRTFCLElBQUksQ0FBQyxDQUFDLElBQUk7QUFDVCxFQUFDLENBQUMsSUFBSSxFQUFFLENBQUM7Q0FDVCxDQUFDLENBQUMiLCJmaWxlIjoiZXMyMDE1LXNvdXJjZS1tYXBzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHRlc3QgZnJvbSAnLi4vLi4vJztcblxudGVzdCh0ID0+IHtcblx0dC5wYXNzKCk7XG59KTtcbiJdfQ== diff --git a/test/fixture/es2015.js b/test/fixture/es2015.js index 49d1343b0..cecb62275 100644 --- a/test/fixture/es2015.js +++ b/test/fixture/es2015.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('test', t => { t.pass(); diff --git a/test/fixture/eslint-plugin-helper/ava.config.js b/test/fixture/eslint-plugin-helper/ava.config.js index 51bc34384..7bb1c3640 100644 --- a/test/fixture/eslint-plugin-helper/ava.config.js +++ b/test/fixture/eslint-plugin-helper/ava.config.js @@ -1,5 +1,4 @@ export default { - babel: false, extensions: ['foo'], files: ['tests/**/*'], helpers: ['helpers/*'] diff --git a/test/fixture/extensions/test.foo.bar b/test/fixture/extensions/test.foo.bar index 0146a5186..a790cd905 100644 --- a/test/fixture/extensions/test.foo.bar +++ b/test/fixture/extensions/test.foo.bar @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); const one = {one: 1}; const two = {two: 2}; diff --git a/test/fixture/fail-fast/crash/crashes.js b/test/fixture/fail-fast/crash/crashes.js index ab018a18e..59f477e82 100644 --- a/test/fixture/fail-fast/crash/crashes.js +++ b/test/fixture/fail-fast/crash/crashes.js @@ -1,3 +1,3 @@ -import '../../../..'; // eslint-disable-line import/no-unassigned-import +require('../../../..'); // eslint-disable-line import/no-unassigned-import process.exit(1); // eslint-disable-line unicorn/no-process-exit diff --git a/test/fixture/fail-fast/crash/passes.js b/test/fixture/fail-fast/crash/passes.js index ca94aefad..b1c09d44e 100644 --- a/test/fixture/fail-fast/crash/passes.js +++ b/test/fixture/fail-fast/crash/passes.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('first pass', t => { t.pass(); diff --git a/test/fixture/fail-fast/multiple-files/fails.js b/test/fixture/fail-fast/multiple-files/fails.js index cf9474e7b..75e4ddfaf 100644 --- a/test/fixture/fail-fast/multiple-files/fails.js +++ b/test/fixture/fail-fast/multiple-files/fails.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('first pass', t => { t.pass(); diff --git a/test/fixture/fail-fast/multiple-files/passes-slow.js b/test/fixture/fail-fast/multiple-files/passes-slow.js index aba08bc4c..b758a18ef 100644 --- a/test/fixture/fail-fast/multiple-files/passes-slow.js +++ b/test/fixture/fail-fast/multiple-files/passes-slow.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test.serial('first pass', t => { t.pass(); diff --git a/test/fixture/fail-fast/multiple-files/passes.js b/test/fixture/fail-fast/multiple-files/passes.js index ca94aefad..b1c09d44e 100644 --- a/test/fixture/fail-fast/multiple-files/passes.js +++ b/test/fixture/fail-fast/multiple-files/passes.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('first pass', t => { t.pass(); diff --git a/test/fixture/fail-fast/single-file/test.js b/test/fixture/fail-fast/single-file/test.js index cf9474e7b..75e4ddfaf 100644 --- a/test/fixture/fail-fast/single-file/test.js +++ b/test/fixture/fail-fast/single-file/test.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('first pass', t => { t.pass(); diff --git a/test/fixture/fail-fast/timeout/fails.js b/test/fixture/fail-fast/timeout/fails.js index c182f29af..728b39838 100644 --- a/test/fixture/fail-fast/timeout/fails.js +++ b/test/fixture/fail-fast/timeout/fails.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test.cb('slow pass', t => { setTimeout(t.end, 1000); diff --git a/test/fixture/fail-fast/timeout/passes.js b/test/fixture/fail-fast/timeout/passes.js index ca94aefad..b1c09d44e 100644 --- a/test/fixture/fail-fast/timeout/passes.js +++ b/test/fixture/fail-fast/timeout/passes.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('first pass', t => { t.pass(); diff --git a/test/fixture/fail-fast/without-error/a.js b/test/fixture/fail-fast/without-error/a.js index 04b164450..f6d10f83e 100644 --- a/test/fixture/fail-fast/without-error/a.js +++ b/test/fixture/fail-fast/without-error/a.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('pass', t => t.pass()); diff --git a/test/fixture/fail-fast/without-error/b.js b/test/fixture/fail-fast/without-error/b.js index 0af5e877d..be966664c 100644 --- a/test/fixture/fail-fast/without-error/b.js +++ b/test/fixture/fail-fast/without-error/b.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); setTimeout(() => { test.serial('pass', t => t.pass()); diff --git a/test/fixture/formatting-color.js b/test/fixture/formatting-color.js index 15110cdd0..ef563b6f9 100644 --- a/test/fixture/formatting-color.js +++ b/test/fixture/formatting-color.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('test', t => { t.deepEqual({foo: 1}, {foo: 2}); diff --git a/test/fixture/formatting.js b/test/fixture/formatting.js deleted file mode 100644 index 42b8c07e3..000000000 --- a/test/fixture/formatting.js +++ /dev/null @@ -1,336 +0,0 @@ -import React from 'react'; -import test from '../..'; -import HelloMessage from './hello-message'; - -// Older AVA versions that do not use Concordance don't handle globals very -// well. Use this so formatting output can be contrasted between versions. -const formatGlobals = Boolean(require(process.env.AVA_PATH + '/package.json').dependencies.concordance); - -test('date formatted', t => { - const date = new Date('1969-07-20T20:17:40.000Z'); - t.true(date); -}); -test('invalid date formatted', t => { - const date = new Date('🙀'); - t.true(date); -}); -test('date formatted, subclass', t => { - class Foo extends Date {} - const date = new Foo('1969-07-20T20:17:40.000Z'); - t.true(date); -}); -test('date diff', t => { - t.deepEqual(new Date('1969-07-20T20:17:40.000Z'), new Date()); -}); -test('date diff, extra properties', t => { - t.deepEqual(new Date('1969-07-20T20:17:40.000Z'), Object.assign(new Date('1969-07-20T20:17:40.000Z'), { - foo: 'bar' - })); -}); - -test('error formatted', t => { - const err = new Error('Houston, we have a problem'); - t.true(err); -}); -test('error formatted, constructor does not match name', t => { - const err = Object.assign(new Error('Houston, we have a problem'), {name: 'FamousWords'}); - t.true(err); -}); -test('error formatted, constructor does not match name, and string tag does not match constructor', t => { - class CustomError extends Error { - constructor(message) { - super(message); - this.name = 'FamousWords'; - } - } - const err = new CustomError('Houston, we have a problem'); - t.true(err); -}); -test('error formatted, no name or constructor', t => { - class CustomError extends Error { - constructor(message) { - super(message); - this.name = ''; - } - } - const err = new CustomError('Houston, we have a problem'); - Object.defineProperty(err, 'constructor', {}); - t.true(err); -}); -test('error diff, message', t => { - t.deepEqual(new Error('Houston, we have a problem'), new Error('One small step')); -}); -test('error diff, constructor', t => { - t.deepEqual(new Error('Houston, we have a problem'), new RangeError('One small step')); -}); -test('error diff, extra properties', t => { - t.deepEqual(new Error('Houston, we have a problem'), Object.assign(new Error('Houston, we have a problem'), { - date: new Date('1969-07-20T20:17:40.000Z') - })); -}); -test('error thrown in test', () => { - throw Object.assign(new Error('Houston, we have a problem'), { - date: new Date('1969-07-20T20:17:40.000Z') - }); -}); -test.cb('callback test ended with error', t => { - t.end(Object.assign(new Error('Houston, we have a problem'), { - date: new Date('1969-07-20T20:17:40.000Z') - })); -}); -test('error thrown in test due to improper throws', t => { - const improper = () => { - throw Object.assign(new Error('Houston, we have a problem'), { - date: new Date('1969-07-20T20:17:40.000Z') - }); - }; - - t.throws(improper()); -}); -test('test returned rejected promise', () => { - return Promise.reject(Object.assign(new Error('Houston, we have a problem'), { - date: new Date('1969-07-20T20:17:40.000Z') - })); -}); - -test('array of strings formatted', t => { - const arr = ['foo']; - t.true(arr); -}); -test('array of strings diff', t => { - t.deepEqual(['foo'], ['bar']); -}); - -test('string formatted', t => { - t.true('foo'); -}); -test('string diff', t => { - t.is('foo', 'bar'); -}); -test('string diff, with overlap', t => { - t.is('foobar', 'bar'); -}); -test('multiline string diff, with overlap at start', t => { - t.is('foo\nbar', 'foo\nbaz'); -}); -test('multiline string diff, with overlap at end', t => { - t.is('bar\nbaz', 'foo\nbaz'); -}); - -test('map formatted', t => { - const map = new Map([['foo', 'bar']]); - t.true(map); -}); -test('map diff', t => { - t.deepEqual(new Map([['foo', 'bar']]), new Map([['baz', 'qux']])); -}); -test('map diff, extra properties', t => { - t.deepEqual(new Map([['foo', 'bar']]), Object.assign(new Map([['foo', 'bar']]), {baz: 'qux'})); -}); - -test('function formatted', t => { - const fn = function foo() {}; // eslint-disable-line func-name-matching, func-names - t.true(fn); -}); -test('function diff', t => { - function foo() {} - function bar() {} - t.deepEqual(foo, bar); -}); -test('function diff, extra properties', t => { - function foo() {} - function bar() {} - t.deepEqual(foo, Object.assign(bar, {baz: 'qux'})); -}); -test('anonymous function', t => { - t.true(() => {}); -}); -test('generator function', t => { - t.true(function * foo() {}); // eslint-disable-line func-names -}); - -/* eslint-disable prefer-rest-params */ -test('arguments formatted', t => { - const args = (function () { - return arguments; - })('foo'); - t.true(args); -}); -test('arguments diff', t => { - const foo = (function () { - return arguments; - })('foo'); - const bar = (function () { - return arguments; - })('bar'); - t.deepEqual(foo, bar); -}); -test('arguments diff with normal array', t => { - const foo = (function () { - return arguments; - })('foo'); - t.deepEqual(foo, ['bar']); -}); -/* eslint-enable prefer-rest-params */ - -if (formatGlobals) { - test('global formatted', t => { - t.true(global); - }); - test('global diff', t => { - t.deepEqual(global, {}); - }); -} - -test('object formatted', t => { - const obj = { - foo: 'bar' - }; - t.true(obj); -}); -test('object diff', t => { - t.deepEqual({ - foo: 'bar' - }, { - baz: 'qux' - }); -}); -test('object formatted, custom class', t => { - class Foo {} - const obj = new Foo(); - t.true(obj); -}); -test('object formatted, no constructor', t => { - class Foo {} - const obj = new Foo(); - Object.defineProperty(obj, 'constructor', {}); - t.true(obj); -}); -test('object formatted, non-Object string tag that does not match constructor', t => { - class Foo extends Array {} - const obj = new Foo(); - t.true(obj); -}); - -test('promise formatted', t => { - const promise = Promise.resolve(); - t.true(promise); -}); -test('promise diff', t => { - t.deepEqual(Promise.resolve(), Promise.resolve()); -}); -test('promise diff, extra properties', t => { - t.deepEqual(Promise.resolve(), Object.assign(Promise.resolve(), {foo: 'bar'})); -}); - -test('regexp formatted', t => { - const regexp = /foo/gi; - t.true(regexp); -}); -test('regexp diff', t => { - t.deepEqual(/foo/gi, /bar/gi); -}); -test('regexp diff, extra properties', t => { - t.deepEqual(/foo/gi, Object.assign(/foo/gi, {baz: 'qux'})); -}); - -test('set formatted', t => { - const set = new Set([{foo: 'bar'}]); - t.true(set); -}); -test('set diff, string values', t => { - t.deepEqual(new Set(['foo']), new Set(['bar'])); -}); -test('set diff, object values', t => { - t.deepEqual(new Set([{foo: 'bar'}]), new Set([{bar: 'baz'}])); -}); -test('set diff, distinct values', t => { - t.deepEqual(new Set([{foo: 'bar'}]), new Set([null])); -}); -test('set diff, extra properties', t => { - t.deepEqual(new Set([{foo: 'bar'}]), Object.assign(new Set([{foo: 'bar'}]), {baz: 'qux'})); -}); - -test('buffer formatted', t => { - const buffer = Buffer.from('decafba'.repeat(12), 'hex'); - t.true(buffer); -}); -test('buffer diff', t => { - t.deepEqual(Buffer.from('decafba'.repeat(12), 'hex'), Buffer.from('baddecaf', 'hex')); -}); -test('buffer diff, extra properties', t => { - t.deepEqual(Buffer.from('decafba'.repeat(12), 'hex'), Object.assign(Buffer.from('decafba'.repeat(12), 'hex'), {foo: 'bar'})); -}); - -test('primitives', t => { - const primitives = [ - true, - false, - null, - 0, - -0, - 42, - Infinity, - -Infinity, - NaN, - 'foo', - 'foo\nbar', - Symbol.iterator, - Symbol.for('foo'), - Symbol('bar'), - undefined - ]; - t.true(primitives); -}); - -test('circular references', t => { - const obj = {}; - obj.circular = obj; - t.true(obj); -}); - -test('react element, formatted', t => { - const element = React.createElement(HelloMessage, {name: 'Sindre'}); - t.true(element); -}); -test('react element, complex attributes, formatted', t => { - const element = React.createElement('div', { - multiline: 'Hello\nworld', - object: {foo: ['bar']} - }); - t.true(element); -}); -test('react element, opaque children, formatted', t => { - const element = React.createElement('Foo', null, new Set(['foo']), true); - t.true(element); -}); -test('react element, diff', t => { - const element = React.createElement(HelloMessage, {name: 'Sindre'}); - const other = React.createElement(HelloMessage, {name: 'Vadim'}); - t.deepEqual(element, other); -}); - -test('deep structure, formatted', t => { - const deep = { - foo: { - bar: { - baz: { - qux: 'quux' - } - } - } - }; - t.true(deep); -}); -test('deep structure, diff', t => { - const deep = { - foo: { - bar: { - baz: { - qux: 'quux' - } - } - } - }; - t.deepEqual(deep, {corge: 'grault', ...deep}); -}); diff --git a/test/fixture/hooks-skipped.js b/test/fixture/hooks-skipped.js index da1a78f7d..7edbb6e66 100644 --- a/test/fixture/hooks-skipped.js +++ b/test/fixture/hooks-skipped.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test.before(() => { throw new Error('should not run'); diff --git a/test/fixture/ignored-dirs/helpers/test.js b/test/fixture/ignored-dirs/helpers/test.js index 0aaeea531..4857ec56e 100644 --- a/test/fixture/ignored-dirs/helpers/test.js +++ b/test/fixture/ignored-dirs/helpers/test.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('test', t => { t.pass(); diff --git a/test/fixture/ignored-dirs/test.js b/test/fixture/ignored-dirs/test.js index 9d6912855..91178ffa7 100644 --- a/test/fixture/ignored-dirs/test.js +++ b/test/fixture/ignored-dirs/test.js @@ -1,3 +1,3 @@ -import test from '../../..'; +const test = require('../../..'); test('pass', t => t.pass()); diff --git a/test/fixture/improper-t-throws/async-callback.js b/test/fixture/improper-t-throws/async-callback.js index 2d160b04c..bf3193536 100644 --- a/test/fixture/improper-t-throws/async-callback.js +++ b/test/fixture/improper-t-throws/async-callback.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test.cb('test', t => { setTimeout(() => { diff --git a/test/fixture/improper-t-throws/caught-and-leaked-slowly.js b/test/fixture/improper-t-throws/caught-and-leaked-slowly.js index b97556cb1..195c46fd2 100644 --- a/test/fixture/improper-t-throws/caught-and-leaked-slowly.js +++ b/test/fixture/improper-t-throws/caught-and-leaked-slowly.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { try { diff --git a/test/fixture/improper-t-throws/caught-and-leaked-too-slowly.js b/test/fixture/improper-t-throws/caught-and-leaked-too-slowly.js index 9c876e617..17e870050 100644 --- a/test/fixture/improper-t-throws/caught-and-leaked-too-slowly.js +++ b/test/fixture/improper-t-throws/caught-and-leaked-too-slowly.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { try { diff --git a/test/fixture/improper-t-throws/caught-and-leaked.js b/test/fixture/improper-t-throws/caught-and-leaked.js index b9dfea21a..15749b4fc 100644 --- a/test/fixture/improper-t-throws/caught-and-leaked.js +++ b/test/fixture/improper-t-throws/caught-and-leaked.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { try { diff --git a/test/fixture/improper-t-throws/caught.js b/test/fixture/improper-t-throws/caught.js index 331294aef..716aa00e7 100644 --- a/test/fixture/improper-t-throws/caught.js +++ b/test/fixture/improper-t-throws/caught.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { try { diff --git a/test/fixture/improper-t-throws/leaked-from-promise.js b/test/fixture/improper-t-throws/leaked-from-promise.js index f29242d1e..ee422178e 100644 --- a/test/fixture/improper-t-throws/leaked-from-promise.js +++ b/test/fixture/improper-t-throws/leaked-from-promise.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { try { diff --git a/test/fixture/improper-t-throws/package.json b/test/fixture/improper-t-throws/package.json new file mode 100644 index 000000000..428cd2b32 --- /dev/null +++ b/test/fixture/improper-t-throws/package.json @@ -0,0 +1,5 @@ +{ + "ava": { + "babel": true + } +} diff --git a/test/fixture/improper-t-throws/promise.js b/test/fixture/improper-t-throws/promise.js index 4d60e33aa..f40581db9 100644 --- a/test/fixture/improper-t-throws/promise.js +++ b/test/fixture/improper-t-throws/promise.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { return Promise.resolve().then(() => { diff --git a/test/fixture/improper-t-throws/throws.js b/test/fixture/improper-t-throws/throws.js index 008231d14..7fda336fb 100644 --- a/test/fixture/improper-t-throws/throws.js +++ b/test/fixture/improper-t-throws/throws.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { t.throws(throwSync()); diff --git a/test/fixture/improper-t-throws/unhandled-rejection.js b/test/fixture/improper-t-throws/unhandled-rejection.js index cd5158661..c143fca03 100644 --- a/test/fixture/improper-t-throws/unhandled-rejection.js +++ b/test/fixture/improper-t-throws/unhandled-rejection.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test.cb('test', t => { Promise.resolve().then(() => { diff --git a/test/fixture/infinity-stack-trace.js b/test/fixture/infinity-stack-trace.js index 01d4a1491..392d3ce7b 100644 --- a/test/fixture/infinity-stack-trace.js +++ b/test/fixture/infinity-stack-trace.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); Error.stackTraceLimit = 1; diff --git a/test/fixture/inspect-arg.js b/test/fixture/inspect-arg.js deleted file mode 100644 index 8cb103960..000000000 --- a/test/fixture/inspect-arg.js +++ /dev/null @@ -1,5 +0,0 @@ -import test from '../..'; - -test('test', t => { - t.true(process.execArgv[0].startsWith('--inspect')); -}); diff --git a/test/fixture/invalid-extensions/babel-duplicates/package.json b/test/fixture/invalid-extensions/babel-duplicates/package.json deleted file mode 100644 index 733431391..000000000 --- a/test/fixture/invalid-extensions/babel-duplicates/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ava": { - "babel": { - "extensions": ["js", "js", "jsx", "jsx"] - } - } -} diff --git a/test/fixture/invalid-extensions/top-level-duplicates/package.json b/test/fixture/invalid-extensions/top-level-duplicates/package.json index f198b78a1..faee1de78 100644 --- a/test/fixture/invalid-extensions/top-level-duplicates/package.json +++ b/test/fixture/invalid-extensions/top-level-duplicates/package.json @@ -1,6 +1,5 @@ { "ava": { - "babel": false, "extensions": ["js", "js", "jsx", "jsx"] } } diff --git a/test/fixture/just-enhancement-compilation/_helper.js b/test/fixture/just-enhancement-compilation/_helper.js deleted file mode 100644 index db7a73f4f..000000000 --- a/test/fixture/just-enhancement-compilation/_helper.js +++ /dev/null @@ -1 +0,0 @@ -import dependency from './dependency'; // eslint-disable-line no-unused-vars diff --git a/test/fixture/just-enhancement-compilation/custom-extension/package.json b/test/fixture/just-enhancement-compilation/custom-extension/package.json deleted file mode 100644 index c532cb01e..000000000 --- a/test/fixture/just-enhancement-compilation/custom-extension/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ava": { - "extensions": ["foo"] - } -} diff --git a/test/fixture/just-enhancement-compilation/custom-extension/power-assert.foo b/test/fixture/just-enhancement-compilation/custom-extension/power-assert.foo deleted file mode 100644 index 44bfdab7a..000000000 --- a/test/fixture/just-enhancement-compilation/custom-extension/power-assert.foo +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -const test = require('../../../..'); - -test('test', t => { - const bool = false; - t.assert(bool); -}); diff --git a/test/fixture/just-enhancement-compilation/dependency.js b/test/fixture/just-enhancement-compilation/dependency.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/fixture/just-enhancement-compilation/import.js b/test/fixture/just-enhancement-compilation/import.js deleted file mode 100644 index db7a73f4f..000000000 --- a/test/fixture/just-enhancement-compilation/import.js +++ /dev/null @@ -1 +0,0 @@ -import dependency from './dependency'; // eslint-disable-line no-unused-vars diff --git a/test/fixture/just-enhancement-compilation/package.json b/test/fixture/just-enhancement-compilation/package.json deleted file mode 100644 index 43c1f864f..000000000 --- a/test/fixture/just-enhancement-compilation/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ava": { - "babel": false, - "compileEnhancements": true - } -} diff --git a/test/fixture/just-enhancement-compilation/power-assert.js b/test/fixture/just-enhancement-compilation/power-assert.js deleted file mode 100644 index a36700d80..000000000 --- a/test/fixture/just-enhancement-compilation/power-assert.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -const test = require('../../..'); - -test('test', t => { - const bool = false; - t.assert(bool); -}); diff --git a/test/fixture/long-running.js b/test/fixture/long-running.js index 8476100ba..0bcd130e8 100644 --- a/test/fixture/long-running.js +++ b/test/fixture/long-running.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test.cb('slow', t => { setTimeout(t.end, 5000); diff --git a/test/fixture/long-stack-trace/test.js b/test/fixture/long-stack-trace/test.js index 0dadbf7b6..1ee8a904b 100644 --- a/test/fixture/long-stack-trace/test.js +++ b/test/fixture/long-stack-trace/test.js @@ -1,5 +1,5 @@ -import test from '../../..'; -import Bluebird from './_enable-trace'; +const test = require('../../..'); +const Bluebird = require('./_enable-trace'); // This promise throwing pattern was used in bluebird documentation for long stack traces // http://bluebirdjs.com/docs/api/promise.longstacktraces.html diff --git a/test/fixture/match-no-match-2.js b/test/fixture/match-no-match-2.js index a502d060f..53e7b4011 100644 --- a/test/fixture/match-no-match-2.js +++ b/test/fixture/match-no-match-2.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('this test will match', t => { t.pass(); diff --git a/test/fixture/match-no-match.js b/test/fixture/match-no-match.js index d54f8df56..da82d3bb2 100644 --- a/test/fixture/match-no-match.js +++ b/test/fixture/match-no-match.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('foo', t => { t.pass(); diff --git a/test/fixture/matcher-skip.js b/test/fixture/matcher-skip.js index b49e30d3e..7078b5cea 100644 --- a/test/fixture/matcher-skip.js +++ b/test/fixture/matcher-skip.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('foo', t => { t.pass(); diff --git a/test/fixture/meta.js b/test/fixture/meta.js index c289c613f..bf7f23247 100644 --- a/test/fixture/meta.js +++ b/test/fixture/meta.js @@ -1,4 +1,4 @@ -import {default as test, meta} from '../..'; +const {default: test, meta} = require('../..'); test('meta.file', t => { t.is(meta.file, __filename); diff --git a/test/fixture/no-babel-compilation/_helper.js b/test/fixture/no-babel-compilation/_helper.js deleted file mode 100644 index db7a73f4f..000000000 --- a/test/fixture/no-babel-compilation/_helper.js +++ /dev/null @@ -1 +0,0 @@ -import dependency from './dependency'; // eslint-disable-line no-unused-vars diff --git a/test/fixture/no-babel-compilation/dependency.js b/test/fixture/no-babel-compilation/dependency.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/fixture/no-babel-compilation/import.js b/test/fixture/no-babel-compilation/import.js deleted file mode 100644 index db7a73f4f..000000000 --- a/test/fixture/no-babel-compilation/import.js +++ /dev/null @@ -1 +0,0 @@ -import dependency from './dependency'; // eslint-disable-line no-unused-vars diff --git a/test/fixture/no-babel-compilation/no-power-assert.js b/test/fixture/no-babel-compilation/no-power-assert.js deleted file mode 100644 index a36700d80..000000000 --- a/test/fixture/no-babel-compilation/no-power-assert.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -const test = require('../../..'); - -test('test', t => { - const bool = false; - t.assert(bool); -}); diff --git a/test/fixture/no-babel-compilation/package.json b/test/fixture/no-babel-compilation/package.json deleted file mode 100644 index ee673a6d2..000000000 --- a/test/fixture/no-babel-compilation/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ava": { - "babel": false, - "compileEnhancements": false - } -} diff --git a/test/fixture/no-babel-compilation/require-helper.js b/test/fixture/no-babel-compilation/require-helper.js deleted file mode 100644 index b293d6146..000000000 --- a/test/fixture/no-babel-compilation/require-helper.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const test = require('../../..'); - -test('test', t => { - t.throws(() => require('./_helper'), SyntaxError); -}); diff --git a/test/fixture/no-babel-config/.gitkeep b/test/fixture/no-babel-config/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/fixture/no-tests.js b/test/fixture/no-tests.js index 0fd49392d..ae7154f7b 100644 --- a/test/fixture/no-tests.js +++ b/test/fixture/no-tests.js @@ -1 +1 @@ -import '../..'; // eslint-disable-line import/no-unassigned-import +require('../..'); // eslint-disable-line import/no-unassigned-import diff --git a/test/fixture/node-assertions/assert-failure.js b/test/fixture/node-assertions/assert-failure.js index 0910b1ca2..9d8ab50df 100644 --- a/test/fixture/node-assertions/assert-failure.js +++ b/test/fixture/node-assertions/assert-failure.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import test from '../../..'; +const assert = require('assert'); +const test = require('../../..'); test('test', () => { assert(false); diff --git a/test/fixture/node-env-foo.js b/test/fixture/node-env-foo.js index 6c6d0416b..6dbfacbac 100644 --- a/test/fixture/node-env-foo.js +++ b/test/fixture/node-env-foo.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('NODE_ENV is foo', t => { t.plan(1); diff --git a/test/fixture/node-env-test.js b/test/fixture/node-env-test.js index 7571aecfb..ce9c870b6 100644 --- a/test/fixture/node-env-test.js +++ b/test/fixture/node-env-test.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('NODE_ENV is test', t => { t.plan(1); diff --git a/test/fixture/node-paths.js b/test/fixture/node-paths.js index 4c2be174b..d7d41fe46 100644 --- a/test/fixture/node-paths.js +++ b/test/fixture/node-paths.js @@ -1,6 +1,6 @@ -import foo from 'nested/foo'; -import bar from 'the-path/bar'; -import test from '../..'; +const foo = require('nested/foo'); +const bar = require('the-path/bar'); +const test = require('../..'); test('relative require', t => { t.is(foo, 'bar'); diff --git a/test/fixture/one-pass-one-fail.js b/test/fixture/one-pass-one-fail.js deleted file mode 100644 index 976be787c..000000000 --- a/test/fixture/one-pass-one-fail.js +++ /dev/null @@ -1,9 +0,0 @@ -import test from '../..'; - -test('this is a passing test', t => { - t.pass(); -}); - -test('this is a failing test', t => { - t.fail(); -}); diff --git a/test/fixture/parallel-runs/10.js b/test/fixture/parallel-runs/10.js index c15f970ab..c731ff1e0 100644 --- a/test/fixture/parallel-runs/10.js +++ b/test/fixture/parallel-runs/10.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '1'); diff --git a/test/fixture/parallel-runs/2.js b/test/fixture/parallel-runs/2.js index 2e4e3c21d..547547c5e 100644 --- a/test/fixture/parallel-runs/2.js +++ b/test/fixture/parallel-runs/2.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '0'); diff --git a/test/fixture/parallel-runs/2a.js b/test/fixture/parallel-runs/2a.js index 2e4e3c21d..547547c5e 100644 --- a/test/fixture/parallel-runs/2a.js +++ b/test/fixture/parallel-runs/2a.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '0'); diff --git a/test/fixture/parallel-runs/9.js b/test/fixture/parallel-runs/9.js index 2e4e3c21d..547547c5e 100644 --- a/test/fixture/parallel-runs/9.js +++ b/test/fixture/parallel-runs/9.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '0'); diff --git a/test/fixture/parallel-runs/Ab.js b/test/fixture/parallel-runs/Ab.js index 27ce52b54..40e5fd168 100644 --- a/test/fixture/parallel-runs/Ab.js +++ b/test/fixture/parallel-runs/Ab.js @@ -1,5 +1,5 @@ /* eslint-disable unicorn/filename-case */ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '1'); diff --git a/test/fixture/parallel-runs/a.js b/test/fixture/parallel-runs/a.js index c15f970ab..c731ff1e0 100644 --- a/test/fixture/parallel-runs/a.js +++ b/test/fixture/parallel-runs/a.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '1'); diff --git a/test/fixture/parallel-runs/b.js b/test/fixture/parallel-runs/b.js index 87944d18e..f56d373ec 100644 --- a/test/fixture/parallel-runs/b.js +++ b/test/fixture/parallel-runs/b.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '2'); diff --git a/test/fixture/parallel-runs/c.js b/test/fixture/parallel-runs/c.js index 87944d18e..f56d373ec 100644 --- a/test/fixture/parallel-runs/c.js +++ b/test/fixture/parallel-runs/c.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('at expected index', t => { t.is(process.env.CI_NODE_INDEX, '2'); diff --git a/test/fixture/pkg-conf/fail-without-assertions/test.js b/test/fixture/pkg-conf/fail-without-assertions/test.js index 62446a885..475eb7db7 100644 --- a/test/fixture/pkg-conf/fail-without-assertions/test.js +++ b/test/fixture/pkg-conf/fail-without-assertions/test.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('test', () => {}); diff --git a/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-3.js b/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-3.js index 96d98a983..91dbe5b2c 100644 --- a/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-3.js +++ b/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-3.js @@ -1,4 +1,4 @@ -import test from '../../../../../..'; +const test = require('../../../../../..'); test('test', t => { t.pass(); diff --git a/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-4.js b/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-4.js index 96d98a983..91dbe5b2c 100644 --- a/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-4.js +++ b/test/fixture/pkg-conf/resolve-dir/dir-a-wrapper/dir-a/dir-a-wrapper-4.js @@ -1,4 +1,4 @@ -import test from '../../../../../..'; +const test = require('../../../../../..'); test('test', t => { t.pass(); diff --git a/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-1.js b/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-1.js index dcc1fb40b..ce4a7c0bd 100644 --- a/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-1.js +++ b/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-1.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test', t => { t.pass(); diff --git a/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-2.js b/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-2.js index dcc1fb40b..ce4a7c0bd 100644 --- a/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-2.js +++ b/test/fixture/pkg-conf/resolve-dir/dir-a/dir-a-base-2.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test', t => { t.pass(); diff --git a/test/fixture/power-assert.js b/test/fixture/power-assert.js deleted file mode 100644 index 9576092a7..000000000 --- a/test/fixture/power-assert.js +++ /dev/null @@ -1,19 +0,0 @@ -import test from '../..'; - -test.serial('bar', t => { - const a = 'foo'; - t.true(a === 'bar'); -}); - -test.serial('foo', t => { - const a = 'bar'; - t.true(a === 'foo', 'with message'); -}); - -test.serial('span', t => { - const React = { // eslint-disable-line no-unused-vars - createElement: type => type - }; - - t.true(
=== ); -}); diff --git a/test/fixture/precompile-helpers/test/_b.js b/test/fixture/precompile-helpers/test/_b.js deleted file mode 100644 index da53d3bb1..000000000 --- a/test/fixture/precompile-helpers/test/_b.js +++ /dev/null @@ -1 +0,0 @@ -export default async function () {} diff --git a/test/fixture/precompile-helpers/test/helpers/a.js b/test/fixture/precompile-helpers/test/helpers/a.js deleted file mode 100644 index da53d3bb1..000000000 --- a/test/fixture/precompile-helpers/test/helpers/a.js +++ /dev/null @@ -1 +0,0 @@ -export default async function () {} diff --git a/test/fixture/precompile-helpers/test/test.js b/test/fixture/precompile-helpers/test/test.js deleted file mode 100644 index 263f208f3..000000000 --- a/test/fixture/precompile-helpers/test/test.js +++ /dev/null @@ -1,10 +0,0 @@ -import test from '../../../..'; -import a from './helpers/a'; -import b from './_b'; - -test('test', async t => { - await a(); - await b(); - - t.pass(); -}); diff --git a/test/fixture/process-cwd-default.js b/test/fixture/process-cwd-default.js index 74d82446d..e1af124a6 100644 --- a/test/fixture/process-cwd-default.js +++ b/test/fixture/process-cwd-default.js @@ -1,6 +1,6 @@ -import path from 'path'; -import pkgConf from 'pkg-conf'; -import test from '../..'; +const path = require('path'); +const pkgConf = require('pkg-conf'); +const test = require('../..'); test('test', t => { const conf = pkgConf.sync('ava'); diff --git a/test/fixture/process-cwd-pkgdir.js b/test/fixture/process-cwd-pkgdir.js index cac9f85c1..60848f47a 100644 --- a/test/fixture/process-cwd-pkgdir.js +++ b/test/fixture/process-cwd-pkgdir.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('test', t => { t.is(process.cwd(), __dirname); diff --git a/test/fixture/report/edge-cases/ava-import-no-test-declaration.js b/test/fixture/report/edge-cases/ava-import-no-test-declaration.js index 59b25bcbe..dd4d01230 100644 --- a/test/fixture/report/edge-cases/ava-import-no-test-declaration.js +++ b/test/fixture/report/edge-cases/ava-import-no-test-declaration.js @@ -1 +1 @@ -import '../../../..'; // eslint-disable-line import/no-unassigned-import +require('../../../..'); // eslint-disable-line import/no-unassigned-import diff --git a/test/fixture/report/edge-cases/import-and-use-test-member.js b/test/fixture/report/edge-cases/import-and-use-test-member.js index b3fe21dfb..e473d11cf 100644 --- a/test/fixture/report/edge-cases/import-and-use-test-member.js +++ b/test/fixture/report/edge-cases/import-and-use-test-member.js @@ -1,3 +1,3 @@ -import {test} from '../../../..'; +const {test} = require('../../../..'); test('pass', t => t.pass()); diff --git a/test/fixture/report/failfast/a.js b/test/fixture/report/failfast/a.js index 9ca43678f..7125eb48a 100644 --- a/test/fixture/report/failfast/a.js +++ b/test/fixture/report/failfast/a.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('fails', t => t.fail()); diff --git a/test/fixture/report/failfast/b.js b/test/fixture/report/failfast/b.js index a20cc6d16..16e3fae53 100644 --- a/test/fixture/report/failfast/b.js +++ b/test/fixture/report/failfast/b.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes', t => t.pass()); diff --git a/test/fixture/report/failfast2/a.js b/test/fixture/report/failfast2/a.js index cb8c65a8f..2dba2369f 100644 --- a/test/fixture/report/failfast2/a.js +++ b/test/fixture/report/failfast2/a.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('fails', t => t.fail()); test('passes', t => t.pass()); diff --git a/test/fixture/report/failfast2/b.js b/test/fixture/report/failfast2/b.js index a20cc6d16..16e3fae53 100644 --- a/test/fixture/report/failfast2/b.js +++ b/test/fixture/report/failfast2/b.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes', t => t.pass()); diff --git a/test/fixture/report/only/a.js b/test/fixture/report/only/a.js index b1894d947..56983163c 100644 --- a/test/fixture/report/only/a.js +++ b/test/fixture/report/only/a.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test.only('only', t => t.pass()); diff --git a/test/fixture/report/only/b.js b/test/fixture/report/only/b.js index a20cc6d16..16e3fae53 100644 --- a/test/fixture/report/only/b.js +++ b/test/fixture/report/only/b.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes', t => t.pass()); diff --git a/test/fixture/report/regular/bad-test-chain.js b/test/fixture/report/regular/bad-test-chain.js index 5535a7fa7..6fd334083 100644 --- a/test/fixture/report/regular/bad-test-chain.js +++ b/test/fixture/report/regular/bad-test-chain.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test.serial.test('passes', t => t.pass()); diff --git a/test/fixture/report/regular/output-in-hook.js b/test/fixture/report/regular/output-in-hook.js index f251cdfbe..0b85084d4 100644 --- a/test/fixture/report/regular/output-in-hook.js +++ b/test/fixture/report/regular/output-in-hook.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test.before(() => {}); diff --git a/test/fixture/report/regular/slow.js b/test/fixture/report/regular/slow.js index 9801c480f..02c8ff2c3 100644 --- a/test/fixture/report/regular/slow.js +++ b/test/fixture/report/regular/slow.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test.cb('slow', t => { setTimeout(t.end, 200); diff --git a/test/fixture/report/regular/test.js b/test/fixture/report/regular/test.js index 57ce82793..b749f582d 100644 --- a/test/fixture/report/regular/test.js +++ b/test/fixture/report/regular/test.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); console.log('stdout'); console.error('stderr'); diff --git a/test/fixture/report/regular/traces-in-t-throws.js b/test/fixture/report/regular/traces-in-t-throws.js index 307ef606c..aedcd4197 100644 --- a/test/fixture/report/regular/traces-in-t-throws.js +++ b/test/fixture/report/regular/traces-in-t-throws.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); function throwError() { throw new Error('uh-oh'); diff --git a/test/fixture/report/regular/uncaught-exception.js b/test/fixture/report/regular/uncaught-exception.js index 6a2a2c306..64f1550e6 100644 --- a/test/fixture/report/regular/uncaught-exception.js +++ b/test/fixture/report/regular/uncaught-exception.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes', t => { setTimeout(() => { diff --git a/test/fixture/report/regular/unhandled-rejection.js b/test/fixture/report/regular/unhandled-rejection.js index f50b60032..bfda18284 100644 --- a/test/fixture/report/regular/unhandled-rejection.js +++ b/test/fixture/report/regular/unhandled-rejection.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); const passes = t => { Promise.reject(new Error('Can\'t catch me')); diff --git a/test/fixture/report/timeoutinmultiplefiles/a.js b/test/fixture/report/timeoutinmultiplefiles/a.js index ad870d3ba..5774c64d8 100644 --- a/test/fixture/report/timeoutinmultiplefiles/a.js +++ b/test/fixture/report/timeoutinmultiplefiles/a.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('a passes', t => t.pass()); diff --git a/test/fixture/report/timeoutinmultiplefiles/b.js b/test/fixture/report/timeoutinmultiplefiles/b.js index 4040ea5c0..b292be9ee 100644 --- a/test/fixture/report/timeoutinmultiplefiles/b.js +++ b/test/fixture/report/timeoutinmultiplefiles/b.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('b passes', t => t.pass()); diff --git a/test/fixture/report/timeoutinsinglefile/a.js b/test/fixture/report/timeoutinsinglefile/a.js index f452c5f2e..2ecf035f3 100644 --- a/test/fixture/report/timeoutinsinglefile/a.js +++ b/test/fixture/report/timeoutinsinglefile/a.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes', t => t.pass()); diff --git a/test/fixture/report/timeoutwithmatch/a.js b/test/fixture/report/timeoutwithmatch/a.js index 53d2d5c31..68467969b 100644 --- a/test/fixture/report/timeoutwithmatch/a.js +++ b/test/fixture/report/timeoutwithmatch/a.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes needle', t => t.pass()); diff --git a/test/fixture/report/watch/test.js b/test/fixture/report/watch/test.js index a20cc6d16..16e3fae53 100644 --- a/test/fixture/report/watch/test.js +++ b/test/fixture/report/watch/test.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('passes', t => t.pass()); diff --git a/test/fixture/require-compiled-helper/dependency.js b/test/fixture/require-compiled-helper/dependency.js deleted file mode 100644 index 2db12cfba..000000000 --- a/test/fixture/require-compiled-helper/dependency.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = '🦄'; diff --git a/test/fixture/require-compiled-helper/package.json b/test/fixture/require-compiled-helper/package.json deleted file mode 100644 index 90089510d..000000000 --- a/test/fixture/require-compiled-helper/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ava": { - "require": [ - "./test/_helper" - ] - } -} diff --git a/test/fixture/require-compiled-helper/test/_helper.js b/test/fixture/require-compiled-helper/test/_helper.js deleted file mode 100644 index 9129e7d7b..000000000 --- a/test/fixture/require-compiled-helper/test/_helper.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from '../dependency'; - -global.value = value; diff --git a/test/fixture/require-compiled-helper/test/verify.js b/test/fixture/require-compiled-helper/test/verify.js deleted file mode 100644 index 36f8e8738..000000000 --- a/test/fixture/require-compiled-helper/test/verify.js +++ /dev/null @@ -1,5 +0,0 @@ -import test from '../../../..'; - -test('test', t => { - t.is(global.value, '🦄'); -}); diff --git a/test/fixture/reset-cache/test.js b/test/fixture/reset-cache/test.js index 9d6912855..91178ffa7 100644 --- a/test/fixture/reset-cache/test.js +++ b/test/fixture/reset-cache/test.js @@ -1,3 +1,3 @@ -import test from '../../..'; +const test = require('../../..'); test('pass', t => t.pass()); diff --git a/test/fixture/serial.js b/test/fixture/serial.js index afaa3fb57..224043fcd 100644 --- a/test/fixture/serial.js +++ b/test/fixture/serial.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); const tests = []; diff --git a/test/fixture/skip-only.js b/test/fixture/skip-only.js index 30f3b9fc2..d12d87383 100644 --- a/test/fixture/skip-only.js +++ b/test/fixture/skip-only.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test.skip('test', t => { t.fail(); diff --git a/test/fixture/slow-exit.js b/test/fixture/slow-exit.js deleted file mode 100644 index fc191b2ff..000000000 --- a/test/fixture/slow-exit.js +++ /dev/null @@ -1,31 +0,0 @@ -import signalExit from 'signal-exit'; -import test from '../..'; - -test.cb('long running', t => { - t.plan(1); - - signalExit(() => { - // Simulate an exit hook that lasts a short while - const start = Date.now(); - - while (Date.now() - start < 2000) { - // Synchronously wait for 2 seconds - } - - process.send({ - name: 'cleanup-completed', - data: {completed: true}, - ava: true - }); - }, {alwaysLast: true}); - - setTimeout(() => { - t.pass(); - t.end(); - }); - - setTimeout(() => { - // This would keep the process running for a long time - console.log('I\'m gonna live forever!!'); - }, 15000); -}); diff --git a/test/fixture/snapshots/__tests__-dir/__tests__/test.js b/test/fixture/snapshots/__tests__-dir/__tests__/test.js index b1ba91e85..044cf45ae 100644 --- a/test/fixture/snapshots/__tests__-dir/__tests__/test.js +++ b/test/fixture/snapshots/__tests__-dir/__tests__/test.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-content/tests/test.js b/test/fixture/snapshots/test-content/tests/test.js index ac07d4217..b06e14ee8 100644 --- a/test/fixture/snapshots/test-content/tests/test.js +++ b/test/fixture/snapshots/test-content/tests/test.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-dir/test/test.js b/test/fixture/snapshots/test-dir/test/test.js index b1ba91e85..044cf45ae 100644 --- a/test/fixture/snapshots/test-dir/test/test.js +++ b/test/fixture/snapshots/test-dir/test/test.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-snapshot-location/src/feature/nested-feature/test.js b/test/fixture/snapshots/test-snapshot-location/src/feature/nested-feature/test.js index 48d112273..fd1ba7e91 100644 --- a/test/fixture/snapshots/test-snapshot-location/src/feature/nested-feature/test.js +++ b/test/fixture/snapshots/test-snapshot-location/src/feature/nested-feature/test.js @@ -1,4 +1,4 @@ -import test from '../../../../../../..'; +const test = require('../../../../../../..'); test('test nested feature title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-snapshot-location/src/feature/test.js b/test/fixture/snapshots/test-snapshot-location/src/feature/test.js index fa8621f13..87a759c42 100644 --- a/test/fixture/snapshots/test-snapshot-location/src/feature/test.js +++ b/test/fixture/snapshots/test-snapshot-location/src/feature/test.js @@ -1,4 +1,4 @@ -import test from '../../../../../..'; +const test = require('../../../../../..'); test('test feature title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-snapshot-location/src/test.js b/test/fixture/snapshots/test-snapshot-location/src/test.js index b1ba91e85..044cf45ae 100644 --- a/test/fixture/snapshots/test-snapshot-location/src/test.js +++ b/test/fixture/snapshots/test-snapshot-location/src/test.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-sourcemaps/build/feature/__tests__/test.js b/test/fixture/snapshots/test-sourcemaps/build/feature/__tests__/test.js index a78a6e867..9b43b2031 100644 --- a/test/fixture/snapshots/test-sourcemaps/build/feature/__tests__/test.js +++ b/test/fixture/snapshots/test-sourcemaps/build/feature/__tests__/test.js @@ -1,4 +1,4 @@ -import test from '../../../../../../..'; +const test = require('../../../../../../..'); test('feature test title', t => { t.snapshot({ foo: 'bar' }); t.snapshot({ answer: 40 }); @@ -6,4 +6,4 @@ test('feature test title', t => { test('another feature test', t => { t.snapshot(new Map()); }); -//# sourceMappingURL=test.js.map \ No newline at end of file +//# sourceMappingURL=test.js.map diff --git a/test/fixture/snapshots/test-sourcemaps/build/test.js b/test/fixture/snapshots/test-sourcemaps/build/test.js index 1dd4afe09..dcb652393 100644 --- a/test/fixture/snapshots/test-sourcemaps/build/test.js +++ b/test/fixture/snapshots/test-sourcemaps/build/test.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('top level test title', t => { t.snapshot({ foo: 'bar' }); t.snapshot({ answer: 42 }); @@ -6,4 +6,4 @@ test('top level test title', t => { test('another top level test', t => { t.snapshot(new Map()); }); -//# sourceMappingURL=test.js.map \ No newline at end of file +//# sourceMappingURL=test.js.map diff --git a/test/fixture/snapshots/test-sourcemaps/build/test/test.js b/test/fixture/snapshots/test-sourcemaps/build/test/test.js index dbcedab47..6262386a8 100644 --- a/test/fixture/snapshots/test-sourcemaps/build/test/test.js +++ b/test/fixture/snapshots/test-sourcemaps/build/test/test.js @@ -1,4 +1,4 @@ -import test from '../../../../../..'; +const test = require('../../../../../..'); test('test title', t => { t.snapshot({ foo: 'bar' }); t.snapshot({ answer: 43 }); @@ -6,4 +6,4 @@ test('test title', t => { test('another test', t => { t.snapshot(new Map()); }); -//# sourceMappingURL=test.js.map \ No newline at end of file +//# sourceMappingURL=test.js.map diff --git a/test/fixture/snapshots/test-sourcemaps/src/feature/__tests__/test.ts b/test/fixture/snapshots/test-sourcemaps/src/feature/__tests__/test.ts index 06398f211..1b6e56136 100644 --- a/test/fixture/snapshots/test-sourcemaps/src/feature/__tests__/test.ts +++ b/test/fixture/snapshots/test-sourcemaps/src/feature/__tests__/test.ts @@ -1,4 +1,4 @@ -import test from '../../../../../../..'; +const test = require('../../../../../../..'); test('feature test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-sourcemaps/src/test.ts b/test/fixture/snapshots/test-sourcemaps/src/test.ts index 01d8591b9..dfaec4281 100644 --- a/test/fixture/snapshots/test-sourcemaps/src/test.ts +++ b/test/fixture/snapshots/test-sourcemaps/src/test.ts @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('top level test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test-sourcemaps/src/test/test.ts b/test/fixture/snapshots/test-sourcemaps/src/test/test.ts index 722ccb16a..db157f42b 100644 --- a/test/fixture/snapshots/test-sourcemaps/src/test/test.ts +++ b/test/fixture/snapshots/test-sourcemaps/src/test/test.ts @@ -1,4 +1,4 @@ -import test from '../../../../../..'; +const test = require('../../../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/test.js b/test/fixture/snapshots/test.js index f72258b0f..1b071a350 100644 --- a/test/fixture/snapshots/test.js +++ b/test/fixture/snapshots/test.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/tests-dir/tests/test.js b/test/fixture/snapshots/tests-dir/tests/test.js index b1ba91e85..044cf45ae 100644 --- a/test/fixture/snapshots/tests-dir/tests/test.js +++ b/test/fixture/snapshots/tests-dir/tests/test.js @@ -1,4 +1,4 @@ -import test from '../../../../..'; +const test = require('../../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/snapshots/watcher-rerun/test.js b/test/fixture/snapshots/watcher-rerun/test.js index 732ec657a..34fef223a 100644 --- a/test/fixture/snapshots/watcher-rerun/test.js +++ b/test/fixture/snapshots/watcher-rerun/test.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('test title', t => { t.snapshot({foo: 'bar'}); diff --git a/test/fixture/stalled-tests/callback.js b/test/fixture/stalled-tests/callback.js index 37621a1f2..e5722d70b 100644 --- a/test/fixture/stalled-tests/callback.js +++ b/test/fixture/stalled-tests/callback.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test.cb('test', t => { t.pass(); diff --git a/test/fixture/stalled-tests/observable.js b/test/fixture/stalled-tests/observable.js index 72756c4cd..d0762b5a8 100644 --- a/test/fixture/stalled-tests/observable.js +++ b/test/fixture/stalled-tests/observable.js @@ -1,5 +1,5 @@ -import Observable from 'zen-observable'; -import test from '../../..'; +const Observable = require('zen-observable'); +const test = require('../../..'); test('test', t => { return new Observable(() => { diff --git a/test/fixture/stalled-tests/promise.js b/test/fixture/stalled-tests/promise.js index 330564298..c1ea49cc6 100644 --- a/test/fixture/stalled-tests/promise.js +++ b/test/fixture/stalled-tests/promise.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { return new Promise(() => { diff --git a/test/fixture/subdir/failing-subdir.js b/test/fixture/subdir/failing-subdir.js deleted file mode 100644 index 5c132ea00..000000000 --- a/test/fixture/subdir/failing-subdir.js +++ /dev/null @@ -1,5 +0,0 @@ -import test from '../../..'; - -test('subdir fail', t => { - t.fail(); -}); diff --git a/test/fixture/subdir/in-a-subdir.js b/test/fixture/subdir/in-a-subdir.js deleted file mode 100644 index f17eb395c..000000000 --- a/test/fixture/subdir/in-a-subdir.js +++ /dev/null @@ -1,5 +0,0 @@ -import test from '../../..'; - -test('subdir', t => { - t.pass(); -}); diff --git a/test/fixture/subdir/nested/nested.js b/test/fixture/subdir/nested/nested.js deleted file mode 100644 index fb433b976..000000000 --- a/test/fixture/subdir/nested/nested.js +++ /dev/null @@ -1,5 +0,0 @@ -import test from '../../../..'; - -test('subdir', t => { - t.pass(); -}); diff --git a/test/fixture/symlinkdir/symlink.js b/test/fixture/symlinkdir/symlink.js index b888dee43..ac8a8a7b7 100644 --- a/test/fixture/symlinkdir/symlink.js +++ b/test/fixture/symlinkdir/symlink.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('test', t => { t.pass(); diff --git a/test/fixture/target-symlink.js b/test/fixture/target-symlink.js index 49d1343b0..cecb62275 100644 --- a/test/fixture/target-symlink.js +++ b/test/fixture/target-symlink.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('test', t => { t.pass(); diff --git a/test/fixture/test-count-2.js b/test/fixture/test-count-2.js index 5a13ece01..9c45f5950 100644 --- a/test/fixture/test-count-2.js +++ b/test/fixture/test-count-2.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('passCount', t => { t.pass(); diff --git a/test/fixture/test-count-3.js b/test/fixture/test-count-3.js index b74ed5c4b..28cff82ef 100644 --- a/test/fixture/test-count-3.js +++ b/test/fixture/test-count-3.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('passCount', t => { t.pass(); diff --git a/test/fixture/test-count.js b/test/fixture/test-count.js index 5a13ece01..9c45f5950 100644 --- a/test/fixture/test-count.js +++ b/test/fixture/test-count.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('passCount', t => { t.pass(); diff --git a/test/fixture/trigger-worker-exception/hack.js b/test/fixture/trigger-worker-exception/hack.js deleted file mode 100644 index 6f2218c5f..000000000 --- a/test/fixture/trigger-worker-exception/hack.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const StackUtils = require('stack-utils'); - -const original = StackUtils.prototype.parseLine; -let restored = false; -let restoreAfterFirstCall = false; -StackUtils.prototype.parseLine = function (line) { - if (restored) { - return original.call(this, line); - } - - if (restoreAfterFirstCall) { - restored = true; - } - - throw new Error('Forced error'); -}; - -exports.restoreAfterFirstCall = () => { - restoreAfterFirstCall = true; -}; diff --git a/test/fixture/trigger-worker-exception/package.json b/test/fixture/trigger-worker-exception/package.json deleted file mode 100644 index 28256d5bd..000000000 --- a/test/fixture/trigger-worker-exception/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ava": { - "require": "./hack.js" - }, - "dependencies": { - "stack-utils": "*" - } -} diff --git a/test/fixture/trigger-worker-exception/test-fallback.js b/test/fixture/trigger-worker-exception/test-fallback.js deleted file mode 100644 index f2686d1c7..000000000 --- a/test/fixture/trigger-worker-exception/test-fallback.js +++ /dev/null @@ -1,5 +0,0 @@ -import test from '../../..'; - -test('test', async () => { - throw new Error('Hi :)'); -}); diff --git a/test/fixture/trigger-worker-exception/test.js b/test/fixture/trigger-worker-exception/test.js deleted file mode 100644 index 3f622ec6e..000000000 --- a/test/fixture/trigger-worker-exception/test.js +++ /dev/null @@ -1,9 +0,0 @@ -import test from '../../..'; - -import {restoreAfterFirstCall} from './hack'; - -restoreAfterFirstCall(); - -test('test', async () => { - throw new Error('Hi :)'); -}); diff --git a/test/fixture/ts-node/package.json b/test/fixture/ts-node/package.json index ae2b2e819..341ee85bc 100644 --- a/test/fixture/ts-node/package.json +++ b/test/fixture/ts-node/package.json @@ -1,6 +1,5 @@ { "ava": { - "compileEnhancements": false, "extensions": ["ts"], "require": ["ts-node/register"] } diff --git a/test/fixture/ts-node/test.ts b/test/fixture/ts-node/test.ts index 4d43b03a7..ba3471e5a 100644 --- a/test/fixture/ts-node/test.ts +++ b/test/fixture/ts-node/test.ts @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('pass', t => { t.pass(); diff --git a/test/fixture/tty/callbacks.js b/test/fixture/tty/callbacks.js index 2b1edaabf..50acfe303 100644 --- a/test/fixture/tty/callbacks.js +++ b/test/fixture/tty/callbacks.js @@ -1,6 +1,6 @@ -import test from '../../..'; +const test = require('../../..'); -const takesCallbackAndReturnWriteResult = require('tty').WriteStream.prototype.clearLine.length === 1; +const takesCallbackAndReturnWriteResult = require('tty').WriteStream.prototype.clearLine.length === 1; // eslint-disable-line import/order const assert = takesCallbackAndReturnWriteResult ? async (t, stream) => { diff --git a/test/fixture/tty/color-disabled.js b/test/fixture/tty/color-disabled.js index c211aa29f..b22e2834b 100644 --- a/test/fixture/tty/color-disabled.js +++ b/test/fixture/tty/color-disabled.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); const assertNoColor = (t, stream) => { t.true(stream.isTTY); diff --git a/test/fixture/tty/color-enabled.js b/test/fixture/tty/color-enabled.js index cbadf6e26..1a69e840d 100644 --- a/test/fixture/tty/color-enabled.js +++ b/test/fixture/tty/color-enabled.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); const assertColor = (t, stream) => { t.true(stream.isTTY); diff --git a/test/fixture/tty/get-color-depth-missing.js b/test/fixture/tty/get-color-depth-missing.js index af2b2e511..0f1c4123c 100644 --- a/test/fixture/tty/get-color-depth-missing.js +++ b/test/fixture/tty/get-color-depth-missing.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); const assertNoGetColorDepth = (t, stream) => { t.true(stream.isTTY); diff --git a/test/fixture/tty/is-not-tty.js b/test/fixture/tty/is-not-tty.js index 44fc88493..6e94cb156 100644 --- a/test/fixture/tty/is-not-tty.js +++ b/test/fixture/tty/is-not-tty.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); const assertNotTTY = (t, stream) => { t.falsy(stream.isTTY); diff --git a/test/fixture/tty/is-tty.js b/test/fixture/tty/is-tty.js index 9478ea433..ec49aa24a 100644 --- a/test/fixture/tty/is-tty.js +++ b/test/fixture/tty/is-tty.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); const assertTTY = (t, stream) => { t.true(stream.isTTY); diff --git a/test/fixture/validate-installed-global.js b/test/fixture/validate-installed-global.js index 92a823111..3d036213d 100644 --- a/test/fixture/validate-installed-global.js +++ b/test/fixture/validate-installed-global.js @@ -1,3 +1,3 @@ -import test from '../..'; +const test = require('../..'); test('test', t => t.is(global.foo, 'bar')); diff --git a/test/fixture/watcher/custom-extensions/test.foo b/test/fixture/watcher/custom-extensions/test.foo index a7b86803a..8126bf93a 100644 --- a/test/fixture/watcher/custom-extensions/test.foo +++ b/test/fixture/watcher/custom-extensions/test.foo @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('works', t => { t.pass(); diff --git a/test/fixture/watcher/ignored-files/test.js b/test/fixture/watcher/ignored-files/test.js index 04b164450..f6d10f83e 100644 --- a/test/fixture/watcher/ignored-files/test.js +++ b/test/fixture/watcher/ignored-files/test.js @@ -1,3 +1,3 @@ -import test from '../../../..'; +const test = require('../../../..'); test('pass', t => t.pass()); diff --git a/test/fixture/watcher/tap-in-conf/test.js b/test/fixture/watcher/tap-in-conf/test.js index a7b86803a..8126bf93a 100644 --- a/test/fixture/watcher/tap-in-conf/test.js +++ b/test/fixture/watcher/tap-in-conf/test.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('works', t => { t.pass(); diff --git a/test/fixture/watcher/test.js b/test/fixture/watcher/test.js index 035e8bb9c..5743bf4e2 100644 --- a/test/fixture/watcher/test.js +++ b/test/fixture/watcher/test.js @@ -1,4 +1,4 @@ -import test from '../../..'; +const test = require('../../..'); test('works', t => { t.pass(); diff --git a/test/fixture/watcher/with-custom-ext-dependencies/test-1.js b/test/fixture/watcher/with-custom-ext-dependencies/test-1.js index fdc5398a8..54012aa29 100644 --- a/test/fixture/watcher/with-custom-ext-dependencies/test-1.js +++ b/test/fixture/watcher/with-custom-ext-dependencies/test-1.js @@ -1,5 +1,5 @@ -import test from '../../../..'; -import dependency from './source.custom-ext'; +const test = require('../../../..'); +const dependency = require('./source.custom-ext'); test('works', t => { t.truthy(dependency); diff --git a/test/fixture/watcher/with-custom-ext-dependencies/test-2.js b/test/fixture/watcher/with-custom-ext-dependencies/test-2.js index a7b86803a..8126bf93a 100644 --- a/test/fixture/watcher/with-custom-ext-dependencies/test-2.js +++ b/test/fixture/watcher/with-custom-ext-dependencies/test-2.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('works', t => { t.pass(); diff --git a/test/fixture/watcher/with-dependencies/test-1.js b/test/fixture/watcher/with-dependencies/test-1.js index 34848288a..e393e406b 100644 --- a/test/fixture/watcher/with-dependencies/test-1.js +++ b/test/fixture/watcher/with-dependencies/test-1.js @@ -1,5 +1,5 @@ -import test from '../../../..'; -import dependency from './source'; +const test = require('../../../..'); +const dependency = require('./source'); test('works', t => { t.truthy(dependency); diff --git a/test/fixture/watcher/with-dependencies/test-2.js b/test/fixture/watcher/with-dependencies/test-2.js index a7b86803a..8126bf93a 100644 --- a/test/fixture/watcher/with-dependencies/test-2.js +++ b/test/fixture/watcher/with-dependencies/test-2.js @@ -1,4 +1,4 @@ -import test from '../../../..'; +const test = require('../../../..'); test('works', t => { t.pass(); diff --git a/test/fixture/with-dependencies/no-tests.js b/test/fixture/with-dependencies/no-tests.js index befc0b59a..c05168b93 100644 --- a/test/fixture/with-dependencies/no-tests.js +++ b/test/fixture/with-dependencies/no-tests.js @@ -1,3 +1,3 @@ -import './dep-1'; // eslint-disable-line import/no-unassigned-import -import './dep-2'; // eslint-disable-line import/no-unassigned-import -import './dep-3.custom'; // eslint-disable-line import/no-unassigned-import +require('./dep-1'); // eslint-disable-line import/no-unassigned-import +require('./dep-2'); // eslint-disable-line import/no-unassigned-import +require('./dep-3.custom'); // eslint-disable-line import/no-unassigned-import diff --git a/test/fixture/with-dependencies/test-failure.js b/test/fixture/with-dependencies/test-failure.js index 58f0d6ca9..4998a42a0 100644 --- a/test/fixture/with-dependencies/test-failure.js +++ b/test/fixture/with-dependencies/test-failure.js @@ -1,8 +1,8 @@ -import test from '../../..'; +const test = require('../../..'); -import './dep-1'; // eslint-disable-line import/no-unassigned-import -import './dep-2'; // eslint-disable-line import/no-unassigned-import -import './dep-3.custom'; // eslint-disable-line import/no-unassigned-import +require('./dep-1'); // eslint-disable-line import/no-unassigned-import +require('./dep-2'); // eslint-disable-line import/no-unassigned-import +require('./dep-3.custom'); // eslint-disable-line import/no-unassigned-import test('hey ho', t => { t.fail(); diff --git a/test/fixture/with-dependencies/test-uncaught-exception.js b/test/fixture/with-dependencies/test-uncaught-exception.js index 273218b8f..f4af05e9f 100644 --- a/test/fixture/with-dependencies/test-uncaught-exception.js +++ b/test/fixture/with-dependencies/test-uncaught-exception.js @@ -1,8 +1,8 @@ -import test from '../../..'; +const test = require('../../..'); -import './dep-1'; // eslint-disable-line import/no-unassigned-import -import './dep-2'; // eslint-disable-line import/no-unassigned-import -import './dep-3.custom'; // eslint-disable-line import/no-unassigned-import +require('./dep-1'); // eslint-disable-line import/no-unassigned-import +require('./dep-2'); // eslint-disable-line import/no-unassigned-import +require('./dep-3.custom'); // eslint-disable-line import/no-unassigned-import test('hey ho', t => { t.pass(); diff --git a/test/fixture/with-dependencies/test.js b/test/fixture/with-dependencies/test.js index 6c193e67f..c1d4de506 100644 --- a/test/fixture/with-dependencies/test.js +++ b/test/fixture/with-dependencies/test.js @@ -1,8 +1,8 @@ -import test from '../../..'; +const test = require('../../..'); -import './dep-1'; // eslint-disable-line import/no-unassigned-import -import './dep-2'; // eslint-disable-line import/no-unassigned-import -import './dep-3.custom'; // eslint-disable-line import/no-unassigned-import +require('./dep-1'); // eslint-disable-line import/no-unassigned-import +require('./dep-2'); // eslint-disable-line import/no-unassigned-import +require('./dep-3.custom'); // eslint-disable-line import/no-unassigned-import test('hey ho', t => { t.pass(); diff --git a/test/fixture/worker-argv.js b/test/fixture/worker-argv.js index 5e14e3cc1..69d053a7b 100644 --- a/test/fixture/worker-argv.js +++ b/test/fixture/worker-argv.js @@ -1,4 +1,4 @@ -import test from '../..'; +const test = require('../..'); test('argv', t => { t.deepEqual(process.argv, [process.execPath, require.resolve('../../lib/worker/subprocess.js'), '--hello', 'world']); diff --git a/test/helper/report.js b/test/helper/report.js index 3eb0441d6..757d036fc 100644 --- a/test/helper/report.js +++ b/test/helper/report.js @@ -70,9 +70,8 @@ exports.sanitizers = { const run = (type, reporter, match = []) => { const projectDir = path.join(__dirname, '../fixture/report', type.toLowerCase()); - const babelProvider = babelManager({experiments: {}, projectDir}); - const compileEnhancements = true; - babelProvider.validateConfig({testOptions: {}}, compileEnhancements); + const babelProvider = babelManager({projectDir}); + babelProvider.validateConfig(true); const options = { extensions: { @@ -85,7 +84,6 @@ const run = (type, reporter, match = []) => { serial: type === 'failFast' || type === 'failFast2', require: [], cacheEnabled: true, - compileEnhancements, experiments: {}, match, babelProvider, @@ -102,7 +100,6 @@ const run = (type, reporter, match = []) => { if (type === 'typescript') { options.extensions.all.push('ts'); options.extensions.enhancementsOnly.push('ts'); - options.compileEnhancements = false; options.require = ['ts-node/register']; pattern = '*.ts'; } diff --git a/test/integration/assorted.js b/test/integration/assorted.js index 147c55d3a..70c45fa88 100644 --- a/test/integration/assorted.js +++ b/test/integration/assorted.js @@ -171,14 +171,13 @@ test('additional arguments are forwarded to the worker', t => { test('reset-cache resets cache', t => { const cacheDir = path.join(__dirname, '..', 'fixture', 'reset-cache', 'node_modules', '.cache', 'ava'); - execCli([], {dirname: 'fixture/reset-cache'}, err => { - t.ifError(err); - t.true(fs.readdirSync(cacheDir).length > 0); + fs.mkdirSync(cacheDir, {recursive: true}); + fs.writeFileSync(path.join(cacheDir, 'file'), ''); + t.true(fs.readdirSync(cacheDir).length > 0); - execCli(['reset-cache'], {dirname: 'fixture/reset-cache'}, err => { - t.ifError(err); - t.true(fs.readdirSync(cacheDir).length === 0); - t.end(); - }); + execCli(['reset-cache'], {dirname: 'fixture/reset-cache'}, err => { + t.ifError(err); + t.true(fs.readdirSync(cacheDir).length === 0); + t.end(); }); }); diff --git a/test/integration/compilation.js b/test/integration/compilation.js deleted file mode 100644 index 5739a9856..000000000 --- a/test/integration/compilation.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const {test} = require('tap'); -const {execCli} = require('../helper/cli'); - -const reImportError = /SyntaxError.*(?:token|reserved word|import|identifier).*/; - -test('precompiler require hook does not apply to source files', t => { - t.plan(3); - - execCli('babel-hook.js', (err, stdout) => { - t.ok(err); - t.is(err.code, 1); - t.match(stdout, reImportError); - t.end(); - }); -}); - -test('skips test file compilation when babel=false and compileEnhancements=false', t => { - execCli(['import.js'], {dirname: 'fixture/no-babel-compilation'}, (err, stdout) => { - t.ok(err); - t.match(stdout, reImportError); - t.end(); - }); -}); - -test('skips helper file compilation when babel=false and compileEnhancements=false', t => { - execCli(['require-helper.js'], {dirname: 'fixture/no-babel-compilation'}, (err, stdout) => { - t.ifError(err); - t.match(stdout, /1 test passed/); - t.end(); - }); -}); - -test('no power-assert when babel=false and compileEnhancements=false', t => { - execCli(['no-power-assert.js'], {dirname: 'fixture/no-babel-compilation'}, (err, stdout) => { - t.ok(err); - t.notMatch(stripAnsi(stdout), /bool\n.*=> false/); - t.end(); - }); -}); - -test('skips stage-4 transform when babel=false and compileEnhancements=true', t => { - execCli(['import.js'], {dirname: 'fixture/just-enhancement-compilation'}, (err, stdout) => { - t.ok(err); - t.match(stdout, reImportError); - t.end(); - }); -}); - -test('power-assert when babel=false and compileEnhancements=true', t => { - execCli(['power-assert.js'], {dirname: 'fixture/just-enhancement-compilation'}, (err, stdout) => { - t.ok(err); - t.match(stripAnsi(stdout), /bool\n.*=> false/); - t.end(); - }); -}); - -test('power-assert with custom extension and no regular babel pipeline', t => { - execCli(['power-assert.foo'], {dirname: 'fixture/just-enhancement-compilation/custom-extension'}, (err, stdout) => { - t.ok(err); - t.match(stripAnsi(stdout), /bool\n.*=> false/); - t.end(); - }); -}); - -test('workers load compiled helpers if in the require configuration', t => { - execCli(['test/verify.js'], {dirname: 'fixture/require-compiled-helper'}, err => { - t.ifError(err); - t.end(); - }); -}); - -test('skips babel compilation for custom extensions, with disabled enhancement compilation', t => { - execCli(['test.ts'], {dirname: 'fixture/ts-node'}, err => { - t.ifError(err); - t.end(); - }); -}); diff --git a/test/integration/config.js b/test/integration/config.js index 0aac2a644..e3b7ae786 100644 --- a/test/integration/config.js +++ b/test/integration/config.js @@ -49,7 +49,7 @@ test('use current working directory if `package.json` is not found', () => { const cliPath = require.resolve('../../cli.js'); const avaPath = require.resolve('../../'); - fs.writeFileSync(testFilePath, `import test from ${JSON.stringify(avaPath)};\ntest('test', t => { t.pass(); });`); + fs.writeFileSync(testFilePath, `const test = require(${JSON.stringify(avaPath)});\ntest('test', t => { t.pass(); });`); return execa(process.execPath, [cliPath], {cwd, env: {CI: '1'}}); }); diff --git a/test/integration/extensions.js b/test/integration/extensions.js index 5fbcdc4ea..e554465a6 100644 --- a/test/integration/extensions.js +++ b/test/integration/extensions.js @@ -3,22 +3,8 @@ const {test} = require('tap'); const figures = require('figures'); const {execCli} = require('../helper/cli'); -test('errors if top-level extensions include "js" without babel=false', t => { - execCli(['es2015.js'], {dirname: 'fixture/invalid-extensions/top-level'}, (err, stdout, stderr) => { - t.ok(err); - - let expectedOutput = '\n '; - expectedOutput += figures.cross + ' Cannot specify generic \'js\' extension without disabling AVA\'s Babel usage.'; - expectedOutput += '\n'; - - t.is(stderr, expectedOutput); - t.end(); - }); -}); - for (const [where, which, msg = '\'js\', \'jsx\''] of [ ['top-level', 'top-level-duplicates'], - ['babel', 'babel-duplicates'], ['top-level and babel', 'shared-duplicates', '\'jsx\''] ]) { test(`errors if ${where} extensions include duplicates`, t => { diff --git a/test/integration/snapshots.js b/test/integration/snapshots.js index d1ffe2144..f6accb4d3 100644 --- a/test/integration/snapshots.js +++ b/test/integration/snapshots.js @@ -50,7 +50,7 @@ test('appends to existing snapshots', t => { const cwd = uniqueTempDir({create: true}); fs.writeFileSync(path.join(cwd, 'package.json'), '{}'); - const initial = `import test from ${JSON.stringify(avaPath)} + const initial = `const test = require(${JSON.stringify(avaPath)}) test('one', t => { t.snapshot({one: true}) })`; diff --git a/test/reporters/mini.edgecases.log b/test/reporters/mini.edgecases.log index dec80be24..bae1f9ed5 100644 --- a/test/reporters/mini.edgecases.log +++ b/test/reporters/mini.edgecases.log @@ -34,6 +34,6 @@  3: test('pass', t => t.pass()); 4: - TypeError: (0 , _.test) is not a function + TypeError: test is not a function ---tty-stream-chunk-separator diff --git a/test/reporters/mini.regular.log b/test/reporters/mini.regular.log index 95dd423e2..91fe46fbb 100644 --- a/test/reporters/mini.regular.log +++ b/test/reporters/mini.regular.log @@ -425,7 +425,7 @@ stderr  3: test.serial.test('passes', t => t.pass()); 4: - TypeError: _.default.serial.test is not a function + TypeError: test.serial.test is not a function diff --git a/test/reporters/tap.edgecases.log b/test/reporters/tap.edgecases.log index 2deb41c41..59700aba5 100644 --- a/test/reporters/tap.edgecases.log +++ b/test/reporters/tap.edgecases.log @@ -17,11 +17,11 @@ not ok 3 - test/fixture/report/edge-cases/throws.js exited with a non-zero exit # No tests found in test/fixture/report/edge-cases/no-ava-import.js, make sure to import "ava" at the top of your test file not ok 4 - No tests found in test/fixture/report/edge-cases/no-ava-import.js, make sure to import "ava" at the top of your test file ---tty-stream-chunk-separator -# TypeError: (0 , _.test) is not a function -not ok 5 - TypeError: (0 , _.test) is not a function +# TypeError: test is not a function +not ok 5 - TypeError: test is not a function --- name: TypeError - message: '(0 , _.test) is not a function' + message: test is not a function at: 'import-and-use-test-member.js:3:1' ... ---tty-stream-chunk-separator diff --git a/test/reporters/tap.regular.log b/test/reporters/tap.regular.log index 3003685ba..1cc6761e7 100644 --- a/test/reporters/tap.regular.log +++ b/test/reporters/tap.regular.log @@ -1,10 +1,10 @@ TAP version 13 ---tty-stream-chunk-separator -# TypeError: _.default.serial.test is not a function -not ok 1 - TypeError: _.default.serial.test is not a function +# TypeError: test.serial.test is not a function +not ok 1 - TypeError: test.serial.test is not a function --- name: TypeError - message: _.default.serial.test is not a function + message: test.serial.test is not a function at: 'bad-test-chain.js:3:13' ... ---tty-stream-chunk-separator diff --git a/test/reporters/verbose.edgecases.log b/test/reporters/verbose.edgecases.log index ea8282b65..f89ca2caa 100644 --- a/test/reporters/verbose.edgecases.log +++ b/test/reporters/verbose.edgecases.log @@ -26,7 +26,7 @@  3: test('pass', t => t.pass()); 4: - TypeError: (0 , _.test) is not a function + TypeError: test is not a function ---tty-stream-chunk-separator ✖ test/fixture/report/edge-cases/import-and-use-test-member.js exited with a non-zero exit code: 1 diff --git a/test/reporters/verbose.regular.log b/test/reporters/verbose.regular.log index d08a34b83..09160e169 100644 --- a/test/reporters/verbose.regular.log +++ b/test/reporters/verbose.regular.log @@ -8,7 +8,7 @@  3: test.serial.test('passes', t => t.pass()); 4: - TypeError: _.default.serial.test is not a function + TypeError: test.serial.test is not a function ---tty-stream-chunk-separator ✖ test/fixture/report/regular/bad-test-chain.js exited with a non-zero exit code: 1