diff --git a/.circleci/config.yml b/.circleci/config.yml index fcee3ee8e014..bd9be807475f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,22 +18,6 @@ aliases: version: 2 jobs: - test-node-8: - working_directory: ~/jest - docker: - - image: circleci/node:8 - steps: - - checkout - - run: - command: yarn remove-prettier-dep - - restore-cache: *restore-cache - - run: *install - - save-cache: *save-cache - - run: - command: yarn test-ci-partial - - store_test_results: - path: reports/junit - test-node-10: working_directory: ~/jest docker: @@ -58,7 +42,7 @@ jobs: - run: *install - save-cache: *save-cache - run: - command: JEST_CIRCUS=1 yarn test-ci-partial + command: JEST_CIRCUS=1 yarn test-ci-partial && JEST_CIRCUS=1 yarn test-leak - store_test_results: path: reports/junit @@ -104,17 +88,6 @@ jobs: - store_test_results: path: reports/junit - test-browser: - working_directory: ~/jest - docker: - - image: circleci/node:12-browsers - steps: - - checkout - - restore-cache: *restore-cache - - run: *install - - save-cache: *save-cache - - run: yarn test-ci-es5-build-in-browser - test-or-deploy-website: working_directory: ~/jest docker: @@ -134,12 +107,10 @@ workflows: version: 2 build-and-deploy: jobs: - - test-node-8 - test-node-10 - test-node-12 - test-node-13 - test-node-14 # current - test-jest-circus - - test-browser - test-or-deploy-website: filters: *filter-ignore-gh-pages diff --git a/.eslintignore b/.eslintignore index 05311c4695d6..be8072a6a850 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,7 +3,6 @@ bin/ flow-typed/** packages/*/build/** -packages/*/build-es5/** packages/jest-diff/src/cleanupSemantic.ts website/blog website/build diff --git a/.eslintrc.js b/.eslintrc.js index d04c2f900797..e326c04673cc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,6 +26,7 @@ module.exports = { 'error', {argsIgnorePattern: '^_'}, ], + '@typescript-eslint/prefer-ts-expect-error': 'error', // Since we do `export =`. Remove for Jest 25 'import/default': 'off', 'import/order': 'error', @@ -95,7 +96,6 @@ module.exports = { files: [ 'packages/jest-jasmine2/src/jasmine/**/*', 'packages/expect/src/jasmineUtils.ts', - 'e2e/browser-support/browserTest.js', '**/vendor/**/*', ], rules: { @@ -142,6 +142,13 @@ module.exports = { // https://github.com/benmosher/eslint-plugin-import/issues/645 'import/order': 0, 'no-console': 0, + 'no-restricted-imports': [ + 2, + { + message: 'Please use graceful-fs instead.', + name: 'fs', + }, + ], 'no-unused-vars': 2, 'prettier/prettier': 2, 'sort-imports': [2, {ignoreDeclarationSort: true}], diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 78c1927a0e6f..2fef34f1beff 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -41,12 +41,10 @@ jobs: run: node scripts/build.js - name: run tsc run: yarn build:ts - - name: verify ts 3.4 compatibility + - name: verify TypeScript@3.8 compatibility run: yarn verify-old-ts - name: run eslint run: yarn lint - - name: run eslint on browser builds - run: yarn lint-es5-build - name: run prettier run: yarn lint:prettier:ci - name: check copyright headers @@ -56,8 +54,7 @@ jobs: strategy: fail-fast: false matrix: - # https://github.com/actions/setup-node/issues/27 - node-version: [8.17.0, 10.x, 12.x, 13.x, 14.x] + node-version: [10.x, 12.x, 13.x, 14.x] os: [ubuntu-latest, macOS-latest, windows-latest] runs-on: ${{ matrix.os }} @@ -82,9 +79,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: remove prettier dep - run: yarn remove-prettier-dep - if: matrix.node-version == '8.17.0' - name: install run: yarn install-no-ts-build - name: run tests diff --git a/.gitignore b/.gitignore index 36a8de27bd81..c6b727d6dfa1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ /node_modules /packages/*/build/ -/packages/*/build-es5/ /packages/*/coverage/ /packages/*/node_modules/ /packages/*/package-lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c630555d7e..e061d9be64c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,107 @@ ### Features +- `[jest-config]` Support config files exporting (`async`) `function`s ([#10001](https://github.com/facebook/jest/pull/10001)) +- `[jest-cli, jest-core]` Add `--selectProjects` CLI argument to filter test suites by project name ([#8612](https://github.com/facebook/jest/pull/8612)) + +### Fixes + +- `[jest-jasmine2]` Stop adding `:` after an error that has no message ([#9990](https://github.com/facebook/jest/pull/9990)) +- `[jest-diff]` Control no diff message color with `commonColor` in diff options ([#9997](https://github.com/facebook/jest/pull/9997)) +- `[jest-snapshot]` Fix TypeScript compilation ([#10008](https://github.com/facebook/jest/pull/10008)) + +### Chore & Maintenance + +- `[docs]` Correct confusing filename in `enableAutomock` example ([#10055](https://github.com/facebook/jest/pull/10055)) +- `[jest-core]` 🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉 ([#10000](https://github.com/facebook/jest/pull/10000)) +- `[jest-core, jest-reporters, jest-test-result, jest-types]` Cleanup `displayName` type ([#10049](https://github.com/facebook/jest/pull/10049)) + +### Performance + +## 26.0.1 + +### Fixes + +- `[jest-circus]` Backward compatibility for deprecated `DescribeBlock.tests` to not break e.g. Detox reporter + +## 26.0.0 + +### Features + +- `[jest-environment-jsdom]` [**BREAKING**] Upgrade `jsdom` to v16 ([#9606](https://github.com/facebook/jest/pull/9606)) +- `[@jest/fake-timers]` Add possibility to use a modern implementation of fake timers, backed by `@sinonjs/fake-timers` ([#7776](https://github.com/facebook/jest/pull/7776)) +- `[jest-runtime]` Add `createMockFromModule` as an alias for `genMockFromModule` ([#9962](https://github.com/facebook/jest/pull/9962)) + +### Fixes + +- `[babel-jest]` Handle `null` being passed to `createTransformer` ([#9955](https://github.com/facebook/jest/pull/9955)) +- `[jest-circus, jest-console, jest-jasmine2, jest-reporters, jest-util, pretty-format]` Fix time durating formatting and consolidate time formatting code ([#9765](https://github.com/facebook/jest/pull/9765)) +- `[jest-circus]` [**BREAKING**] Fail tests if a test takes a done callback and have return values ([#9129](https://github.com/facebook/jest/pull/9129)) +- `[jest-circus]` [**BREAKING**] Throw a proper error if a test / hook is defined asynchronously ([#8096](https://github.com/facebook/jest/pull/8096)) +- `[jest-circus]` Throw more descriptive error if hook is defined inside test ([#9957](https://github.com/facebook/jest/pull/9957)) +- `[jest-circus]` [**BREAKING**] Align execution order of tests to match `jasmine`'s top to bottom order ([#9965](https://github.com/facebook/jest/pull/9965)) +- `[jest-config, jest-resolve]` [**BREAKING**] Remove support for `browser` field ([#9943](https://github.com/facebook/jest/pull/9943)) +- `[jest-haste-map]` Stop reporting files as changed when they are only accessed ([#7347](https://github.com/facebook/jest/pull/7347)) +- `[jest-resolve]` Show relative path from root dir for `module not found` errors ([#9963](https://github.com/facebook/jest/pull/9963)) +- `[jest-runtime]` Fix absolute path moduleNameMapper + jest.mock bug ([#8727](https://github.com/facebook/jest/pull/8727)) + +### Chore & Maintenance + +- `[*]` [**BREAKING**] TypeScript definitions requires a minimum of TypeScript v3.8 ([#9823](https://github.com/facebook/jest/pull/9823)) +- `[*]` [**BREAKING**] Drop support for Node 8 ([#9423](https://github.com/facebook/jest/pull/9423)) +- `[*]` Upgrade to chalk@4 ([#9752](https://github.com/facebook/jest/pull/9752)) +- `[*]` Remove usage of `realpath-native` ([#9952](https://github.com/facebook/jest/pull/9952)) +- `[docs]` Fix example reference implementation to use Jest with Phabricator ([#8662](https://github.com/facebook/jest/pull/8662)) +- `[docs]` Added default compiler to tranform ([#8583](https://github.com/facebook/jest/pull/8583)) +- `[docs]` Updated Testing Frameworks guide with React; make it generic ([#9106](https://github.com/facebook/jest/pull/9106)) +- `[expect, jest-mock, pretty-format]` [**BREAKING**] Remove `build-es5` from package ([#9945](https://github.com/facebook/jest/pull/9945)) +- `[@jest/fake-timers, @jest/environment]` [**BREAKING**] Rename `LolexFakeTimers` to `ModernFakeTimers` ([#9960](https://github.com/facebook/jest/pull/9960)) +- `[jest-haste-map]` [**BREAKING**] removed `providesModuleNodeModules` ([#8535](https://github.com/facebook/jest/pull/8535)) +- `[jest-runtime]` [**BREAKING**] Remove long-deprecated `require.requireActual` and `require.requireMock` methods ([#9854](https://github.com/facebook/jest/pull/9854)) + +## 25.5.4 + +### Fixes + +- `[jest-jasmine2]` Don't run `beforeAll` / `afterAll` in skipped describe blocks ([#9931](https://github.com/facebook/jest/pull/9931)) + +### Chore & Maintenance + +- `[jest-runtime]` Do not warn when mutating `require.cache` ([#9946](https://github.com/facebook/jest/pull/9946)) + +## 25.5.3 + +### Chore & Maintenance + +- `[jest-circus]` Fix memory leak when running in band ([#9934](https://github.com/facebook/jest/pull/9934)) + +## 25.5.2 + +### Fixes + +- `[jest-globals]` Export globals as values, not types ([#9925](https://github.com/facebook/jest/pull/9925)) + +## 25.5.1 + +### Fixes + +- `[jest-haste-map]` Add missing `@types/graceful-fs` dependency ([#9913](https://github.com/facebook/jest/pull/9913)) +- `[jest-runner]` Correctly serialize `Set` passed to worker ([#9915](https://github.com/facebook/jest/pull/9915)) +- `[jest-runtime]` Vary ESM cache by query ([#9914](https://github.com/facebook/jest/pull/9914)) + +## 25.5.0 + +### Features + - `[@jest/globals]` New package so Jest's globals can be explicitly imported ([#9801](https://github.com/facebook/jest/pull/9801)) - `[jest-core]` Show coverage of sources related to tests in changed files ([#9769](https://github.com/facebook/jest/pull/9769)) - `[jest-runtime]` Populate `require.cache` ([#9841](https://github.com/facebook/jest/pull/9841)) ### Fixes +- `[*]` Use `graceful-fs` directly in every package instead of relying on `fs` being monkey patched ([#9443](https://github.com/facebook/jest/pull/9443)) - `[expect]` Prints the Symbol name into the error message with a custom asymmetric matcher ([#9888](https://github.com/facebook/jest/pull/9888)) +- `[jest-circus, jest-jasmine2]` Support older version of `jest-runtime` ([#9903](https://github.com/facebook/jest/pull/9903) & [#9842](https://github.com/facebook/jest/pull/9842)) - `[@jest/environment]` Make sure not to reference Jest types ([#9875](https://github.com/facebook/jest/pull/9875)) - `[jest-message-util]` Code frame printing should respect `--noStackTrace` flag ([#9866](https://github.com/facebook/jest/pull/9866)) - `[jest-runtime]` Support importing CJS from ESM using `import` statements ([#9850](https://github.com/facebook/jest/pull/9850)) @@ -17,10 +111,15 @@ ### Chore & Maintenance +- `[docs]` Add an example for mocking non-default export class + ### Performance - `[jest-resolve]` Update `resolve` to a version using native `realpath`, which is faster than the default JS implementation ([#9872](https://github.com/facebook/jest/pull/9872)) - `[jest-resolve]` Pass custom cached `realpath` function to `resolve` ([#9873](https://github.com/facebook/jest/pull/9873)) +- `[jest-runtime]` Add `teardown` method to clear any caches when tests complete ([#9906](https://github.com/facebook/jest/pull/9906)) +- `[jest-runtime]` Do not pass files required internally through transformation when loading them ([#9900](https://github.com/facebook/jest/pull/9900)) +- `[jest-runtime]` Use `Map`s instead of object literals as cache holders ([#9901](https://github.com/facebook/jest/pull/9901)) ## 25.4.0 @@ -41,8 +140,6 @@ - `[*]` Do not generate TypeScript declaration source maps ([#9822](https://github.com/facebook/jest/pull/9822)) - `[*]` Transpile code for Node 8.3, not 8.0 ([#9827](https://github.com/facebook/jest/pull/9827)) -### Performance - ## 25.3.0 ### Features @@ -272,8 +369,6 @@ - `[jest-types]` Mark `InitialOptions` as `Partial` ([#8848](https://github.com/facebook/jest/pull/8848)) - `[jest-config]` Refactor `normalize` to be more type safe ([#8848](https://github.com/facebook/jest/pull/8848)) -### Performance - ## 24.9.0 ### Features diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2db2441d35b4..a8a81a5899de 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,7 +117,7 @@ PASS __tests__/clear_cache.test.js Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total -Time: 0.232s, estimated 1s +Time: 0.232 s, estimated 1 s Ran all test suites. ``` diff --git a/README.md b/README.md index 066adbc21f87..c2333f2951a6 100644 --- a/README.md +++ b/README.md @@ -207,8 +207,10 @@ Learn more about using [Jest on the official site!](https://jestjs.io) Show the world you're using _Jest_ `→` [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) + ```md -[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) +[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) +[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) ``` ## Contributing diff --git a/TestUtils.ts b/TestUtils.ts index a84f3f8bc630..0de81a811a81 100644 --- a/TestUtils.ts +++ b/TestUtils.ts @@ -13,38 +13,38 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = { changedSince: '', collectCoverage: false, collectCoverageFrom: [], - collectCoverageOnlyFrom: null, + collectCoverageOnlyFrom: undefined, coverageDirectory: 'coverage', coverageProvider: 'babel', coverageReporters: [], coverageThreshold: {global: {}}, detectLeaks: false, detectOpenHandles: false, - enabledTestsMap: null, + enabledTestsMap: undefined, errorOnDeprecated: false, expand: false, - filter: null, + filter: undefined, findRelatedTests: false, forceExit: false, - globalSetup: null, - globalTeardown: null, + globalSetup: undefined, + globalTeardown: undefined, json: false, lastCommit: false, listTests: false, logHeapUsage: false, maxConcurrency: 5, maxWorkers: 2, - noSCM: null, + noSCM: undefined, noStackTrace: false, nonFlagArgs: [], notify: false, notifyMode: 'failure-change', onlyChanged: false, onlyFailures: false, - outputFile: null, + outputFile: undefined, passWithNoTests: false, projects: [], - replname: null, + replname: undefined, reporters: [], rootDir: '/test_root_dir/', runTestsByPath: false, @@ -53,7 +53,7 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = { testFailureExitCode: 1, testNamePattern: '', testPathPattern: '', - testResultsProcessor: null, + testResultsProcessor: undefined, testSequencer: '@jest/test-sequencer', testTimeout: 5000, updateSnapshot: 'none', @@ -67,7 +67,6 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = { const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { automock: false, - browser: false, cache: false, cacheDirectory: '/test_cache_dir/', clearMocks: false, @@ -78,14 +77,12 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { displayName: undefined, errorOnDeprecated: false, extraGlobals: [], - filter: null, + filter: undefined, forceCoverageMatch: [], - globalSetup: null, - globalTeardown: null, + globalSetup: undefined, + globalTeardown: undefined, globals: {}, - haste: { - providesModuleNodeModules: [], - }, + haste: {}, moduleDirectories: [], moduleFileExtensions: ['js'], moduleLoader: '/test_module_loader_path', @@ -96,7 +93,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { prettierPath: 'prettier', resetMocks: false, resetModules: false, - resolver: null, + resolver: undefined, restoreMocks: false, rootDir: '/test_root_dir/', roots: [], @@ -105,7 +102,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { setupFilesAfterEnv: [], skipFilter: false, skipNodeResolution: false, - snapshotResolver: null, + snapshotResolver: undefined, snapshotSerializers: [], testEnvironment: 'node', testEnvironmentOptions: {}, @@ -118,7 +115,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { timers: 'real', transform: [], transformIgnorePatterns: [], - unmockedModulePathPatterns: null, + unmockedModulePathPatterns: undefined, watchPathIgnorePatterns: [], }; diff --git a/babel.config.js b/babel.config.js index b01524bb0f50..d2ff271d1ea6 100644 --- a/babel.config.js +++ b/babel.config.js @@ -40,7 +40,7 @@ module.exports = { }, ], ], - test: 'packages/jest-config/src/importEsm.ts', + test: 'packages/jest-config/src/readConfigFileAndSetRootDir.ts', }, ], plugins: [ diff --git a/docs/CLI.md b/docs/CLI.md index 8a6d09579b23..b0c989dfba67 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -156,11 +156,7 @@ Alias: `--collectCoverage`. Indicates that test coverage information should be c Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`. -Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel and comes with a few caveats - -1. Your node version must include `vm.compileFunction`, which was introduced in [node 10.10](https://nodejs.org/dist/latest-v12.x/docs/api/vm.html#vm_vm_compilefunction_code_params_options) -1. Tests needs to run in Node test environment (support for `jsdom` requires [`jest-environment-jsdom-sixteen`](https://www.npmjs.com/package/jest-environment-jsdom-sixteen)) -1. V8 has way better data in the later versions, so using the latest versions of node (v13 at the time of this writing) will yield better results +Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results. ### `--debug` @@ -258,6 +254,10 @@ Run tests with specified reporters. [Reporter options](configuration#reporters-a Alias: `-i`. Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging. +### `--selectProjects ... ` + +Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects. + ### `--runTestsByPath` Run only the tests that were specified with their exact paths. diff --git a/docs/Configuration.md b/docs/Configuration.md index c80c9af8b351..2020673b064b 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -18,9 +18,17 @@ Or through JavaScript: ```js // jest.config.js +//Sync object module.exports = { verbose: true, }; + +//Or async function +module.exports = async () => { + return { + verbose: true, + }; +}; ``` Please keep in mind that the resulting configuration must be JSON-serializable. @@ -105,12 +113,6 @@ Default: `0` By default, Jest runs all tests and produces all errors into the console upon completion. The bail config option can be used here to have Jest stop running tests after `n` failures. Setting bail to `true` is the same as setting bail to `1`. -### `browser` [boolean] - -Default: `false` - -Respect Browserify's [`"browser"` field](https://github.com/substack/browserify-handbook#browser-field) in `package.json` when resolving modules. Some modules export different versions based on whether they are operating in Node or a browser. - ### `cacheDirectory` [string] Default: `"/tmp/"` @@ -189,11 +191,7 @@ These pattern strings match against the full path. Use the `` string to Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`. -Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel and comes with a few caveats - -1. Your node version must include `vm.compileFunction`, which was introduced in [node 10.10](https://nodejs.org/dist/latest-v12.x/docs/api/vm.html#vm_vm_compilefunction_code_params_options) -1. Tests needs to run in Node test environment (support for `jsdom` requires [`jest-environment-jsdom-sixteen`](https://www.npmjs.com/package/jest-environment-jsdom-sixteen)) -1. V8 has way better data in the later versions, so using the latest versions of node (v13 at the time of this writing) will yield better results +Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results. ### `coverageReporters` [array\] @@ -689,7 +687,6 @@ This option allows the use of a custom resolver. This resolver must be a node mo ```json { "basedir": string, - "browser": bool, "defaultResolver": "function(request, options)", "extensions": [string], "moduleDirectory": [string], @@ -700,7 +697,18 @@ This option allows the use of a custom resolver. This resolver must be a node mo The function should either return a path to the module that should be resolved or throw an error if the module can't be found. -Note: the defaultResolver passed as options is the jest default resolver which might be useful when you write your custom one. It takes the same arguments as your custom one, e.g. (request, options). +Note: the defaultResolver passed as options is the Jest default resolver which might be useful when you write your custom one. It takes the same arguments as your custom one, e.g. `(request, options)`. + +For example, if you want to respect Browserify's [`"browser"` field](https://github.com/browserify/browserify-handbook/blob/master/readme.markdown#browser-field), you can use the following configuration: + +```json +{ + ... + "jest": { + "resolver": "browser-resolve" + } +} +``` ### `restoreMocks` [boolean] @@ -1085,6 +1093,7 @@ Example: Sort test path alphabetically. ```js +// testSequencer.js const Sequencer = require('@jest/test-sequencer').default; class CustomSequencer extends Sequencer { @@ -1099,6 +1108,14 @@ class CustomSequencer extends Sequencer { module.exports = CustomSequencer; ``` +Use it in your Jest config file like this: + +```json +{ + "testSequencer": "path/to/testSequencer.js" +} +``` + ### `testTimeout` [number] Default: `5000` @@ -1115,11 +1132,13 @@ This option sets the URL for the jsdom environment. It is reflected in propertie Default: `real` -Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. +Setting this value to `legacy` or `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. + +If the value is `modern`, [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers) will be used as implementation instead of Jest's own legacy implementation. This will be the default fake implementation in Jest 27. ### `transform` [object\] -Default: `undefined` +Default: `{"^.+\\.[jt]sx?$": "babel-jest"}` A map from regular expressions to paths to transformers. A transformer is a module that provides a synchronous function for transforming source files. For example, if you wanted to be able to use a new language feature in your modules or tests that isn't yet supported by node, you might plug in one of many compilers that compile a future version of JavaScript to a current one. Example: see the [examples/typescript](https://github.com/facebook/jest/blob/master/examples/typescript/package.json#L16) example or the [webpack tutorial](Webpack.md). @@ -1134,7 +1153,7 @@ You can pass configuration to a transformer like `{filePattern: ['path-to-transf _Note: a transformer is only run once per file unless the file has changed. During development of a transformer it can be useful to run Jest with `--no-cache` to frequently [delete Jest's cache](Troubleshooting.md#caching-issues)._ -_Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ +_Note: when adding additional code transformers, this will overwrite the default config and `babel-jest` is no longer automatically loaded. If you want to use it to compile JavaScript or Typescript, it has to be explicitly defined by adding `{"^.+\\.[jt]sx?$": "babel-jest"}` to the transform property. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ ### `transformIgnorePatterns` [array\] diff --git a/docs/Es6ClassMocks.md b/docs/Es6ClassMocks.md index 06209155e304..e541e5c9b334 100644 --- a/docs/Es6ClassMocks.md +++ b/docs/Es6ClassMocks.md @@ -262,6 +262,22 @@ jest.mock('./sound-player', () => { This will let us inspect usage of our mocked class, using `SoundPlayer.mock.calls`: `expect(SoundPlayer).toHaveBeenCalled();` or near-equivalent: `expect(SoundPlayer.mock.calls.length).toEqual(1);` +### Mocking non default class exports + +If the class is **not** the default export from the module then you need to return an object with the key that is the same as the class export name. + +```javascript +import {SoundPlayer} from './sound-player'; +jest.mock('./sound-player', () => { + // Works and lets you check for constructor calls: + return { + SoundPlayer: jest.fn().mockImplementation(() => { + return {playSoundFile: () => {}}; + }), + }; +}); +``` + ### Spying on methods of our class Our mocked class will need to provide any member functions (`playSoundFile` in the example) that will be called during our tests, or else we'll get an error for calling a function that doesn't exist. But we'll probably want to also spy on calls to those methods, to ensure that they were called with the expected parameters. diff --git a/docs/JestObjectAPI.md b/docs/JestObjectAPI.md index 784c5c3370f1..be28b93e4d21 100644 --- a/docs/JestObjectAPI.md +++ b/docs/JestObjectAPI.md @@ -76,7 +76,7 @@ export default { ``` ```js -// __tests__/disableAutomocking.js +// __tests__/enableAutomocking.js jest.enableAutomock(); import utils from '../utils'; @@ -90,7 +90,11 @@ test('original implementation', () => { _Note: this method was previously called `autoMockOn`. When using `babel-jest`, calls to `enableAutomock` will automatically be hoisted to the top of the code block. Use `autoMockOn` if you want to explicitly avoid this behavior._ -### `jest.genMockFromModule(moduleName)` +### `jest.createMockFromModule(moduleName)` + +##### renamed in Jest **26.0.0+** + +Also under the alias: `.genMockFromModule(moduleName)` Given the name of a module, use the automatic mocking system to generate a mocked version of the module for you. @@ -109,17 +113,17 @@ export default { ``` ```js -// __tests__/genMockFromModule.test.js -const utils = jest.genMockFromModule('../utils').default; +// __tests__/createMockFromModule.test.js +const utils = jest.createMockFromModule('../utils').default; utils.isAuthorized = jest.fn(secret => secret === 'not wizard'); -test('implementation created by jest.genMockFromModule', () => { +test('implementation created by jest.createMockFromModule', () => { expect(utils.authorize.mock).toBeTruthy(); expect(utils.isAuthorized('not wizard')).toEqual(true); }); ``` -This is how `genMockFromModule` will mock the following data types: +This is how `createMockFromModule` will mock the following data types: #### `Function` @@ -176,7 +180,7 @@ module.exports = { ```js // __tests__/example.test.js -const example = jest.genMockFromModule('./example'); +const example = jest.createMockFromModule('./example'); test('should run example code', () => { // creates a new mocked function with no formal arguments. @@ -577,10 +581,12 @@ Restores all mocks back to their original value. Equivalent to calling [`.mockRe ## Mock timers -### `jest.useFakeTimers()` +### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')` Instructs Jest to use fake versions of the standard timer functions (`setTimeout`, `setInterval`, `clearTimeout`, `clearInterval`, `nextTick`, `setImmediate` and `clearImmediate`). +If you pass `'modern'` as argument, [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers) will be used as implementation instead of Jest's own fake timers. This also mocks additional timers like `Date`. `'modern'` will be the default behavior in Jest 27. + Returns the `jest` object for chaining. ### `jest.useRealTimers()` @@ -607,6 +613,8 @@ This is often useful for synchronously executing setTimeouts during a test in or Exhausts all tasks queued by `setImmediate()`. +> Note: This function is not available when using modern fake timers implementation + ### `jest.advanceTimersByTime(msToRun)` ##### renamed in Jest **22.0.0+** @@ -639,6 +647,18 @@ This means, if any timers have been scheduled (but have not yet executed), they Returns the number of fake timers still left to run. +### `.jest.setSystemTime()` + +Set the current system time used by fake timers. Simulates a user changing the system clock while your program is running. It affects the current time but it does not in itself cause e.g. timers to fire; they will fire exactly as they would have done without the call to `jest.setSystemTime()`. + +> Note: This function is only available when using modern fake timers implementation + +### `.jest.getRealSystemTime()` + +When mocking time, `Date.now()` will also be mocked. If you for some reason need access to the real current time, you can invoke this function. + +> Note: This function is only available when using modern fake timers implementation + ## Misc ### `jest.setTimeout(timeout)` diff --git a/docs/JestPlatform.md b/docs/JestPlatform.md index 47b7140a732e..648acb758943 100644 --- a/docs/JestPlatform.md +++ b/docs/JestPlatform.md @@ -32,7 +32,7 @@ Tool for visualizing changes in data. Exports a function that compares two value ### Example ```javascript -const diff = require('jest-diff'); +const diff = require('jest-diff').default; const a = {a: {b: {c: 5}}}; const b = {a: {b: {c: 6}}}; @@ -58,7 +58,7 @@ const code = ` * * @flow */ - + console.log('Hello World!'); `; diff --git a/docs/ManualMocks.md b/docs/ManualMocks.md index e2ae28acf3ea..a64816d71664 100644 --- a/docs/ManualMocks.md +++ b/docs/ManualMocks.md @@ -64,7 +64,7 @@ Since we'd like our tests to avoid actually hitting the disk (that's pretty slow const path = require('path'); -const fs = jest.genMockFromModule('fs'); +const fs = jest.createMockFromModule('fs'); // This is a custom function that our tests can use during setup to specify // what the files on the "mock" filesystem should look like when any of the @@ -124,7 +124,7 @@ describe('listFilesInDirectorySync', () => { }); ``` -The example mock shown here uses [`jest.genMockFromModule`](JestObjectAPI.md#jestgenmockfrommodulemodulename) to generate an automatic mock, and overrides its default behavior. This is the recommended approach, but is completely optional. If you do not want to use the automatic mock at all, you can export your own functions from the mock file. One downside to fully manual mocks is that they're manual – meaning you have to manually update them any time the module they are mocking changes. Because of this, it's best to use or extend the automatic mock when it works for your needs. +The example mock shown here uses [`jest.createMockFromModule`](JestObjectAPI.md#jestcreatemockfrommodulemodulename) to generate an automatic mock, and overrides its default behavior. This is the recommended approach, but is completely optional. If you do not want to use the automatic mock at all, you can export your own functions from the mock file. One downside to fully manual mocks is that they're manual – meaning you have to manually update them any time the module they are mocking changes. Because of this, it's best to use or extend the automatic mock when it works for your needs. To ensure that a manual mock and its real implementation stay in sync, it might be useful to require the real module using [`jest.requireActual(moduleName)`](JestObjectAPI.md#jestrequireactualmodulename) in your manual mock and amending it with mock functions before exporting it. diff --git a/docs/TestingFrameworks.md b/docs/TestingFrameworks.md index 95a4dc0f0926..28c96f7127dd 100644 --- a/docs/TestingFrameworks.md +++ b/docs/TestingFrameworks.md @@ -3,7 +3,11 @@ id: testing-frameworks title: Testing Web Frameworks --- -Although Jest may be considered a React-specific test runner, in fact it is a universal testing platform, with the ability to adapt to any JavaScript library or framework. In this section we'd like to link to community posts and articles about integrating Jest into other popular JS libraries. +Jest is a universal testing platform, with the ability to adapt to any JavaScript library or framework. In this section we'd like to link to community posts and articles about integrating Jest into popular JS libraries. + +## React + +- [Testing ReactJS components with Jest](https://testing-library.com/docs/react-testing-library/example-intro) by Kent C. Dodds ([@kentcdodds](https://twitter.com/kentcdodds)) ## Vue.js diff --git a/e2e/Utils.ts b/e2e/Utils.ts index f377c53e5916..ef725bd99eb6 100644 --- a/e2e/Utils.ts +++ b/e2e/Utils.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; // eslint-disable-next-line import/named @@ -142,7 +142,7 @@ export const copyDir = (src: string, dest: string) => { export const replaceTime = (str: string) => str - .replace(/\d*\.?\d+m?s/g, '<>') + .replace(/\d*\.?\d+ m?s\b/g, '<>') .replace(/, estimated <>/g, ''); // Since Jest does not guarantee the order of tests we'll sort the output. @@ -194,7 +194,7 @@ export const extractSummary = (stdout: string) => { const rest = stdout .replace(match[0], '') // remove all timestamps - .replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''); + .replace(/\s*\(\d*\.?\d+ m?s\b\)$/gm, ''); return { rest: rest.trim(), diff --git a/e2e/__tests__/__snapshots__/asyncAndCallback.test.ts.snap b/e2e/__tests__/__snapshots__/asyncAndCallback.test.ts.snap new file mode 100644 index 000000000000..66a2dc6288c4 --- /dev/null +++ b/e2e/__tests__/__snapshots__/asyncAndCallback.test.ts.snap @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`errors when a test both returns a promise and takes a callback 1`] = ` +FAIL __tests__/promise-and-callback.test.js + ✕ promise-returning test with callback + ✕ async test with callback + ✕ test done before return value + + ● promise-returning test with callback + + Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise. + Returned value: Promise {} + + 8 | 'use strict'; + 9 | + > 10 | it('promise-returning test with callback', done => { + | ^ + 11 | done(); + 12 | + 13 | return Promise.resolve(); + + at Object.it (__tests__/promise-and-callback.test.js:10:1) + + ● async test with callback + + Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise. + Returned value: Promise {} + + 14 | }); + 15 | + > 16 | it('async test with callback', async done => { + | ^ + 17 | done(); + 18 | }); + 19 | + + at Object.it (__tests__/promise-and-callback.test.js:16:1) + + ● test done before return value + + Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise. + Returned value: "foobar" + + 18 | }); + 19 | + > 20 | it('test done before return value', done => { + | ^ + 21 | done(); + 22 | + 23 | return 'foobar'; + + at Object.it (__tests__/promise-and-callback.test.js:20:1) +`; diff --git a/e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap b/e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap new file mode 100644 index 000000000000..bbaca7ca6978 --- /dev/null +++ b/e2e/__tests__/__snapshots__/circusDeclarationErrors.test.ts.snap @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`defining tests and hooks asynchronously throws 1`] = ` +FAIL __tests__/asyncDefinition.test.js + + + ● Test suite failed to run + + Cannot add a test after tests have started running. Tests must be defined synchronously. + + 10 | + 11 | Promise.resolve().then(() => { + > 12 | test('async definition inside describe', () => {}); + | ^ + 13 | afterAll(() => {}); + 14 | }); + 15 | }); + + at eventHandler (../../packages/jest-circus/build/eventHandler.js:143:11) + at test (__tests__/asyncDefinition.test.js:12:5) + + ● Test suite failed to run + + Cannot add a hook after tests have started running. Hooks must be defined synchronously. + + 11 | Promise.resolve().then(() => { + 12 | test('async definition inside describe', () => {}); + > 13 | afterAll(() => {}); + | ^ + 14 | }); + 15 | }); + 16 | + + at eventHandler (../../packages/jest-circus/build/eventHandler.js:112:11) + at afterAll (__tests__/asyncDefinition.test.js:13:5) + + ● Test suite failed to run + + Cannot add a test after tests have started running. Tests must be defined synchronously. + + 16 | + 17 | Promise.resolve().then(() => { + > 18 | test('async definition outside describe', () => {}); + | ^ + 19 | afterAll(() => {}); + 20 | }); + 21 | + + at eventHandler (../../packages/jest-circus/build/eventHandler.js:143:11) + at test (__tests__/asyncDefinition.test.js:18:3) + + ● Test suite failed to run + + Cannot add a hook after tests have started running. Hooks must be defined synchronously. + + 17 | Promise.resolve().then(() => { + 18 | test('async definition outside describe', () => {}); + > 19 | afterAll(() => {}); + | ^ + 20 | }); + 21 | + + at eventHandler (../../packages/jest-circus/build/eventHandler.js:112:11) + at afterAll (__tests__/asyncDefinition.test.js:19:3) +`; diff --git a/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap b/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap index 571dd419e639..f4728989cc42 100644 --- a/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap +++ b/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap @@ -20,6 +20,6 @@ exports[`prints console.logs when run with forceExit 3`] = ` console.log Hey - at Object. (__tests__/a-banana.js:1:1) + at Object.log (__tests__/a-banana.js:1:30) `; diff --git a/e2e/__tests__/__snapshots__/globals.test.ts.snap b/e2e/__tests__/__snapshots__/globals.test.ts.snap index cb6eb9d23f87..a3262e166ca1 100644 --- a/e2e/__tests__/__snapshots__/globals.test.ts.snap +++ b/e2e/__tests__/__snapshots__/globals.test.ts.snap @@ -18,6 +18,18 @@ Ran all test suites. `; exports[`cannot have describe with no implementation 1`] = ` +FAIL __tests__/onlyConstructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + > 1 | describe('describe, no implementation'); + | ^ + + at Object.describe (__tests__/onlyConstructs.test.js:1:1) +`; + +exports[`cannot have describe with no implementation 2`] = ` Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total @@ -83,6 +95,22 @@ Time: <> Ran all test suites. `; +exports[`interleaved describe and test children order 1`] = ` +PASS __tests__/interleaved.test.js + ✓ above + ✓ below + describe + ✓ inside +`; + +exports[`interleaved describe and test children order 2`] = ` +Test Suites: 1 passed, 1 total +Tests: 3 passed, 3 total +Snapshots: 0 total +Time: <> +Ran all test suites. +`; + exports[`only 1`] = ` PASS __tests__/onlyConstructs.test.js ✓ test.only diff --git a/e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap b/e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap index ed248a26f289..88a80f3a3e76 100644 --- a/e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap +++ b/e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap @@ -5,6 +5,11 @@ PASS __tests__/index.js ✓ moduleNameMapping correct configuration `; +exports[`moduleNameMapper correct configuration mocking module of absolute path 1`] = ` +PASS __tests__/index.js + ✓ moduleNameMapping correct configuration +`; + exports[`moduleNameMapper wrong array configuration 1`] = ` FAIL __tests__/index.js ● Test suite failed to run @@ -36,7 +41,7 @@ FAIL __tests__/index.js 12 | module.exports = () => 'test'; 13 | - at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:545:17) + at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:553:17) at Object.require (index.js:10:1) `; @@ -65,6 +70,6 @@ FAIL __tests__/index.js 12 | module.exports = () => 'test'; 13 | - at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:545:17) + at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:553:17) at Object.require (index.js:10:1) `; diff --git a/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap b/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap index c16d98c7fafb..953aa9a25bfa 100644 --- a/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap +++ b/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap @@ -2,7 +2,7 @@ exports[`on node ^12.16.0 || >=13.2.0 runs test with native ESM 1`] = ` Test Suites: 1 passed, 1 total -Tests: 11 passed, 11 total +Tests: 12 passed, 12 total Snapshots: 0 total Time: <> Ran all test suites. diff --git a/e2e/__tests__/__snapshots__/resolveNoFileExtensions.test.ts.snap b/e2e/__tests__/__snapshots__/resolveNoFileExtensions.test.ts.snap index 062640b2406a..5b14d65aaa83 100644 --- a/e2e/__tests__/__snapshots__/resolveNoFileExtensions.test.ts.snap +++ b/e2e/__tests__/__snapshots__/resolveNoFileExtensions.test.ts.snap @@ -37,6 +37,6 @@ FAIL __tests__/test.js | ^ 9 | - at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:299:11) + at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:308:11) at Object.require (index.js:8:18) `; diff --git a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap index 7f3d73efee7c..9c644c2b47e6 100644 --- a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap +++ b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap @@ -5,7 +5,6 @@ exports[`--showConfig outputs config info and exits 1`] = ` "configs": [ { "automock": false, - "browser": false, "cache": false, "cacheDirectory": "/tmp/jest", "clearMocks": false, @@ -21,7 +20,6 @@ exports[`--showConfig outputs config info and exits 1`] = ` "globals": {}, "haste": { "computeSha1": false, - "providesModuleNodeModules": [], "throwOnModuleCollision": false }, "moduleDirectories": [ diff --git a/e2e/__tests__/__snapshots__/transform.test.ts.snap b/e2e/__tests__/__snapshots__/transform.test.ts.snap index 5ccf71e5a934..ee94c751c5ab 100644 --- a/e2e/__tests__/__snapshots__/transform.test.ts.snap +++ b/e2e/__tests__/__snapshots__/transform.test.ts.snap @@ -6,7 +6,7 @@ FAIL __tests__/ignoredFile.test.js babel-jest: Babel ignores __tests__/ignoredFile.test.js - make sure to include the file in Jest's transformIgnorePatterns as well. - at loadBabelConfig (../../../packages/babel-jest/build/index.js:178:13) + at loadBabelConfig (../../../packages/babel-jest/build/index.js:180:13) `; exports[`babel-jest instruments only specific files and collects coverage 1`] = ` diff --git a/e2e/__tests__/asyncAndCallback.test.ts b/e2e/__tests__/asyncAndCallback.test.ts new file mode 100644 index 000000000000..81112af6ed72 --- /dev/null +++ b/e2e/__tests__/asyncAndCallback.test.ts @@ -0,0 +1,21 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {skipSuiteOnJasmine} from '@jest/test-utils'; +import wrap from 'jest-snapshot-serializer-raw'; +import runJest from '../runJest'; +import {extractSummary} from '../Utils'; + +skipSuiteOnJasmine(); + +test('errors when a test both returns a promise and takes a callback', () => { + const result = runJest('promise-and-callback'); + + const {rest} = extractSummary(result.stderr); + expect(wrap(rest)).toMatchSnapshot(); + expect(result.exitCode).toBe(1); +}); diff --git a/e2e/__tests__/babelPluginJestHoist.test.ts b/e2e/__tests__/babelPluginJestHoist.test.ts index 2f7cbd6aafdc..04a2f3e2c9e2 100644 --- a/e2e/__tests__/babelPluginJestHoist.test.ts +++ b/e2e/__tests__/babelPluginJestHoist.test.ts @@ -15,8 +15,8 @@ beforeEach(() => { run('yarn', DIR); }); -it('sucessfully runs the tests inside `babel-plugin-jest-hoist/`', () => { +it('successfully runs the tests inside `babel-plugin-jest-hoist/`', () => { const {json} = runWithJson(DIR, ['--no-cache', '--coverage']); expect(json.success).toBe(true); - expect(json.numTotalTestSuites).toBe(3); + expect(json.numTotalTestSuites).toBe(4); }); diff --git a/e2e/__tests__/beforeEachQueue.ts b/e2e/__tests__/beforeEachQueue.ts index a7d6738b39d5..23f84ad72e4a 100644 --- a/e2e/__tests__/beforeEachQueue.ts +++ b/e2e/__tests__/beforeEachQueue.ts @@ -5,9 +5,12 @@ * LICENSE file in the root directory of this source tree. */ +import {skipSuiteOnJestCircus} from '@jest/test-utils'; import {wrap} from 'jest-snapshot-serializer-raw'; import runJest from '../runJest'; +skipSuiteOnJestCircus(); // Circus does not support funky async definitions + describe('Correct beforeEach order', () => { it('ensures the correct order for beforeEach', () => { const result = runJest('before-each-queue'); diff --git a/e2e/__tests__/circusDeclarationErrors.test.ts b/e2e/__tests__/circusDeclarationErrors.test.ts new file mode 100644 index 000000000000..9de4ff365930 --- /dev/null +++ b/e2e/__tests__/circusDeclarationErrors.test.ts @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {skipSuiteOnJasmine} from '@jest/test-utils'; +import {wrap} from 'jest-snapshot-serializer-raw'; +import {extractSummary} from '../Utils'; +import runJest from '../runJest'; + +skipSuiteOnJasmine(); + +it('defining tests and hooks asynchronously throws', () => { + const result = runJest('circus-declaration-errors', [ + 'asyncDefinition.test.js', + ]); + + expect(result.exitCode).toBe(1); + + const {rest} = extractSummary(result.stderr); + expect(wrap(rest)).toMatchSnapshot(); +}); diff --git a/e2e/__tests__/clearCache.test.ts b/e2e/__tests__/clearCache.test.ts index 859800c939d4..3f7897c0b9a4 100644 --- a/e2e/__tests__/clearCache.test.ts +++ b/e2e/__tests__/clearCache.test.ts @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import {tmpdir} from 'os'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import runJest from '../runJest'; const CACHE = path.resolve(tmpdir(), 'clear-cache-directory'); diff --git a/e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts b/e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts index 3e505c906365..618c48048ef6 100644 --- a/e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts +++ b/e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts @@ -15,8 +15,6 @@ const DIR = path.resolve(__dirname, '../console-log-output-when-run-in-band'); beforeEach(() => cleanup(DIR)); afterAll(() => cleanup(DIR)); -const nodeMajorVersion = Number(process.versions.node.split('.')[0]); - test('prints console.logs when run with forceExit', () => { writeFiles(DIR, { '__tests__/a-banana.js': ` @@ -25,26 +23,14 @@ test('prints console.logs when run with forceExit', () => { 'package.json': '{}', }); - const {stderr, exitCode, ...res} = runJest(DIR, [ + const {stderr, stdout, exitCode} = runJest(DIR, [ '-i', '--ci=false', '--forceExit', ]); - let {stdout} = res; const {rest, summary} = extractSummary(stderr); - if (nodeMajorVersion < 12) { - expect(stdout).toContain( - 'at Object..test (__tests__/a-banana.js:1:1)', - ); - - stdout = stdout.replace( - 'at Object..test (__tests__/a-banana.js:1:1)', - 'at Object. (__tests__/a-banana.js:1:1)', - ); - } - expect(exitCode).toBe(0); expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); diff --git a/e2e/__tests__/coverageHandlebars.test.ts b/e2e/__tests__/coverageHandlebars.test.ts index 28337a9e5b9f..3e16071fceb5 100644 --- a/e2e/__tests__/coverageHandlebars.test.ts +++ b/e2e/__tests__/coverageHandlebars.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import {readFileSync} from 'fs'; import * as path from 'path'; +import {readFileSync} from 'graceful-fs'; import wrap from 'jest-snapshot-serializer-raw'; import {cleanup, run} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/coverageRemapping.test.ts b/e2e/__tests__/coverageRemapping.test.ts index 07172e613b77..9883f2053778 100644 --- a/e2e/__tests__/coverageRemapping.test.ts +++ b/e2e/__tests__/coverageRemapping.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import {readFileSync} from 'fs'; import * as path from 'path'; +import {readFileSync} from 'graceful-fs'; import {cleanup, run} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/coverageReport.test.ts b/e2e/__tests__/coverageReport.test.ts index 13765ec0dade..d59e16cb82f2 100644 --- a/e2e/__tests__/coverageReport.test.ts +++ b/e2e/__tests__/coverageReport.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {wrap} from 'jest-snapshot-serializer-raw'; import {extractSummary, run} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/coverageTransformInstrumented.test.ts b/e2e/__tests__/coverageTransformInstrumented.test.ts index c16b07fab5ce..7e0ff66eafb2 100644 --- a/e2e/__tests__/coverageTransformInstrumented.test.ts +++ b/e2e/__tests__/coverageTransformInstrumented.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import {readFileSync} from 'fs'; import * as path from 'path'; +import {readFileSync} from 'graceful-fs'; import {cleanup, run} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/filter.test.ts b/e2e/__tests__/filter.test.ts index 4b1edce2cd01..356e0f9c3b0a 100644 --- a/e2e/__tests__/filter.test.ts +++ b/e2e/__tests__/filter.test.ts @@ -24,7 +24,7 @@ describe('Dynamic test filtering', () => { expect(result.stderr).toContain('1 total'); }); - it('ingores the filter if requested to do so', () => { + it('ignores the filter if requested to do so', () => { const result = runJest('filter', [ '--filter=/my-secondary-filter.js', '--skipFilter', diff --git a/e2e/__tests__/globalSetup.test.ts b/e2e/__tests__/globalSetup.test.ts index 8e9a582f2ea7..106c89a17d23 100644 --- a/e2e/__tests__/globalSetup.test.ts +++ b/e2e/__tests__/globalSetup.test.ts @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import {tmpdir} from 'os'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import runJest, {json as runWithJson} from '../runJest'; import {cleanup, run} from '../Utils'; diff --git a/e2e/__tests__/globalTeardown.test.ts b/e2e/__tests__/globalTeardown.test.ts index b05d94cfabcd..7964048bbc70 100644 --- a/e2e/__tests__/globalTeardown.test.ts +++ b/e2e/__tests__/globalTeardown.test.ts @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import {tmpdir} from 'os'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {createDirectory} from 'jest-util'; import runJest, {json as runWithJson} from '../runJest'; import {cleanup, run} from '../Utils'; diff --git a/e2e/__tests__/globals.test.ts b/e2e/__tests__/globals.test.ts index 7429f600c71f..1007da3160ec 100644 --- a/e2e/__tests__/globals.test.ts +++ b/e2e/__tests__/globals.test.ts @@ -7,7 +7,6 @@ import * as path from 'path'; import {tmpdir} from 'os'; -import {compileFunction} from 'vm'; import {wrap} from 'jest-snapshot-serializer-raw'; import runJest from '../runJest'; import { @@ -46,11 +45,49 @@ test('basic test constructs', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR); + + const {summary, rest} = extractSummary(stderr); + expect(wrap(rest)).toMatchSnapshot(); + expect(wrap(summary)).toMatchSnapshot(); expect(exitCode).toBe(0); +}); + +test('interleaved describe and test children order', () => { + const filename = 'interleaved.test.js'; + const content = ` + let lastTest; + test('above', () => { + try { + expect(lastTest).toBe(undefined); + } finally { + lastTest = 'above'; + } + }); + describe('describe', () => { + test('inside', () => { + try { + expect(lastTest).toBe('above'); + } finally { + lastTest = 'inside'; + } + }); + }); + test('below', () => { + try { + expect(lastTest).toBe('inside'); + } finally { + lastTest = 'below'; + } + }); + `; + + writeFiles(TEST_DIR, {[filename]: content}); + const {stderr, exitCode} = runJest(DIR); const {summary, rest} = extractSummary(stderr); expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(0); }); test('skips', () => { @@ -107,11 +144,11 @@ test('only', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR); - expect(exitCode).toBe(0); const {summary, rest} = extractSummary(stderr); expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(0); }); test('cannot have describe with no implementation', () => { @@ -122,47 +159,13 @@ test('cannot have describe with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR); - expect(exitCode).toBe(1); const rest = cleanStderr(stderr); const {summary} = extractSummary(stderr); - const rightTrimmedRest = rest - .split('\n') - .map(l => l.trimRight()) - .join('\n') - .trim(); - - if (typeof compileFunction === 'function') { - expect(rightTrimmedRest).toEqual( - ` -FAIL __tests__/onlyConstructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - > 1 | describe('describe, no implementation'); - | ^ - - at Object.describe (__tests__/onlyConstructs.test.js:1:1) - `.trim(), - ); - } else { - expect(rightTrimmedRest).toEqual( - ` -FAIL __tests__/onlyConstructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - > 1 | describe('describe, no implementation'); - | ^ - - at Object. (__tests__/onlyConstructs.test.js:1:10) - `.trim(), - ); - } + expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(1); }); test('cannot test with no implementation', () => { @@ -175,11 +178,11 @@ test('cannot test with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR); - expect(exitCode).toBe(1); const {summary} = extractSummary(stderr); expect(wrap(cleanStderr(stderr))).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(1); }); test('skips with expand arg', () => { @@ -206,11 +209,11 @@ test('skips with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR, ['--expand']); - expect(exitCode).toBe(0); const {summary, rest} = extractSummary(stderr); expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(0); }); test('only with expand arg', () => { @@ -236,11 +239,11 @@ test('only with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR, ['--expand']); - expect(exitCode).toBe(0); const {summary, rest} = extractSummary(stderr); expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(0); }); test('cannot test with no implementation with expand arg', () => { @@ -253,11 +256,11 @@ test('cannot test with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR, ['--expand']); - expect(exitCode).toBe(1); const {summary} = extractSummary(stderr); expect(wrap(cleanStderr(stderr))).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(1); }); test('function as descriptor', () => { @@ -271,9 +274,9 @@ test('function as descriptor', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, exitCode} = runJest(DIR); - expect(exitCode).toBe(0); const {summary, rest} = extractSummary(stderr); expect(wrap(rest)).toMatchSnapshot(); expect(wrap(summary)).toMatchSnapshot(); + expect(exitCode).toBe(0); }); diff --git a/e2e/__tests__/hasteMapSize.test.ts b/e2e/__tests__/hasteMapSize.test.ts index 610ef1af3227..228eb83f1e7d 100644 --- a/e2e/__tests__/hasteMapSize.test.ts +++ b/e2e/__tests__/hasteMapSize.test.ts @@ -7,11 +7,11 @@ import {tmpdir} from 'os'; import * as path from 'path'; +import {realpathSync} from 'graceful-fs'; import HasteMap = require('jest-haste-map'); -import {sync as realpath} from 'realpath-native'; import {cleanup, writeFiles} from '../Utils'; -const DIR = path.resolve(realpath(tmpdir()), 'haste_map_size'); +const DIR = path.resolve(realpathSync.native(tmpdir()), 'haste_map_size'); beforeEach(() => { cleanup(DIR); diff --git a/e2e/__tests__/jestEnvironmentJsdom.test.ts b/e2e/__tests__/jestEnvironmentJsdom.test.ts new file mode 100644 index 000000000000..e13abfcec114 --- /dev/null +++ b/e2e/__tests__/jestEnvironmentJsdom.test.ts @@ -0,0 +1,28 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import * as path from 'path'; +import {tmpdir} from 'os'; +import {cleanup, writeFiles} from '../Utils'; +import runJest from '../runJest'; + +const DIR = path.resolve(tmpdir(), 'jest_environment_jsdom_test'); + +beforeEach(() => cleanup(DIR)); +afterAll(() => cleanup(DIR)); + +test('check is not leaking memory', () => { + writeFiles(DIR, { + '__tests__/a.test.js': `test('a', () => console.log('a'));`, + '__tests__/b.test.js': `test('b', () => console.log('b'));`, + 'package.json': JSON.stringify({jest: {testEnvironment: 'jsdom'}}), + }); + + const {stderr} = runJest(DIR, ['--detect-leaks', '--runInBand']); + expect(stderr).toMatch(/PASS\s__tests__\/a.test.js/); + expect(stderr).toMatch(/PASS\s__tests__\/b.test.js/); +}); diff --git a/e2e/__tests__/jsonReporter.test.ts b/e2e/__tests__/jsonReporter.test.ts index 92fb4d6cd97c..c695c0ef6882 100644 --- a/e2e/__tests__/jsonReporter.test.ts +++ b/e2e/__tests__/jsonReporter.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import type {FormattedTestResults} from '@jest/test-result'; import runJest from '../runJest'; diff --git a/e2e/__tests__/modernFakeTimers.test.ts b/e2e/__tests__/modernFakeTimers.test.ts new file mode 100644 index 000000000000..e004b3b19192 --- /dev/null +++ b/e2e/__tests__/modernFakeTimers.test.ts @@ -0,0 +1,20 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import runJest from '../runJest'; + +describe('modern implementation of fake timers', () => { + it('should be possible to use modern implementation from config', () => { + const result = runJest('modern-fake-timers/from-config'); + expect(result.exitCode).toBe(0); + }); + + it('should be possible to use modern implementation from jest-object', () => { + const result = runJest('modern-fake-timers/from-jest-object'); + expect(result.exitCode).toBe(0); + }); +}); diff --git a/e2e/__tests__/moduleNameMapper.test.ts b/e2e/__tests__/moduleNameMapper.test.ts index c3faccac226e..9b0eb82075a9 100644 --- a/e2e/__tests__/moduleNameMapper.test.ts +++ b/e2e/__tests__/moduleNameMapper.test.ts @@ -35,6 +35,20 @@ test('moduleNameMapper correct configuration', () => { expect(wrap(rest)).toMatchSnapshot(); }); +test('moduleNameMapper correct configuration mocking module of absolute path', () => { + const {stderr, exitCode} = runJest( + 'module-name-mapper-correct-mock-absolute-path', + [], + { + stripAnsi: true, + }, + ); + const {rest} = extractSummary(stderr); + + expect(exitCode).toBe(0); + expect(wrap(rest)).toMatchSnapshot(); +}); + test('moduleNameMapper with mocking', () => { const {json} = runWithJson('module-name-mapper-mock'); expect(json.numTotalTests).toBe(2); diff --git a/e2e/__tests__/nestedTestDefinitions.test.ts b/e2e/__tests__/nestedTestDefinitions.test.ts index 0a26d4fc14c5..ab000c325e19 100644 --- a/e2e/__tests__/nestedTestDefinitions.test.ts +++ b/e2e/__tests__/nestedTestDefinitions.test.ts @@ -42,16 +42,28 @@ test('print correct error message with nested test definitions inside describe', expect(cleanupRunnerStack(summary.rest)).toMatchSnapshot(); }); -test('print correct message when nesting describe inside it', () => { - if (!isJestCircusRun()) { - return; - } +(isJestCircusRun() ? test : test.skip)( + 'print correct message when nesting describe inside it', + () => { + const result = runJest('nested-test-definitions', ['nestedDescribeInTest']); - const result = runJest('nested-test-definitions', ['nestedDescribeInTest']); + expect(result.exitCode).toBe(1); - expect(result.exitCode).toBe(1); + expect(result.stderr).toContain( + 'Cannot nest a describe inside a test. Describe block "inner describe" cannot run because it is nested within "test".', + ); + }, +); - expect(result.stderr).toContain( - 'Cannot nest a describe inside a test. Describe block "inner describe" cannot run because it is nested within "test".', - ); -}); +(isJestCircusRun() ? test : test.skip)( + 'print correct message when nesting a hook inside it', + () => { + const result = runJest('nested-test-definitions', ['nestedHookInTest']); + + expect(result.exitCode).toBe(1); + + expect(result.stderr).toContain( + 'Hooks cannot be defined inside tests. Hook of type "beforeEach" is nested within "test".', + ); + }, +); diff --git a/e2e/__tests__/overrideGlobals.test.ts b/e2e/__tests__/overrideGlobals.test.ts index 56dca22dd05d..20437f29e342 100644 --- a/e2e/__tests__/overrideGlobals.test.ts +++ b/e2e/__tests__/overrideGlobals.test.ts @@ -13,7 +13,7 @@ test('overriding native promise does not freeze Jest', () => { }); test('has a duration even if time is faked', () => { - const regex = /works well \((\d+)ms\)/; + const regex = /works well \((\d+) ms\)/; const {stderr} = runJest('override-globals', ['--verbose']); expect(stderr).toMatch(regex); diff --git a/e2e/__tests__/pnp.test.ts b/e2e/__tests__/pnp.test.ts index fd60348a3820..b5cbcc139210 100644 --- a/e2e/__tests__/pnp.test.ts +++ b/e2e/__tests__/pnp.test.ts @@ -19,7 +19,7 @@ beforeEach(() => { run('yarn', DIR); }); -it('sucessfully runs the tests inside `pnp/`', () => { +it('successfully runs the tests inside `pnp/`', () => { const {json} = runWithJson(DIR, ['--no-cache', '--coverage'], { nodeOptions: `--require ${DIR}/.pnp.js`, }); diff --git a/e2e/__tests__/resolveBrowserField.test.ts b/e2e/__tests__/resolveBrowserField.test.ts deleted file mode 100644 index 2c37924e2bc5..000000000000 --- a/e2e/__tests__/resolveBrowserField.test.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import {tmpdir} from 'os'; -import * as path from 'path'; -import {wrap} from 'jest-snapshot-serializer-raw'; -import {cleanup, writeFiles, writeSymlinks} from '../Utils'; -import runJest from '../runJest'; - -const DIR = path.resolve(tmpdir(), 'resolve-browser-field-test'); - -beforeEach(() => cleanup(DIR)); -afterAll(() => cleanup(DIR)); - -test('preserves module identity for symlinks when using browser field resolution', () => { - /* eslint-disable sort-keys */ - writeFiles(DIR, { - 'packages/needs-preserved-id/index.js': ` - console.log("needs-preserved-id executed"); - module.exports = {}; - `, - 'packages/needs-preserved-id/package.json': JSON.stringify({ - name: 'needs-preserved-id', - }), - 'packages/has-browser-field/package.json': JSON.stringify({ - name: 'has-browser-field', - browser: 'browser.js', - }), - 'packages/has-browser-field/browser.js': ` - module.exports = require("needs-preserved-id"); - `, - 'package.json': JSON.stringify({ - jest: { - testMatch: ['/test-files/test.js'], - browser: true, - }, - }), - 'test-files/test.js': ` - const id1 = require("needs-preserved-id"); - const id2 = require("has-browser-field"); - - test("module should have reference equality", () => { - expect(id1).toBe(id2); - }); - `, - }); - /* eslint-enable */ - - writeSymlinks(DIR, { - 'packages/has-browser-field': 'node_modules/has-browser-field', - 'packages/needs-preserved-id': 'node_modules/needs-preserved-id', - }); - - writeSymlinks(DIR, { - 'packages/needs-preserved-id': - 'packages/has-browser-field/node_modules/needs-preserved-id', - }); - - const {stdout, stderr, exitCode} = runJest(DIR, ['--no-watchman']); - expect(stderr).toContain('Test Suites: 1 passed, 1 total'); - expect(wrap(stdout.trim())).toMatchInlineSnapshot(` - console.log - needs-preserved-id executed - - at Object. (packages/needs-preserved-id/index.js:1:13) - `); - expect(exitCode).toEqual(0); -}); diff --git a/e2e/__tests__/selectProjects.test.ts b/e2e/__tests__/selectProjects.test.ts new file mode 100644 index 000000000000..472221575cc7 --- /dev/null +++ b/e2e/__tests__/selectProjects.test.ts @@ -0,0 +1,189 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {resolve} from 'path'; + +import run, { + RunJestJsonResult, + RunJestResult, + json as runWithJson, +} from '../runJest'; + +describe('Given a config with two named projects, first-project and second-project', () => { + const dir = resolve(__dirname, '..', 'select-projects'); + + describe('when Jest is started with `--selectProjects first-project`', () => { + let result: RunJestJsonResult; + beforeAll(() => { + result = runWithJson('select-projects', [ + '--selectProjects', + 'first-project', + ]); + }); + it('runs the tests in the first project only', () => { + expect(result.json).toHaveProperty('success', true); + expect(result.json).toHaveProperty('numTotalTests', 1); + expect(result.json.testResults.map(({name}) => name)).toEqual([ + resolve(dir, '__tests__/first-project.test.js'), + ]); + }); + it('prints that only first-project will run', () => { + expect(result.stderr).toMatch(/^Running one project: first-project/); + }); + }); + + describe('when Jest is started with `--selectProjects second-project`', () => { + let result: RunJestJsonResult; + beforeAll(() => { + result = runWithJson('select-projects', [ + '--selectProjects', + 'second-project', + ]); + }); + it('runs the tests in the second project only', () => { + expect(result.json).toHaveProperty('success', true); + expect(result.json).toHaveProperty('numTotalTests', 1); + expect(result.json.testResults.map(({name}) => name)).toEqual([ + resolve(dir, '__tests__/second-project.test.js'), + ]); + }); + it('prints that only second-project will run', () => { + expect(result.stderr).toMatch(/^Running one project: second-project/); + }); + }); + + describe('when Jest is started with `--selectProjects first-project second-project`', () => { + let result: RunJestJsonResult; + beforeAll(() => { + result = runWithJson('select-projects', [ + '--selectProjects', + 'first-project', + 'second-project', + ]); + }); + it('runs the tests in the first and second projects', () => { + expect(result.json).toHaveProperty('success', true); + expect(result.json).toHaveProperty('numTotalTests', 2); + expect(result.json.testResults.map(({name}) => name).sort()).toEqual([ + resolve(dir, '__tests__/first-project.test.js'), + resolve(dir, '__tests__/second-project.test.js'), + ]); + }); + it('prints that both first-project and second-project will run', () => { + expect(result.stderr).toMatch( + /^Running 2 projects:\n- first-project\n- second-project/, + ); + }); + }); + + describe('when Jest is started without providing `--selectProjects`', () => { + let result: RunJestJsonResult; + beforeAll(() => { + result = runWithJson('select-projects', []); + }); + it('runs the tests in the first and second projects', () => { + expect(result.json).toHaveProperty('success', true); + expect(result.json).toHaveProperty('numTotalTests', 2); + expect(result.json.testResults.map(({name}) => name).sort()).toEqual([ + resolve(dir, '__tests__/first-project.test.js'), + resolve(dir, '__tests__/second-project.test.js'), + ]); + }); + it('does not print which projects are run', () => { + expect(result.stderr).not.toMatch(/^Running/); + }); + }); + + describe('when Jest is started with `--selectProjects third-project`', () => { + let result: RunJestResult; + beforeAll(() => { + result = run('select-projects', ['--selectProjects', 'third-project']); + }); + it('fails', () => { + expect(result).toHaveProperty('failed', true); + }); + it('prints that no project was found', () => { + expect(result.stdout).toMatch( + /^You provided values for --selectProjects but no projects were found matching the selection/, + ); + }); + }); +}); + +describe('Given a config with two projects, first-project and an unnamed project', () => { + const dir = resolve(__dirname, '..', 'select-projects-missing-name'); + + describe('when Jest is started with `--selectProjects first-project`', () => { + let result: RunJestJsonResult; + beforeAll(() => { + result = runWithJson('select-projects-missing-name', [ + '--selectProjects', + 'first-project', + ]); + }); + it('runs the tests in the first project only', () => { + expect(result.json.success).toBe(true); + expect(result.json.numTotalTests).toBe(1); + expect(result.json.testResults.map(({name}) => name)).toEqual([ + resolve(dir, '__tests__/first-project.test.js'), + ]); + }); + it('prints that a project does not have a name', () => { + expect(result.stderr).toMatch( + /^You provided values for --selectProjects but a project does not have a name/, + ); + }); + it('prints that only first-project will run', () => { + const stderrThirdLine = result.stderr.split('\n')[2]; + expect(stderrThirdLine).toMatch(/^Running one project: first-project/); + }); + }); + + describe('when Jest is started without providing `--selectProjects`', () => { + let result: RunJestJsonResult; + beforeAll(() => { + result = runWithJson('select-projects-missing-name', []); + }); + it('runs the tests in the first and second projects', () => { + expect(result.json.success).toBe(true); + expect(result.json.numTotalTests).toBe(2); + expect(result.json.testResults.map(({name}) => name).sort()).toEqual([ + resolve(dir, '__tests__/first-project.test.js'), + resolve(dir, '__tests__/second-project.test.js'), + ]); + }); + it('does not print that a project has no name', () => { + expect(result.stderr).not.toMatch( + /^You provided values for --selectProjects but a project does not have a name/, + ); + }); + }); + + describe('when Jest is started with `--selectProjects third-project`', () => { + let result: RunJestResult; + beforeAll(() => { + result = run('select-projects-missing-name', [ + '--selectProjects', + 'third-project', + ]); + }); + it('fails', () => { + expect(result).toHaveProperty('failed', true); + }); + it('prints that a project does not have a name', () => { + expect(result.stdout).toMatch( + /^You provided values for --selectProjects but a project does not have a name/, + ); + }); + it('prints that no project was found', () => { + const stdoutThirdLine = result.stdout.split('\n')[2]; + expect(stdoutThirdLine).toMatch( + /^You provided values for --selectProjects but no projects were found matching the selection/, + ); + }); + }); +}); diff --git a/e2e/__tests__/setupFilesAfterEnvConfig.test.ts b/e2e/__tests__/setupFilesAfterEnvConfig.test.ts index a5955368e2a1..a9c0b791b82b 100644 --- a/e2e/__tests__/setupFilesAfterEnvConfig.test.ts +++ b/e2e/__tests__/setupFilesAfterEnvConfig.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {json as runWithJson} from '../runJest'; import {writeFiles} from '../Utils'; diff --git a/e2e/__tests__/skipBeforeAfterAll.test.ts b/e2e/__tests__/skipBeforeAfterAll.test.ts new file mode 100644 index 000000000000..52e996552e11 --- /dev/null +++ b/e2e/__tests__/skipBeforeAfterAll.test.ts @@ -0,0 +1,19 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import * as path from 'path'; +import {json as runWithJson} from '../runJest'; + +const DIR = path.resolve(__dirname, '../before-all-skipped'); + +test('correctly skip `beforeAll`s in skipped tests', () => { + const {json} = runWithJson(DIR); + + expect(json.numTotalTests).toBe(6); + expect(json.numPassedTests).toBe(4); + expect(json.numPendingTests).toBe(2); +}); diff --git a/e2e/__tests__/snapshot.test.ts b/e2e/__tests__/snapshot.test.ts index 7cda913f7c44..5396a73b7f95 100644 --- a/e2e/__tests__/snapshot.test.ts +++ b/e2e/__tests__/snapshot.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {wrap} from 'jest-snapshot-serializer-raw'; import {extractSummary} from '../Utils'; import runJest, {json as runWithJson} from '../runJest'; diff --git a/e2e/__tests__/snapshotResolver.test.ts b/e2e/__tests__/snapshotResolver.test.ts index f5c3a08a4b25..f94e0690ed39 100644 --- a/e2e/__tests__/snapshotResolver.test.ts +++ b/e2e/__tests__/snapshotResolver.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import runJest from '../runJest'; const snapshotDir = path.resolve( diff --git a/e2e/__tests__/stackTrace.test.ts b/e2e/__tests__/stackTrace.test.ts index a9e571900cb2..48904bff60e5 100644 --- a/e2e/__tests__/stackTrace.test.ts +++ b/e2e/__tests__/stackTrace.test.ts @@ -78,7 +78,7 @@ describe('Stack Trace', () => { // Make sure we show Jest's jest-resolve as part of the stack trace expect(stderr).toMatch( - /Cannot find module 'this-module-does-not-exist' from 'testError.test\.js'/, + /Cannot find module 'this-module-does-not-exist' from '__tests__\/testError\.test\.js'/, ); expect(stderr).toMatch( diff --git a/e2e/__tests__/testEnvironmentAsync.test.ts b/e2e/__tests__/testEnvironmentAsync.test.ts index fd0d7804ed46..114af7aae14f 100644 --- a/e2e/__tests__/testEnvironmentAsync.test.ts +++ b/e2e/__tests__/testEnvironmentAsync.test.ts @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; import {tmpdir} from 'os'; +import * as fs from 'graceful-fs'; import runJest from '../runJest'; import {cleanup} from '../Utils'; diff --git a/e2e/__tests__/testRetries.test.ts b/e2e/__tests__/testRetries.test.ts index cedf680ea0a2..c7a3587a448d 100644 --- a/e2e/__tests__/testRetries.test.ts +++ b/e2e/__tests__/testRetries.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {skipSuiteOnJasmine} from '@jest/test-utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/toMatchInlineSnapshot.test.ts b/e2e/__tests__/toMatchInlineSnapshot.test.ts index f17ccae6f51a..228662fe6e57 100644 --- a/e2e/__tests__/toMatchInlineSnapshot.test.ts +++ b/e2e/__tests__/toMatchInlineSnapshot.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {wrap} from 'jest-snapshot-serializer-raw'; import {cleanup, makeTemplate, writeFiles} from '../Utils'; import runJest from '../runJest'; @@ -256,6 +256,7 @@ test('handles mocking native modules prettier relies on', () => { const test = ` jest.mock('path', () => ({})); jest.mock('fs', () => ({})); + jest.mock('graceful-fs', () => ({})); test('inline snapshots', () => { expect({}).toMatchInlineSnapshot(); }); diff --git a/e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts b/e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts index 1296b4961a69..eafcccb6527a 100644 --- a/e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts +++ b/e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {cleanup, makeTemplate, writeFiles} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts b/e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts index 0dfb598115fd..da2f419b46c6 100644 --- a/e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts +++ b/e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts @@ -6,7 +6,7 @@ */ import * as path from 'path'; -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import {wrap} from 'jest-snapshot-serializer-raw'; import {cleanup, makeTemplate, writeFiles} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts b/e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts index ed579226a02f..de3a3010ccf7 100644 --- a/e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts +++ b/e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts @@ -6,7 +6,7 @@ */ import * as path from 'path'; -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import {wrap} from 'jest-snapshot-serializer-raw'; import {cleanup, makeTemplate, writeFiles} from '../Utils'; import runJest from '../runJest'; diff --git a/e2e/__tests__/watchModeNoAccess.test.ts b/e2e/__tests__/watchModeNoAccess.test.ts new file mode 100644 index 000000000000..e372e0f12a97 --- /dev/null +++ b/e2e/__tests__/watchModeNoAccess.test.ts @@ -0,0 +1,86 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import * as os from 'os'; +import * as path from 'path'; +import * as fs from 'graceful-fs'; +import {cleanup, writeFiles} from '../Utils'; +import {runContinuous} from '../runJest'; + +const DIR = path.resolve(os.tmpdir(), 'watch_mode_no_access'); + +const sleep = (time: number) => + new Promise(resolve => setTimeout(resolve, time)); + +beforeEach(() => cleanup(DIR)); +afterAll(() => cleanup(DIR)); + +const setupFiles = () => { + writeFiles(DIR, { + '__tests__/foo.test.js': ` + const foo = require('../foo'); + test('foo', () => { expect(typeof foo).toBe('number'); }); + `, + 'foo.js': ` + module.exports = 0; + `, + 'package.json': JSON.stringify({ + jest: {}, + }), + }); +}; + +let testRun: ReturnType; + +afterEach(async () => { + if (testRun) { + await testRun.end(); + } +}); + +const getOneSecondAfterMs = (ms: number) => ms / 1000 + 1; + +test('does not re-run tests when only access time is modified', async () => { + setupFiles(); + + testRun = runContinuous(DIR, ['--watchAll', '--no-watchman']); + + const testCompletedRE = /Ran all test suites./g; + const numberOfTestRuns = (stderr: string): number => { + const matches = stderr.match(testCompletedRE); + return matches ? matches.length : 0; + }; + + // First run + await testRun.waitUntil(({stderr}) => numberOfTestRuns(stderr) === 1); + + // Should re-run the test + const modulePath = path.join(DIR, 'foo.js'); + const stat = fs.lstatSync(modulePath); + fs.utimesSync( + modulePath, + getOneSecondAfterMs(stat.atimeMs), + getOneSecondAfterMs(stat.mtimeMs), + ); + + await testRun.waitUntil(({stderr}) => numberOfTestRuns(stderr) === 2); + + // Should NOT re-run the test + const fakeATime = 1541723621; + fs.utimesSync( + modulePath, + getOneSecondAfterMs(fakeATime), + getOneSecondAfterMs(stat.mtimeMs), + ); + await sleep(3000); + expect(numberOfTestRuns(testRun.getCurrentOutput().stderr)).toBe(2); + + // Should re-run the test + fs.writeFileSync(modulePath, 'module.exports = 1;', {encoding: 'utf-8'}); + await testRun.waitUntil(({stderr}) => numberOfTestRuns(stderr) === 3); +}); diff --git a/e2e/babel-plugin-jest-hoist/__tests__/importJest.test.js b/e2e/babel-plugin-jest-hoist/__tests__/importJest.test.js new file mode 100644 index 000000000000..2933ad991e6e --- /dev/null +++ b/e2e/babel-plugin-jest-hoist/__tests__/importJest.test.js @@ -0,0 +1,53 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +/* eslint-disable import/no-duplicates */ +import {jest} from '@jest/globals'; +import {jest as aliasedJest} from '@jest/globals'; +import * as JestGlobals from '@jest/globals'; +/* eslint-enable import/no-duplicates */ + +import a from '../__test_modules__/a'; +import b from '../__test_modules__/b'; +import c from '../__test_modules__/c'; +import d from '../__test_modules__/d'; + +// These will be hoisted above imports + +jest.unmock('../__test_modules__/a'); +aliasedJest.unmock('../__test_modules__/b'); +JestGlobals.jest.unmock('../__test_modules__/c'); + +// These will not be hoisted above imports + +{ + const jest = {unmock: () => {}}; + jest.unmock('../__test_modules__/d'); +} + +// tests + +test('named import', () => { + expect(a._isMockFunction).toBe(undefined); + expect(a()).toBe('unmocked'); +}); + +test('aliased named import', () => { + expect(b._isMockFunction).toBe(undefined); + expect(b()).toBe('unmocked'); +}); + +test('namespace import', () => { + expect(c._isMockFunction).toBe(undefined); + expect(c()).toBe('unmocked'); +}); + +test('fake jest, shadowed import', () => { + expect(d._isMockFunction).toBe(true); + expect(d()).toBe(undefined); +}); diff --git a/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js b/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js index 615f0e31b4e9..3e3dd10de3e2 100644 --- a/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js +++ b/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js @@ -15,7 +15,7 @@ import a from '../__test_modules__/a'; import b from '../__test_modules__/b'; import c from '../__test_modules__/c'; import d from '../__test_modules__/d'; -import e from '../__test_modules__/e'; +import f from '../__test_modules__/f'; import jestBackticks from '../__test_modules__/jestBackticks'; // The virtual mock call below will be hoisted above this `require` call. @@ -25,7 +25,16 @@ const virtualModule = require('virtual-module'); jest.unmock('react'); jest.deepUnmock('../__test_modules__/Unmocked'); jest.unmock('../__test_modules__/c').unmock('../__test_modules__/d'); -jest.mock('../__test_modules__/e', () => { + +let e; +(function () { + const _getJestObj = 42; + e = require('../__test_modules__/e').default; + // hoisted to the top of the function scope + jest.unmock('../__test_modules__/e'); +})(); + +jest.mock('../__test_modules__/f', () => { if (!global.CALLS) { global.CALLS = 0; } @@ -52,8 +61,13 @@ jest.mock('has-flow-types', () => (props: {children: mixed}) => 3, { // These will not be hoisted jest.unmock('../__test_modules__/a').dontMock('../__test_modules__/b'); // eslint-disable-next-line no-useless-concat -jest.unmock('../__test_modules__/' + 'c'); +jest.unmock('../__test_modules__/' + 'a'); jest.dontMock('../__test_modules__/Mocked'); +{ + const jest = {unmock: () => {}}; + // Would error (used before initialization) if hoisted to the top of the scope + jest.unmock('../__test_modules__/a'); +} // This must not throw an error const myObject = {mock: () => {}}; @@ -84,14 +98,17 @@ describe('babel-plugin-jest-hoist', () => { expect(d._isMockFunction).toBe(undefined); expect(d()).toEqual('unmocked'); + + expect(e._isMock).toBe(undefined); + expect(e()).toEqual('unmocked'); }); it('hoists mock call with 2 arguments', () => { const path = require('path'); - expect(e._isMock).toBe(true); + expect(f._isMock).toBe(true); - const mockFn = e.fn(); + const mockFn = f.fn(); expect(mockFn()).toEqual([path.sep, undefined, undefined]); }); @@ -100,10 +117,10 @@ describe('babel-plugin-jest-hoist', () => { global.CALLS = 0; - require('../__test_modules__/e'); + require('../__test_modules__/f'); expect(global.CALLS).toEqual(1); - require('../__test_modules__/e'); + require('../__test_modules__/f'); expect(global.CALLS).toEqual(1); delete global.CALLS; diff --git a/e2e/before-all-skipped/__tests__/beforeAllFiltered.test.js b/e2e/before-all-skipped/__tests__/beforeAllFiltered.test.js new file mode 100644 index 000000000000..4e1d0f74efa2 --- /dev/null +++ b/e2e/before-all-skipped/__tests__/beforeAllFiltered.test.js @@ -0,0 +1,58 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +let hasBeforeAllRun = false; +let hasAfterAllRun = false; + +describe.skip('in describe.skip', () => { + describe('in describe', () => { + beforeAll(() => { + hasBeforeAllRun = true; + }); + + afterAll(() => { + hasAfterAllRun = true; + }); + + test('it should be skipped', () => { + throw new Error('This should never happen'); + }); + }); +}); + +test('describe.skip should not run beforeAll', () => { + expect(hasBeforeAllRun).toBe(false); +}); + +test('describe.skip should not run afterAll', () => { + expect(hasAfterAllRun).toBe(false); +}); + +let hasBeforeAllRun2 = false; +let hasAfterAllRun2 = false; + +describe('in describe', () => { + beforeAll(() => { + hasBeforeAllRun2 = true; + }); + + afterAll(() => { + hasAfterAllRun2 = true; + }); + + test.skip('it should be skipped', () => { + throw new Error('This should never happen'); + }); +}); + +test('describe having only skipped test should not run beforeAll', () => { + expect(hasBeforeAllRun2).toBe(false); +}); + +test('describe having only skipped test should not run afterAll', () => { + expect(hasAfterAllRun2).toBe(false); +}); diff --git a/e2e/before-all-skipped/package.json b/e2e/before-all-skipped/package.json new file mode 100644 index 000000000000..148788b25446 --- /dev/null +++ b/e2e/before-all-skipped/package.json @@ -0,0 +1,5 @@ +{ + "jest": { + "testEnvironment": "node" + } +} diff --git a/e2e/browser-support/browserTest.js b/e2e/browser-support/browserTest.js deleted file mode 100644 index 2fbeae3d08c0..000000000000 --- a/e2e/browser-support/browserTest.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/* eslint-disable */ -var expect = require('expect'); -var mock = require('jest-mock'); -var prettyFormat = require('pretty-format'); - -describe('es5 builds in browser', function() { - it('runs assertions', function() { - expect(1).toBe(1); - }); - - it('runs mocks', function() { - var someMockFunction = mock.fn(); - expect(someMockFunction).not.toHaveBeenCalled(); - someMockFunction(); - expect(someMockFunction).toHaveBeenCalledTimes(1); - }); - - it('pretty formats a string', function() { - expect(prettyFormat('obj')).toBe('"obj"'); - }); -}); diff --git a/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js b/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js new file mode 100644 index 000000000000..5a519faa3be7 --- /dev/null +++ b/e2e/circus-declaration-errors/__tests__/asyncDefinition.test.js @@ -0,0 +1,20 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +describe('describe', () => { + test('correct test def', () => {}); + + Promise.resolve().then(() => { + test('async definition inside describe', () => {}); + afterAll(() => {}); + }); +}); + +Promise.resolve().then(() => { + test('async definition outside describe', () => {}); + afterAll(() => {}); +}); diff --git a/e2e/circus-declaration-errors/package.json b/e2e/circus-declaration-errors/package.json new file mode 100644 index 000000000000..148788b25446 --- /dev/null +++ b/e2e/circus-declaration-errors/package.json @@ -0,0 +1,5 @@ +{ + "jest": { + "testEnvironment": "node" + } +} diff --git a/e2e/modern-fake-timers/from-config/__tests__/test.js b/e2e/modern-fake-timers/from-config/__tests__/test.js new file mode 100644 index 000000000000..a32e5a5bc8e4 --- /dev/null +++ b/e2e/modern-fake-timers/from-config/__tests__/test.js @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +test('fake timers', () => { + jest.setSystemTime(0); + + expect(Date.now()).toBe(0); + + jest.setSystemTime(1000); + + expect(Date.now()).toBe(1000); +}); diff --git a/e2e/modern-fake-timers/from-config/package.json b/e2e/modern-fake-timers/from-config/package.json new file mode 100644 index 000000000000..48517c65a548 --- /dev/null +++ b/e2e/modern-fake-timers/from-config/package.json @@ -0,0 +1,6 @@ +{ + "jest": { + "timers": "modern", + "testEnvironment": "node" + } +} diff --git a/e2e/modern-fake-timers/from-jest-object/__tests__/test.js b/e2e/modern-fake-timers/from-jest-object/__tests__/test.js new file mode 100644 index 000000000000..acf8f56889cd --- /dev/null +++ b/e2e/modern-fake-timers/from-jest-object/__tests__/test.js @@ -0,0 +1,20 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +test('fake timers', () => { + jest.useFakeTimers('modern'); + + jest.setSystemTime(0); + + expect(Date.now()).toBe(0); + + jest.setSystemTime(1000); + + expect(Date.now()).toBe(1000); +}); diff --git a/e2e/modern-fake-timers/from-jest-object/package.json b/e2e/modern-fake-timers/from-jest-object/package.json new file mode 100644 index 000000000000..148788b25446 --- /dev/null +++ b/e2e/modern-fake-timers/from-jest-object/package.json @@ -0,0 +1,5 @@ +{ + "jest": { + "testEnvironment": "node" + } +} diff --git a/e2e/module-name-mapper-correct-mock-absolute-path/__tests__/index.js b/e2e/module-name-mapper-correct-mock-absolute-path/__tests__/index.js new file mode 100644 index 000000000000..959e1bc9b32d --- /dev/null +++ b/e2e/module-name-mapper-correct-mock-absolute-path/__tests__/index.js @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const importedFn = require('../'); + +jest.mock('/components/Button'); + +test('moduleNameMapping correct configuration', () => { + expect(importedFn).toBeDefined(); +}); diff --git a/e2e/module-name-mapper-correct-mock-absolute-path/index.js b/e2e/module-name-mapper-correct-mock-absolute-path/index.js new file mode 100644 index 000000000000..9552c0b25edd --- /dev/null +++ b/e2e/module-name-mapper-correct-mock-absolute-path/index.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +require('/components/Button'); + +module.exports = () => 'test'; diff --git a/e2e/module-name-mapper-correct-mock-absolute-path/package.json b/e2e/module-name-mapper-correct-mock-absolute-path/package.json new file mode 100644 index 000000000000..67f3c9a77889 --- /dev/null +++ b/e2e/module-name-mapper-correct-mock-absolute-path/package.json @@ -0,0 +1,7 @@ +{ + "jest": { + "moduleNameMapper": { + "^/(.*)$": "/src/$1" + } + } +} diff --git a/e2e/module-name-mapper-correct-mock-absolute-path/src/components/Button.js b/e2e/module-name-mapper-correct-mock-absolute-path/src/components/Button.js new file mode 100644 index 000000000000..ad032eb1bbfe --- /dev/null +++ b/e2e/module-name-mapper-correct-mock-absolute-path/src/components/Button.js @@ -0,0 +1,8 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +module.exports = () => 'Button'; diff --git a/e2e/native-esm/__tests__/native-esm.test.js b/e2e/native-esm/__tests__/native-esm.test.js index 0603e5d67e1d..d5a574cb6534 100644 --- a/e2e/native-esm/__tests__/native-esm.test.js +++ b/e2e/native-esm/__tests__/native-esm.test.js @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +// the point here is that it's the node core module +// eslint-disable-next-line no-restricted-imports import {readFileSync} from 'fs'; import {createRequire} from 'module'; import {dirname, resolve} from 'path'; @@ -12,6 +14,11 @@ import {fileURLToPath} from 'url'; import {jest as jestObject} from '@jest/globals'; import staticImportedStateful from '../stateful.mjs'; import staticImportedStatefulFromCjs from '../fromCjs.mjs'; +// https://github.com/benmosher/eslint-plugin-import/issues/1739 +/* eslint-disable import/no-unresolved */ +import staticImportedStatefulWithQuery from '../stateful.mjs?query=1'; +import staticImportedStatefulWithAnotherQuery from '../stateful.mjs?query=2'; +/* eslint-enable */ import {double} from '../index'; test('should have correct import.meta', () => { @@ -105,3 +112,16 @@ test('handle dynamic imports of the same module in parallel', async () => { expect(first).toBe(second); expect(first(2)).toBe(4); }); + +test('varies module cache by query', () => { + expect(staticImportedStatefulWithQuery).not.toBe( + staticImportedStatefulWithAnotherQuery, + ); + + expect(staticImportedStatefulWithQuery()).toBe(1); + expect(staticImportedStatefulWithQuery()).toBe(2); + expect(staticImportedStatefulWithAnotherQuery()).toBe(1); + expect(staticImportedStatefulWithQuery()).toBe(3); + expect(staticImportedStatefulWithAnotherQuery()).toBe(2); + expect(staticImportedStatefulWithAnotherQuery()).toBe(3); +}); diff --git a/e2e/nested-test-definitions/__tests__/nestedHookInTest.js b/e2e/nested-test-definitions/__tests__/nestedHookInTest.js new file mode 100644 index 000000000000..d7b403d9842c --- /dev/null +++ b/e2e/nested-test-definitions/__tests__/nestedHookInTest.js @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const {getTruthy} = require('../index'); + +test('test', () => { + expect(getTruthy()).toBeTruthy(); + + beforeEach(() => { + // nothing to see here + }); +}); diff --git a/e2e/promise-and-callback/__tests__/promise-and-callback.test.js b/e2e/promise-and-callback/__tests__/promise-and-callback.test.js new file mode 100644 index 000000000000..042638c7ebb2 --- /dev/null +++ b/e2e/promise-and-callback/__tests__/promise-and-callback.test.js @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +it('promise-returning test with callback', done => { + done(); + + return Promise.resolve(); +}); + +it('async test with callback', async done => { + done(); +}); + +it('test done before return value', done => { + done(); + + return 'foobar'; +}); diff --git a/e2e/promise-and-callback/package.json b/e2e/promise-and-callback/package.json new file mode 100644 index 000000000000..148788b25446 --- /dev/null +++ b/e2e/promise-and-callback/package.json @@ -0,0 +1,5 @@ +{ + "jest": { + "testEnvironment": "node" + } +} diff --git a/e2e/resolve/__tests__/resolve.test.js b/e2e/resolve/__tests__/resolve.test.js index e3d3500d6b8c..a6c3b3e4af5c 100644 --- a/e2e/resolve/__tests__/resolve.test.js +++ b/e2e/resolve/__tests__/resolve.test.js @@ -121,7 +121,7 @@ test('should throw module not found error if the module cannot be found', () => expect(() => require('Test8')).toThrow( expect.objectContaining({ code: 'MODULE_NOT_FOUND', - message: "Cannot find module 'Test8' from 'resolve.test.js'", + message: "Cannot find module 'Test8' from '__tests__/resolve.test.js'", }), ); }); diff --git a/e2e/runJest.ts b/e2e/runJest.ts index 98d1a6db4128..44e5e5217894 100644 --- a/e2e/runJest.ts +++ b/e2e/runJest.ts @@ -7,8 +7,8 @@ */ import * as path from 'path'; -import * as fs from 'fs'; import {Writable} from 'stream'; +import * as fs from 'graceful-fs'; import execa = require('execa'); import type {Config} from '@jest/types'; import type {FormattedTestResults} from '@jest/test-result'; @@ -95,7 +95,7 @@ function spawnJest( export type RunJestResult = execa.ExecaReturnValue; -interface RunJestJsonResult extends RunJestResult { +export interface RunJestJsonResult extends RunJestResult { json: FormattedTestResults; } diff --git a/e2e/runtime-internal-module-registry/__mocks__/fs.js b/e2e/runtime-internal-module-registry/__mocks__/fs.js index 86e21919deab..38ea4f886dbd 100644 --- a/e2e/runtime-internal-module-registry/__mocks__/fs.js +++ b/e2e/runtime-internal-module-registry/__mocks__/fs.js @@ -7,7 +7,7 @@ 'use strict'; -const fs = jest.genMockFromModule('fs'); +const fs = jest.createMockFromModule('fs'); let mkdirWasCalled = false; diff --git a/e2e/select-projects-missing-name/__tests__/first-project.test.js b/e2e/select-projects-missing-name/__tests__/first-project.test.js new file mode 100644 index 000000000000..f440fcd752c5 --- /dev/null +++ b/e2e/select-projects-missing-name/__tests__/first-project.test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +it('should run when first-project appears in selectProjects', () => { + expect(true).toBe(true); +}); diff --git a/e2e/select-projects-missing-name/__tests__/second-project.test.js b/e2e/select-projects-missing-name/__tests__/second-project.test.js new file mode 100644 index 000000000000..c3db24a8b9a6 --- /dev/null +++ b/e2e/select-projects-missing-name/__tests__/second-project.test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +it('should run when second-project appears in selectProjects', () => { + expect(true).toBe(true); +}); diff --git a/e2e/select-projects-missing-name/package.json b/e2e/select-projects-missing-name/package.json new file mode 100644 index 000000000000..a9743659e309 --- /dev/null +++ b/e2e/select-projects-missing-name/package.json @@ -0,0 +1,20 @@ +{ + "description": "Testing the behaviour of --selectProjects when a project does not have a name", + "jest": { + "projects": [ + { + "displayName": "first-project", + "testMatch": [ + "/__tests__/first-project.test.js" + ], + "testEnvironment": "node" + }, + { + "testMatch": [ + "/__tests__/second-project.test.js" + ], + "testEnvironment": "node" + } + ] + } +} diff --git a/e2e/select-projects/__tests__/first-project.test.js b/e2e/select-projects/__tests__/first-project.test.js new file mode 100644 index 000000000000..f440fcd752c5 --- /dev/null +++ b/e2e/select-projects/__tests__/first-project.test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +it('should run when first-project appears in selectProjects', () => { + expect(true).toBe(true); +}); diff --git a/e2e/select-projects/__tests__/second-project.test.js b/e2e/select-projects/__tests__/second-project.test.js new file mode 100644 index 000000000000..c3db24a8b9a6 --- /dev/null +++ b/e2e/select-projects/__tests__/second-project.test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +it('should run when second-project appears in selectProjects', () => { + expect(true).toBe(true); +}); diff --git a/e2e/select-projects/package.json b/e2e/select-projects/package.json new file mode 100644 index 000000000000..28e0bcc45e07 --- /dev/null +++ b/e2e/select-projects/package.json @@ -0,0 +1,24 @@ +{ + "description": "Testing the behaviour of --selectProjects", + "jest": { + "projects": [ + { + "displayName": "first-project", + "testMatch": [ + "/__tests__/first-project.test.js" + ], + "testEnvironment": "node" + }, + { + "displayName": { + "name": "second-project", + "color": "blue" + }, + "testMatch": [ + "/__tests__/second-project.test.js" + ], + "testEnvironment": "node" + } + ] + } +} diff --git a/examples/automatic-mocks/__tests__/genMockFromModule.test.js b/examples/automatic-mocks/__tests__/createMockFromModule.test.js similarity index 76% rename from examples/automatic-mocks/__tests__/genMockFromModule.test.js rename to examples/automatic-mocks/__tests__/createMockFromModule.test.js index 274e1b8d5ca8..79881c511189 100644 --- a/examples/automatic-mocks/__tests__/genMockFromModule.test.js +++ b/examples/automatic-mocks/__tests__/createMockFromModule.test.js @@ -7,8 +7,8 @@ test('implementation created by automock', () => { expect(utils.isAuthorized()).toBeUndefined(); }); -test('implementation created by jest.genMockFromModule', () => { - const utils = jest.genMockFromModule('../utils').default; +test('implementation created by jest.createMockFromModule', () => { + const utils = jest.createMockFromModule('../utils').default; utils.isAuthorized = jest.fn(secret => secret === 'not wizard'); expect(utils.authorize.mock).toBeTruthy(); diff --git a/examples/manual-mocks/__mocks__/fs.js b/examples/manual-mocks/__mocks__/fs.js index 64b2bb76c7e4..8e5cd3838217 100644 --- a/examples/manual-mocks/__mocks__/fs.js +++ b/examples/manual-mocks/__mocks__/fs.js @@ -4,7 +4,7 @@ const path = require('path'); -const fs = jest.genMockFromModule('fs'); +const fs = jest.createMockFromModule('fs'); // This is a custom function that our tests can use during setup to specify // what the files on the "mock" filesystem should look like when any of the diff --git a/examples/manual-mocks/__mocks__/lodash.js b/examples/manual-mocks/__mocks__/lodash.js index b726843310b5..2039270fc09b 100644 --- a/examples/manual-mocks/__mocks__/lodash.js +++ b/examples/manual-mocks/__mocks__/lodash.js @@ -1,6 +1,6 @@ // Copyright 2004-present Facebook. All Rights Reserved. -const lodash = jest.genMockFromModule('lodash'); +const lodash = jest.createMockFromModule('lodash'); lodash.head = arr => 5; diff --git a/examples/manual-mocks/models/__mocks__/user.js b/examples/manual-mocks/models/__mocks__/user.js index 56a0e0d68492..57a95c398434 100644 --- a/examples/manual-mocks/models/__mocks__/user.js +++ b/examples/manual-mocks/models/__mocks__/user.js @@ -1,6 +1,6 @@ // Copyright 2004-present Facebook. All Rights Reserved. -const user = jest.genMockFromModule('../user'); +const user = jest.createMockFromModule('../user'); user.getAuthenticated = () => ({ age: 622, diff --git a/examples/module-mock/__tests__/partial_mock.js b/examples/module-mock/__tests__/partial_mock.js index 7e2b92434e13..6d7e610677fc 100644 --- a/examples/module-mock/__tests__/partial_mock.js +++ b/examples/module-mock/__tests__/partial_mock.js @@ -9,7 +9,7 @@ import defaultExport, {apple, strawberry} from '../fruit'; jest.mock('../fruit', () => { const originalModule = jest.requireActual('../fruit'); - const mockedModule = jest.genMockFromModule('../fruit'); + const mockedModule = jest.createMockFromModule('../fruit'); //Mock the default export and named export 'apple'. return { diff --git a/jest.config.js b/jest.config.js index cb189da42604..18ad91a82b6d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -23,7 +23,6 @@ module.exports = { modulePathIgnorePatterns: [ 'examples/.*', 'packages/.*/build', - 'packages/.*/build-es5', 'packages/jest-runtime/src/__tests__/test_root.*', 'website/.*', 'e2e/runtime-internal-module-registry/__mocks__', @@ -44,7 +43,6 @@ module.exports = { '/e2e/global-teardown', '\\.snap$', '/packages/.*/build', - '/packages/.*/build-es5', '/packages/.*/src/__tests__/setPrettyPrint.ts', '/packages/jest-core/src/__tests__/test_root', '/packages/jest-core/src/__tests__/__fixtures__/', diff --git a/karma.conf.js b/karma.conf.js deleted file mode 100644 index 61e032d44fa7..000000000000 --- a/karma.conf.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -module.exports = config => { - config.set({ - browsers: ['ChromeHeadless'], - files: ['e2e/browser-support/browserTest.js'], - frameworks: ['mocha'], - preprocessors: { - 'e2e/browser-support/browserTest.js': ['webpack'], - }, - webpack: { - mode: 'development', - }, - webpackMiddleware: { - // webpack-dev-middleware configuration - // i. e. - stats: 'errors-only', - }, - }); -}; diff --git a/lerna.json b/lerna.json index b6e56f7c55fc..ece5879dd999 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "25.4.0", + "version": "26.0.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index 8658d7699537..5b759bf35f89 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.0.0", "@babel/register": "^7.0.0", - "@jest/test-utils": "^25.1.0", + "@jest/test-utils": "^26.0.0", "@types/babel__core": "^7.0.0", "@types/babel__generator": "^7.0.0", "@types/babel__template": "^7.0.0", @@ -18,21 +18,19 @@ "@types/jest": "24.0.2", "@types/node": "*", "@types/which": "^1.3.2", - "@typescript-eslint/eslint-plugin": "^2.19.0", - "@typescript-eslint/parser": "^2.19.0", + "@typescript-eslint/eslint-plugin": "^2.30.0", + "@typescript-eslint/parser": "^2.30.0", "ansi-regex": "^5.0.0", "ansi-styles": "^4.2.0", "babel-eslint": "^10.0.3", - "babel-loader": "^8.0.5", "babel-plugin-replace-ts-export-assignment": "^0.0.2", "babel-plugin-typescript-strip-namespaces": "^1.1.1", - "camelcase": "^5.0.0", - "chalk": "^3.0.0", + "camelcase": "^6.0.0", + "chalk": "^4.0.0", "chokidar": "^3.3.0", "codecov": "^3.0.0", "debug": "^4.0.1", "dedent": "^0.7.0", - "downlevel-dts": "^0.4.0", "eslint": "^6.2.2", "eslint-config-prettier": "^6.1.0", "eslint-plugin-babel": "^5.1.0", @@ -44,12 +42,12 @@ "eslint-plugin-markdown": "^1.0.0", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.1.0", - "execa": "^3.2.0", + "execa": "^4.0.0", "fast-check": "^1.13.0", "find-process": "^1.4.1", "glob": "^7.1.1", - "globby": "^10.0.2", - "graceful-fs": "^4.2.3", + "globby": "^11.0.0", + "graceful-fs": "^4.2.4", "isbinaryfile": "^4.0.0", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-report": "^3.0.0", @@ -59,30 +57,23 @@ "jest-snapshot-serializer-raw": "^1.1.0", "jest-watch-typeahead": "^0.5.0", "jquery": "^3.2.1", - "karma": "^4.0.1", - "karma-chrome-launcher": "^3.0.0", - "karma-mocha": "^1.3.0", - "karma-webpack": "^4.0.2", "lerna": "^3.20.2", "make-dir": "^3.0.0", "micromatch": "^4.0.2", - "mocha": "^7.0.0", "mock-fs": "^4.4.1", "opencollective": "^1.0.3", "prettier": "^2.0.1", "progress": "^2.0.0", "promise": "^8.0.2", - "realpath-native": "^2.0.0", "resolve": "^1.15.0", "rimraf": "^3.0.0", - "semver": "^6.3.0", + "semver": "^7.3.2", "slash": "^3.0.0", - "string-length": "^3.1.0", + "string-length": "^4.0.1", "strip-ansi": "^6.0.0", - "tempy": "~0.3.0", + "tempy": "^0.5.0", "throat": "^5.0.0", - "typescript": "^3.8.2", - "webpack": "^4.28.4", + "typescript": "^3.9.2", "which": "^2.0.1" }, "scripts": { @@ -96,18 +87,15 @@ "jest": "node ./packages/jest-cli/bin/jest.js", "jest-coverage": "yarn jest --coverage", "lint": "eslint . --cache --ext js,jsx,ts,tsx,md", - "lint-es5-build": "eslint --no-eslintrc --no-ignore --env=browser packages/*/build-es5", "lint:prettier": "prettier '**/*.{md,yml,yaml}' 'website/static/**/*.{css,js}' --write --ignore-path .gitignore", "lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/static/**/*.{css,js}' --check --ignore-path .gitignore", "postinstall": "opencollective postinstall && yarn build", "install-no-ts-build": "node ./scripts/remove-postinstall && yarn --no-progress --frozen-lockfile && node ./scripts/build", - "remove-prettier-dep": "node ./scripts/remove-prettier-dep", "publish": "yarn build-clean && yarn build && lerna publish --silent", - "test-ci-es5-build-in-browser": "karma start --single-run", "test-ci": "yarn jest-coverage --color -i --config jest.config.ci.js && yarn test-leak && node ./scripts/mapCoverage.js && codecov", "test-ci-partial": "yarn jest --color -i --config jest.config.ci.js", "test-pretty-format-perf": "node packages/pretty-format/perf/test.js", - "test-leak": "yarn jest -i --detectLeaks jest-mock jest-diff jest-repl", + "test-leak": "yarn jest -i --detectLeaks jest-mock jest-diff jest-repl pretty-format", "test": "yarn lint && yarn jest", "verify-old-ts": "node ./scripts/verifyOldTs.js", "watch": "yarn build && node ./scripts/watch.js", @@ -141,6 +129,6 @@ "logo": "https://opencollective.com/jest/logo.txt" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" } } diff --git a/packages/babel-jest/package.json b/packages/babel-jest/package.json index a6eca647bef5..744ff284a94f 100644 --- a/packages/babel-jest/package.json +++ b/packages/babel-jest/package.json @@ -1,7 +1,7 @@ { "name": "babel-jest", "description": "Jest plugin to use babel for transformation.", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -10,30 +10,25 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/transform": "^25.4.0", - "@jest/types": "^25.4.0", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", "@types/babel__core": "^7.1.7", "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^25.4.0", - "chalk": "^3.0.0", + "babel-preset-jest": "^26.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", "slash": "^3.0.0" }, "devDependencies": { - "@babel/core": "^7.1.0" + "@babel/core": "^7.1.0", + "@types/graceful-fs": "^4.1.3" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/babel-jest/src/__tests__/index.ts b/packages/babel-jest/src/__tests__/index.ts index 7bbc4f7c84d1..df0387390ce6 100644 --- a/packages/babel-jest/src/__tests__/index.ts +++ b/packages/babel-jest/src/__tests__/index.ts @@ -97,3 +97,21 @@ describe('caller option correctly merges from defaults and options', () => { ); }); }); + +test('can pass null to createTransformer', () => { + const transformer = babelJest.createTransformer(null); + transformer.process(sourceString, 'dummy_path.js', makeProjectConfig(), { + instrument: false, + }); + + expect(loadPartialConfig).toHaveBeenCalledTimes(1); + expect(loadPartialConfig).toHaveBeenCalledWith( + expect.objectContaining({ + caller: { + name: 'babel-jest', + supportsDynamicImport: false, + supportsStaticESM: false, + }, + }), + ); +}); diff --git a/packages/babel-jest/src/index.ts b/packages/babel-jest/src/index.ts index 12d2ee07a3f6..5a23c4fdb1d9 100644 --- a/packages/babel-jest/src/index.ts +++ b/packages/babel-jest/src/index.ts @@ -6,8 +6,8 @@ */ import {createHash} from 'crypto'; -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import type { TransformOptions as JestTransformOptions, Transformer, @@ -41,8 +41,9 @@ interface BabelJestTransformOptions extends TransformOptions { } const createTransformer = ( - inputOptions: TransformOptions = {}, + userOptions?: TransformOptions | null, ): BabelJestTransformer => { + const inputOptions: TransformOptions = userOptions ?? {}; const options: BabelJestTransformOptions = { ...inputOptions, caller: { diff --git a/packages/babel-plugin-jest-hoist/package.json b/packages/babel-plugin-jest-hoist/package.json index de303f8cfdff..1ff249bfe8ec 100644 --- a/packages/babel-plugin-jest-hoist/package.json +++ b/packages/babel-plugin-jest-hoist/package.json @@ -1,29 +1,23 @@ { "name": "babel-plugin-jest-hoist", - "version": "25.4.0", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/babel-plugin-jest-hoist" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", "@types/babel__traverse": "^7.0.6" }, "devDependencies": { - "@babel/types": "^7.3.3", "@types/node": "*" }, "publishConfig": { diff --git a/packages/babel-plugin-jest-hoist/src/index.ts b/packages/babel-plugin-jest-hoist/src/index.ts index 43f19e39c52f..a9cbe1a0f65e 100644 --- a/packages/babel-plugin-jest-hoist/src/index.ts +++ b/packages/babel-plugin-jest-hoist/src/index.ts @@ -6,8 +6,21 @@ * */ -import type {NodePath, Visitor} from '@babel/traverse'; -import type {Identifier} from '@babel/types'; +import type {NodePath} from '@babel/traverse'; +import { + Expression, + Identifier, + Node, + Program, + callExpression, + isIdentifier, +} from '@babel/types'; +import {statement} from '@babel/template'; +import type {PluginObj} from '@babel/core'; + +const JEST_GLOBAL_NAME = 'jest'; +const JEST_GLOBALS_MODULE_NAME = '@jest/globals'; +const JEST_GLOBALS_MODULE_JEST_EXPORT_NAME = 'jest'; // We allow `jest`, `expect`, `require`, all default Node.js globals and all // ES2015 built-ins to be used inside of a `jest.mock` factory. @@ -70,19 +83,19 @@ const WHITELISTED_IDENTIFIERS = new Set( ].sort(), ); -const JEST_GLOBAL = {name: 'jest'}; -// TODO: Should be Visitor<{ids: Set>}>, but `ReferencedIdentifier` doesn't exist const IDVisitor = { - ReferencedIdentifier(path: NodePath) { - // @ts-ignore: passed as Visitor State - this.ids.add(path); + ReferencedIdentifier( + path: NodePath, + {ids}: {ids: Set>}, + ) { + ids.add(path); }, blacklist: ['TypeAnnotation', 'TSTypeAnnotation', 'TSTypeReference'], }; const FUNCTIONS: Record< string, - (args: Array) => boolean + (args: Array>) => boolean > = Object.create(null); FUNCTIONS.mock = args => { @@ -100,7 +113,7 @@ FUNCTIONS.mock = args => { const ids: Set> = new Set(); const parentScope = moduleFactory.parentPath.scope; - // @ts-ignore: Same as above: ReferencedIdentifier doesn't exist + // @ts-expect-error: ReferencedIdentifier is not known on visitors moduleFactory.traverse(IDVisitor, {ids}); for (const id of ids) { const {name} = id.node; @@ -152,38 +165,140 @@ FUNCTIONS.deepUnmock = args => args.length === 1 && args[0].isStringLiteral(); FUNCTIONS.disableAutomock = FUNCTIONS.enableAutomock = args => args.length === 0; -export default (): {visitor: Visitor} => { - const shouldHoistExpression = (expr: NodePath): boolean => { - if (!expr.isCallExpression()) { - return false; - } +const createJestObjectGetter = statement` +function GETTER_NAME() { + const { JEST_GLOBALS_MODULE_JEST_EXPORT_NAME } = require("JEST_GLOBALS_MODULE_NAME"); + GETTER_NAME = () => JEST_GLOBALS_MODULE_JEST_EXPORT_NAME; + return JEST_GLOBALS_MODULE_JEST_EXPORT_NAME; +} +`; - // TODO: avoid type casts - the types can be arrays (is it possible to ignore that without casting?) - const callee = expr.get('callee') as NodePath; - const expressionArguments = expr.get('arguments'); - const object = callee.get('object') as NodePath; - const property = callee.get('property') as NodePath; - return ( - property.isIdentifier() && - FUNCTIONS[property.node.name] && - (object.isIdentifier(JEST_GLOBAL) || - (callee.isMemberExpression() && shouldHoistExpression(object))) && - FUNCTIONS[property.node.name]( - Array.isArray(expressionArguments) - ? expressionArguments - : [expressionArguments], - ) - ); - }; - - const visitor: Visitor = { - ExpressionStatement(path) { - if (shouldHoistExpression(path.get('expression') as NodePath)) { - // @ts-ignore: private, magical property - path.node._blockHoist = Infinity; - } - }, - }; +const isJestObject = (expression: NodePath): boolean => { + // global + if ( + expression.isIdentifier() && + expression.node.name === JEST_GLOBAL_NAME && + !expression.scope.hasBinding(JEST_GLOBAL_NAME) + ) { + return true; + } + // import { jest } from '@jest/globals' + if ( + expression.referencesImport( + JEST_GLOBALS_MODULE_NAME, + JEST_GLOBALS_MODULE_JEST_EXPORT_NAME, + ) + ) { + return true; + } + // import * as JestGlobals from '@jest/globals' + if ( + expression.isMemberExpression() && + !expression.node.computed && + expression + .get<'object'>('object') + .referencesImport(JEST_GLOBALS_MODULE_NAME, '*') && + expression.node.property.name === JEST_GLOBALS_MODULE_JEST_EXPORT_NAME + ) { + return true; + } - return {visitor}; + return false; }; + +const extractJestObjExprIfHoistable = ( + expr: NodePath, +): NodePath | null => { + if (!expr.isCallExpression()) { + return null; + } + + const callee = expr.get<'callee'>('callee'); + const args = expr.get<'arguments'>('arguments'); + + if (!callee.isMemberExpression() || callee.node.computed) { + return null; + } + + const object = callee.get<'object'>('object'); + const property = callee.get<'property'>('property') as NodePath; + const propertyName = property.node.name; + + const jestObjExpr = isJestObject(object) + ? object + : // The Jest object could be returned from another call since the functions are all chainable. + extractJestObjExprIfHoistable(object); + if (!jestObjExpr) { + return null; + } + + // Important: Call the function check last + // It might throw an error to display to the user, + // which should only happen if we're already sure it's a call on the Jest object. + const functionLooksHoistable = FUNCTIONS[propertyName]?.(args); + + return functionLooksHoistable ? jestObjExpr : null; +}; + +/* eslint-disable sort-keys,@typescript-eslint/explicit-module-boundary-types */ +export default (): PluginObj<{ + declareJestObjGetterIdentifier: () => Identifier; + jestObjGetterIdentifier?: Identifier; +}> => ({ + pre({path: program}: {path: NodePath}) { + this.declareJestObjGetterIdentifier = () => { + if (this.jestObjGetterIdentifier) { + return this.jestObjGetterIdentifier; + } + + this.jestObjGetterIdentifier = program.scope.generateUidIdentifier( + 'getJestObj', + ); + + program.unshiftContainer('body', [ + createJestObjectGetter({ + GETTER_NAME: this.jestObjGetterIdentifier.name, + JEST_GLOBALS_MODULE_JEST_EXPORT_NAME, + JEST_GLOBALS_MODULE_NAME, + }), + ]); + + return this.jestObjGetterIdentifier; + }; + }, + visitor: { + ExpressionStatement(exprStmt) { + const jestObjExpr = extractJestObjExprIfHoistable( + exprStmt.get<'expression'>('expression'), + ); + if (jestObjExpr) { + jestObjExpr.replaceWith( + callExpression(this.declareJestObjGetterIdentifier(), []), + ); + } + }, + }, + // in `post` to make sure we come after an import transform and can unshift above the `require`s + post({path: program}: {path: NodePath}) { + program.traverse({ + CallExpression: callExpr => { + const { + node: {callee}, + } = callExpr; + if ( + isIdentifier(callee) && + callee.name === this.jestObjGetterIdentifier?.name + ) { + const mockStmt = callExpr.getStatementParent(); + const mockStmtNode = mockStmt.node; + const mockStmtParent = mockStmt.parentPath; + if (mockStmtParent.isBlock()) { + mockStmt.remove(); + mockStmtParent.unshiftContainer('body', [mockStmtNode]); + } + } + }, + }); + }, +}); +/* eslint-enable sort-keys,@typescript-eslint/explicit-module-boundary-types */ diff --git a/packages/babel-preset-jest/package.json b/packages/babel-preset-jest/package.json index 9695bdbed32c..c0ab101f6d72 100644 --- a/packages/babel-preset-jest/package.json +++ b/packages/babel-preset-jest/package.json @@ -1,6 +1,6 @@ { "name": "babel-preset-jest", - "version": "25.4.0", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,14 +9,14 @@ "license": "MIT", "main": "index.js", "dependencies": { - "babel-plugin-jest-hoist": "^25.4.0", + "babel-plugin-jest-hoist": "^26.0.0", "babel-preset-current-node-syntax": "^0.1.2" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/diff-sequences/package.json b/packages/diff-sequences/package.json index 7912d18f0d65..26ca9704e9ec 100644 --- a/packages/diff-sequences/package.json +++ b/packages/diff-sequences/package.json @@ -1,6 +1,6 @@ { "name": "diff-sequences", - "version": "25.2.6", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -16,17 +16,10 @@ "diff" ], "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "scripts": { "perf": "node --expose-gc perf/index.js" }, diff --git a/packages/eslint-config-fb-strict/package.json b/packages/eslint-config-fb-strict/package.json index b9c262e3b51c..ced29f6867ef 100644 --- a/packages/eslint-config-fb-strict/package.json +++ b/packages/eslint-config-fb-strict/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-fb-strict", - "version": "25.2.6", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -20,7 +20,7 @@ "eslint-plugin-react": "^7.1.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/expect/package.json b/packages/expect/package.json index 04dbdb74f56a..3df291ab87ef 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -1,6 +1,6 @@ { "name": "expect", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,30 +9,22 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, - "browser": "build-es5/index.js", "dependencies": { - "@jest/types": "^25.4.0", + "@jest/types": "^26.0.1", "ansi-styles": "^4.0.0", - "jest-get-type": "^25.2.6", - "jest-matcher-utils": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-regex-util": "^25.2.6" + "jest-get-type": "^26.0.0", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-regex-util": "^26.0.0" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", - "chalk": "^3.0.0", + "@jest/test-utils": "^26.0.0", + "chalk": "^4.0.0", "fast-check": "^1.13.0", "immutable": "^4.0.0-rc.12" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index 652e3020ab90..aa0d250d4cb4 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -2022,11 +2022,11 @@ exports[`.toEqual() {pass: false} expect("type TypeName = T extends Function + type TypeName = T extends Function ? "function" : "object"; `; -exports[`.toEqual() {pass: false} expect(/abc/gy).toEqual(/abc/g) 1`] = ` +exports[`.toEqual() {pass: false} expect(/abc/gsy).toEqual(/abc/g) 1`] = ` expect(received).toEqual(expected) // deep equality Expected: /abc/g -Received: /abc/gy +Received: /abc/gsy `; exports[`.toEqual() {pass: false} expect([1, 2]).toEqual([2, 1]) 1`] = ` diff --git a/packages/expect/src/extractExpectedAssertionsErrors.ts b/packages/expect/src/extractExpectedAssertionsErrors.ts index de97acc2dc4d..44aa5ba95b2a 100644 --- a/packages/expect/src/extractExpectedAssertionsErrors.ts +++ b/packages/expect/src/extractExpectedAssertionsErrors.ts @@ -23,10 +23,16 @@ const resetAssertionsLocalState = () => { }); }; +type AssertionsErrors = Array<{ + actual: string; + error: string; + expected: string | number; +}>; + // Create and format all errors related to the mismatched number of `expect` // calls and reset the matcher's state. -const extractExpectedAssertionsErrors = () => { - const result = []; +const extractExpectedAssertionsErrors: () => AssertionsErrors = () => { + const result: AssertionsErrors = []; const { assertionCalls, expectedAssertionsNumber, diff --git a/packages/jest-changed-files/package.json b/packages/jest-changed-files/package.json index 454b06e57b69..174c99939b02 100644 --- a/packages/jest-changed-files/package.json +++ b/packages/jest-changed-files/package.json @@ -1,6 +1,6 @@ { "name": "jest-changed-files", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,20 +9,13 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "execa": "^3.2.0", + "@jest/types": "^26.0.1", + "execa": "^4.0.0", "throat": "^5.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-circus/package.json b/packages/jest-circus/package.json index da9d3547d944..36061ed5f9e4 100644 --- a/packages/jest-circus/package.json +++ b/packages/jest-circus/package.json @@ -1,6 +1,6 @@ { "name": "jest-circus", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,43 +9,40 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^25.4.0", - "@jest/test-result": "^25.4.0", - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", + "@jest/environment": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^25.4.0", + "dedent": "^0.7.0", + "expect": "^26.0.1", "is-generator-fn": "^2.0.0", - "jest-each": "^25.4.0", - "jest-matcher-utils": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-runtime": "^25.4.0", - "jest-snapshot": "^25.4.0", - "jest-util": "^25.4.0", - "pretty-format": "^25.4.0", - "stack-utils": "^1.0.1", + "jest-each": "^26.0.1", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "pretty-format": "^26.0.1", + "stack-utils": "^2.0.2", "throat": "^5.0.0" }, "devDependencies": { "@babel/core": "^7.1.0", "@babel/register": "^7.0.0", - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "@types/babel__traverse": "^7.0.4", "@types/co": "^4.6.0", + "@types/dedent": "^0.7.0", + "@types/graceful-fs": "^4.1.3", "@types/stack-utils": "^1.0.1", - "execa": "^3.2.0" + "execa": "^4.0.0", + "graceful-fs": "^4.2.4" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-circus/src/__mocks__/testUtils.ts b/packages/jest-circus/src/__mocks__/testUtils.ts index 4a26fc4a2907..eb2c1d007466 100644 --- a/packages/jest-circus/src/__mocks__/testUtils.ts +++ b/packages/jest-circus/src/__mocks__/testUtils.ts @@ -5,10 +5,10 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import {tmpdir} from 'os'; import * as path from 'path'; import {createHash} from 'crypto'; +import * as fs from 'graceful-fs'; // eslint-disable-next-line import/named import {ExecaSyncReturnValue, sync as spawnSync} from 'execa'; import {skipSuiteOnWindows} from '@jest/test-utils'; diff --git a/packages/jest-circus/src/__tests__/circusItTestError.test.ts b/packages/jest-circus/src/__tests__/circusItTestError.test.ts index 56e7b8fae366..d2dc7e5de6cf 100644 --- a/packages/jest-circus/src/__tests__/circusItTestError.test.ts +++ b/packages/jest-circus/src/__tests__/circusItTestError.test.ts @@ -29,7 +29,7 @@ describe('test/it error throwing', () => { }); it(`it throws error with missing callback function`, () => { expect(() => { - // @ts-ignore: Easy, we're testing runtime errors here + // @ts-expect-error: Easy, we're testing runtime errors here circusIt('test2'); }).toThrowError( 'Missing second argument. It must be a callback function. Perhaps you want to use `test.todo` for a test placeholder.', @@ -37,13 +37,13 @@ describe('test/it error throwing', () => { }); it(`it throws an error when first argument isn't a string`, () => { expect(() => { - // @ts-ignore: Easy, we're testing runtime errors here + // @ts-expect-error: Easy, we're testing runtime errors here circusIt(() => {}); }).toThrowError('Invalid first argument, () => {}. It must be a string.'); }); it('it throws an error when callback function is not a function', () => { expect(() => { - // @ts-ignore: Easy, we're testing runtime errors here + // @ts-expect-error: Easy, we're testing runtime errors here circusIt('test4', 'test4b'); }).toThrowError( 'Invalid second argument, test4b. It must be a callback function.', @@ -56,7 +56,7 @@ describe('test/it error throwing', () => { }); it(`test throws error with missing callback function`, () => { expect(() => { - // @ts-ignore: Easy, we're testing runtime errors here + // @ts-expect-error: Easy, we're testing runtime errors here circusTest('test6'); }).toThrowError( 'Missing second argument. It must be a callback function. Perhaps you want to use `test.todo` for a test placeholder.', @@ -64,13 +64,13 @@ describe('test/it error throwing', () => { }); it(`test throws an error when first argument isn't a string`, () => { expect(() => { - // @ts-ignore: Easy, we're testing runtime errors here + // @ts-expect-error: Easy, we're testing runtime errors here circusTest(() => {}); }).toThrowError('Invalid first argument, () => {}. It must be a string.'); }); it('test throws an error when callback function is not a function', () => { expect(() => { - // @ts-ignore: Easy, we're testing runtime errors here + // @ts-expect-error: Easy, we're testing runtime errors here circusTest('test8', 'test8b'); }).toThrowError( 'Invalid second argument, test8b. It must be a callback function.', diff --git a/packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts b/packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts index 1eb655de77dd..b783b7b3069a 100644 --- a/packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts +++ b/packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts @@ -22,7 +22,7 @@ aliasCircusIt(); describe('test/it.todo error throwing', () => { it('todo throws error when given no arguments', () => { expect(() => { - // @ts-ignore: Testing runtime errors here + // @ts-expect-error: Testing runtime errors here circusIt.todo(); }).toThrowError('Todo must be called with only a description.'); }); @@ -33,7 +33,7 @@ describe('test/it.todo error throwing', () => { }); it('todo throws error when given none string description', () => { expect(() => { - // @ts-ignore: Testing runtime errors here + // @ts-expect-error: Testing runtime errors here circusIt.todo(() => {}); }).toThrowError('Todo must be called with only a description.'); }); diff --git a/packages/jest-circus/src/eventHandler.ts b/packages/jest-circus/src/eventHandler.ts index 2e1327a8ad6b..dfe916a629a1 100644 --- a/packages/jest-circus/src/eventHandler.ts +++ b/packages/jest-circus/src/eventHandler.ts @@ -39,9 +39,12 @@ const eventHandler: Circus.EventHandler = ( const {currentDescribeBlock, currentlyRunningTest} = state; if (currentlyRunningTest) { - throw new Error( - `Cannot nest a describe inside a test. Describe block "${blockName}" cannot run because it is nested within "${currentlyRunningTest.name}".`, + currentlyRunningTest.errors.push( + new Error( + `Cannot nest a describe inside a test. Describe block "${blockName}" cannot run because it is nested within "${currentlyRunningTest.name}".`, + ), ); + break; } const describeBlock = makeDescribe(blockName, currentDescribeBlock, mode); @@ -60,24 +63,26 @@ const eventHandler: Circus.EventHandler = ( }); } - // inherit mode from its parent describe but - // do not inherit "only" mode when there is already tests with "only" mode - const shouldInheritMode = !( + // pass mode of currentDescribeBlock to tests + // but do not when there is already a single test with "only" mode + const shouldPassMode = !( currentDescribeBlock.mode === 'only' && - currentDescribeBlock.tests.find(test => test.mode === 'only') + currentDescribeBlock.children.some( + child => child.type === 'test' && child.mode === 'only', + ) ); - - if (shouldInheritMode) { - currentDescribeBlock.tests.forEach(test => { - if (!test.mode) { - test.mode = currentDescribeBlock.mode; + if (shouldPassMode) { + currentDescribeBlock.children.forEach(child => { + if (child.type === 'test' && !child.mode) { + child.mode = currentDescribeBlock.mode; } }); } - if ( !state.hasFocusedTests && - currentDescribeBlock.tests.some(test => test.mode === 'only') + currentDescribeBlock.children.some( + child => child.type === 'test' && child.mode === 'only', + ) ) { state.hasFocusedTests = true; } @@ -88,20 +93,47 @@ const eventHandler: Circus.EventHandler = ( break; } case 'add_hook': { - const {currentDescribeBlock} = state; + const {currentDescribeBlock, currentlyRunningTest, hasStarted} = state; const {asyncError, fn, hookType: type, timeout} = event; + + if (currentlyRunningTest) { + currentlyRunningTest.errors.push( + new Error( + `Hooks cannot be defined inside tests. Hook of type "${type}" is nested within "${currentlyRunningTest.name}".`, + ), + ); + break; + } else if (hasStarted) { + state.unhandledErrors.push( + new Error( + 'Cannot add a hook after tests have started running. Hooks must be defined synchronously.', + ), + ); + break; + } const parent = currentDescribeBlock; + currentDescribeBlock.hooks.push({asyncError, fn, parent, timeout, type}); break; } case 'add_test': { - const {currentDescribeBlock, currentlyRunningTest} = state; + const {currentDescribeBlock, currentlyRunningTest, hasStarted} = state; const {asyncError, fn, mode, testName: name, timeout} = event; if (currentlyRunningTest) { - throw new Error( - `Tests cannot be nested. Test "${name}" cannot run because it is nested within "${currentlyRunningTest.name}".`, + currentlyRunningTest.errors.push( + new Error( + `Tests cannot be nested. Test "${name}" cannot run because it is nested within "${currentlyRunningTest.name}".`, + ), + ); + break; + } else if (hasStarted) { + state.unhandledErrors.push( + new Error( + 'Cannot add a test after tests have started running. Tests must be defined synchronously.', + ), ); + break; } const test = makeTest( @@ -115,6 +147,7 @@ const eventHandler: Circus.EventHandler = ( if (test.mode === 'only') { state.hasFocusedTests = true; } + currentDescribeBlock.children.push(test); currentDescribeBlock.tests.push(test); break; } @@ -168,6 +201,7 @@ const eventHandler: Circus.EventHandler = ( break; } case 'run_start': { + state.hasStarted = true; global[TEST_TIMEOUT_SYMBOL] && (state.testTimeout = global[TEST_TIMEOUT_SYMBOL]); break; diff --git a/packages/jest-circus/src/formatNodeAssertErrors.ts b/packages/jest-circus/src/formatNodeAssertErrors.ts index 69a3c144fd26..10ffc8d1e25f 100644 --- a/packages/jest-circus/src/formatNodeAssertErrors.ts +++ b/packages/jest-circus/src/formatNodeAssertErrors.ts @@ -38,9 +38,12 @@ const humanReadableOperators: Record = { strictEqual: 'to strictly be equal', }; -const formatNodeAssertErrors = (event: Circus.Event, state: Circus.State) => { +const formatNodeAssertErrors = ( + event: Circus.Event, + state: Circus.State, +): void => { if (event.name === 'test_done') { - event.test.errors = event.test.errors.map((errors: Circus.TestError) => { + event.test.errors = event.test.errors.map(errors => { let error; if (Array.isArray(errors)) { const [originalError, asyncError] = errors; diff --git a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts index a7fdf68cb0d9..ff59c04981ba 100644 --- a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts +++ b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts @@ -11,6 +11,7 @@ import type {JestEnvironment} from '@jest/environment'; import type {TestResult} from '@jest/test-result'; import type {RuntimeType as Runtime} from 'jest-runtime'; import type {SnapshotStateType} from 'jest-snapshot'; +import {deepCyclicCopy} from 'jest-util'; const FRAMEWORK_INITIALIZER = path.resolve(__dirname, './jestAdapterInit.js'); const EXPECT_INITIALIZER = path.resolve(__dirname, './jestExpect.js'); @@ -48,9 +49,11 @@ const jestAdapter = async ( testPath, }); - if (config.timers === 'fake') { + if (config.timers === 'fake' || config.timers === 'legacy') { // during setup, this cannot be null (and it's fine to explode if it is) environment.fakeTimers!.useFakeTimers(); + } else if (config.timers === 'modern') { + environment.fakeTimersModern!.useFakeTimers(); } globals.beforeEach(() => { @@ -77,7 +80,8 @@ const jestAdapter = async ( }); for (const path of config.setupFilesAfterEnv) { - const esm = runtime.unstable_shouldLoadAsEsm(path); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(path); if (esm) { await runtime.unstable_importModule(path); @@ -86,7 +90,8 @@ const jestAdapter = async ( } } - const esm = runtime.unstable_shouldLoadAsEsm(testPath); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(testPath); if (esm) { await runtime.unstable_importModule(testPath); @@ -99,7 +104,13 @@ const jestAdapter = async ( globalConfig, testPath, }); - return _addSnapshotData(results, snapshotState); + + _addSnapshotData(results, snapshotState); + + // We need to copy the results object to ensure we don't leaks the prototypes + // from the VM. Jasmine creates the result objects in the parent process, we + // should consider doing that for circus as well. + return deepCyclicCopy(results, {keepPrototype: false}); }; const _addSnapshotData = ( @@ -129,7 +140,6 @@ const _addSnapshotData = ( results.snapshot.unchecked = !status.deleted ? uncheckedCount : 0; // Copy the array to prevent memory leaks results.snapshot.uncheckedKeys = Array.from(uncheckedKeys); - return results; }; export = jestAdapter; diff --git a/packages/jest-circus/src/run.ts b/packages/jest-circus/src/run.ts index eabd09411a44..f9a9969c7b3b 100644 --- a/packages/jest-circus/src/run.ts +++ b/packages/jest-circus/src/run.ts @@ -43,16 +43,25 @@ const _runTestsForDescribeBlock = async ( const retryTimes = parseInt(global[RETRY_TIMES], 10) || 0; const deferredRetryTests = []; - for (const test of describeBlock.tests) { - const hasErrorsBeforeTestRun = test.errors.length > 0; - await _runTest(test); - - if ( - hasErrorsBeforeTestRun === false && - retryTimes > 0 && - test.errors.length > 0 - ) { - deferredRetryTests.push(test); + for (const child of describeBlock.children) { + switch (child.type) { + case 'describeBlock': { + await _runTestsForDescribeBlock(child); + break; + } + case 'test': { + const hasErrorsBeforeTestRun = child.errors.length > 0; + await _runTest(child); + + if ( + hasErrorsBeforeTestRun === false && + retryTimes > 0 && + child.errors.length > 0 + ) { + deferredRetryTests.push(child); + } + break; + } } } @@ -69,10 +78,6 @@ const _runTestsForDescribeBlock = async ( } } - for (const child of describeBlock.children) { - await _runTestsForDescribeBlock(child); - } - for (const hook of afterAll) { await _callCircusHook({describeBlock, hook}); } @@ -138,7 +143,10 @@ const _callCircusHook = async ({ const timeout = hook.timeout || getState().testTimeout; try { - await callAsyncCircusFn(hook.fn, testContext, {isHook: true, timeout}); + await callAsyncCircusFn(hook.fn, testContext, hook.asyncError, { + isHook: true, + timeout, + }); await dispatch({describeBlock, hook, name: 'hook_success', test}); } catch (error) { await dispatch({describeBlock, error, hook, name: 'hook_failure', test}); @@ -158,7 +166,10 @@ const _callCircusTest = async ( } try { - await callAsyncCircusFn(test.fn, testContext, {isHook: false, timeout}); + await callAsyncCircusFn(test.fn, testContext, test.asyncError, { + isHook: false, + timeout, + }); await dispatch({name: 'test_fn_success', test}); } catch (error) { await dispatch({error, name: 'test_fn_failure', test}); diff --git a/packages/jest-circus/src/state.ts b/packages/jest-circus/src/state.ts index 3342479821b1..be81a73045f6 100644 --- a/packages/jest-circus/src/state.ts +++ b/packages/jest-circus/src/state.ts @@ -24,7 +24,8 @@ const INITIAL_STATE: Circus.State = { currentDescribeBlock: ROOT_DESCRIBE_BLOCK, currentlyRunningTest: null, expand: undefined, - hasFocusedTests: false, // whether .only has been used on any test/describe + hasFocusedTests: false, + hasStarted: false, includeTestLocationInResult: false, parentProcess: null, rootDescribeBlock: ROOT_DESCRIBE_BLOCK, diff --git a/packages/jest-circus/src/utils.ts b/packages/jest-circus/src/utils.ts index fa477c12d9db..ca9bebeef466 100644 --- a/packages/jest-circus/src/utils.ts +++ b/packages/jest-circus/src/utils.ts @@ -6,9 +6,10 @@ */ import type {Circus} from '@jest/types'; -import {convertDescriptorToString} from 'jest-util'; +import {convertDescriptorToString, formatTime} from 'jest-util'; import isGeneratorFn from 'is-generator-fn'; import co from 'co'; +import dedent = require('dedent'); import StackUtils = require('stack-utils'); import prettyFormat = require('pretty-format'); import {getState} from './state'; @@ -27,6 +28,7 @@ export const makeDescribe = ( } return { + type: 'describeBlock', // eslint-disable-next-line sort-keys children: [], hooks: [], mode: _mode, @@ -44,6 +46,7 @@ export const makeTest = ( timeout: number | undefined, asyncError: Circus.Exception, ): Circus.TestEntry => ({ + type: 'test', // eslint-disable-next-line sort-keys asyncError, duration: null, errors: [], @@ -61,16 +64,15 @@ export const makeTest = ( // block has an enabled test. const hasEnabledTest = (describeBlock: Circus.DescribeBlock): boolean => { const {hasFocusedTests, testNamePattern} = getState(); - const hasOwnEnabledTests = describeBlock.tests.some( - test => - !( - test.mode === 'skip' || - (hasFocusedTests && test.mode !== 'only') || - (testNamePattern && !testNamePattern.test(getTestID(test))) - ), + return describeBlock.children.some(child => + child.type === 'describeBlock' + ? hasEnabledTest(child) + : !( + child.mode === 'skip' || + (hasFocusedTests && child.mode !== 'only') || + (testNamePattern && !testNamePattern.test(getTestID(child))) + ), ); - - return hasOwnEnabledTests || describeBlock.children.some(hasEnabledTest); }; type DescribeHooks = { @@ -135,10 +137,12 @@ export const getEachHooksForTest = (test: Circus.TestEntry): TestHooks => { export const describeBlockHasTests = ( describe: Circus.DescribeBlock, ): boolean => - describe.tests.length > 0 || describe.children.some(describeBlockHasTests); + describe.children.some( + child => child.type === 'test' || describeBlockHasTests(child), + ); const _makeTimeoutMessage = (timeout: number, isHook: boolean) => - `Exceeded timeout of ${timeout}ms for a ${ + `Exceeded timeout of ${formatTime(timeout)} for a ${ isHook ? 'hook' : 'test' }.\nUse jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.`; @@ -153,6 +157,7 @@ function checkIsError(error: any): error is Error { export const callAsyncCircusFn = ( fn: Circus.AsyncFn, testContext: Circus.TestContext | undefined, + asyncError: Circus.Exception, {isHook, timeout}: {isHook?: boolean | null; timeout: number}, ): Promise => { let timeoutID: NodeJS.Timeout; @@ -167,24 +172,47 @@ export const callAsyncCircusFn = ( // If this fn accepts `done` callback we return a promise that fulfills as // soon as `done` called. if (fn.length) { + let returnedValue: unknown = undefined; const done = (reason?: Error | string): void => { - const errorAsErrorObject = checkIsError(reason) - ? reason - : new Error(`Failed: ${prettyFormat(reason, {maxDepth: 3})}`); - - // Consider always throwing, regardless if `reason` is set or not - if (completed && reason) { - errorAsErrorObject.message = - 'Caught error after test environment was torn down\n\n' + - errorAsErrorObject.message; - - throw errorAsErrorObject; - } - - return reason ? reject(errorAsErrorObject) : resolve(); + // We need to keep a stack here before the promise tick + const errorAtDone = new Error(); + // Use `Promise.resolve` to allow the event loop to go a single tick in case `done` is called synchronously + Promise.resolve().then(() => { + if (returnedValue !== undefined) { + asyncError.message = dedent` + Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise. + Returned value: ${prettyFormat(returnedValue, {maxDepth: 3})} + `; + return reject(asyncError); + } + + let errorAsErrorObject: Error; + + if (checkIsError(reason)) { + errorAsErrorObject = reason; + } else { + errorAsErrorObject = errorAtDone; + errorAtDone.message = `Failed: ${prettyFormat(reason, { + maxDepth: 3, + })}`; + } + + // Consider always throwing, regardless if `reason` is set or not + if (completed && reason) { + errorAsErrorObject.message = + 'Caught error after test environment was torn down\n\n' + + errorAsErrorObject.message; + + throw errorAsErrorObject; + } + + return reason ? reject(errorAsErrorObject) : resolve(); + }); }; - return fn.call(testContext, done); + returnedValue = fn.call(testContext, done); + + return; } let returnedValue; @@ -194,7 +222,8 @@ export const callAsyncCircusFn = ( try { returnedValue = fn.call(testContext); } catch (error) { - return reject(error); + reject(error); + return; } } @@ -205,23 +234,25 @@ export const callAsyncCircusFn = ( returnedValue !== null && typeof returnedValue.then === 'function' ) { - return returnedValue.then(resolve, reject); + returnedValue.then(resolve, reject); + return; } - if (!isHook && returnedValue !== void 0) { - return reject( + if (!isHook && returnedValue !== undefined) { + reject( new Error( - ` + dedent` test functions can only return Promise or undefined. - Returned value: ${String(returnedValue)} + Returned value: ${prettyFormat(returnedValue, {maxDepth: 3})} `, ), ); + return; } // Otherwise this test is synchronous, and if it didn't throw it means // it passed. - return resolve(); + resolve(); }) .then(() => { completed = true; @@ -255,48 +286,57 @@ const makeTestResults = ( describeBlock: Circus.DescribeBlock, ): Circus.TestResults => { const {includeTestLocationInResult} = getState(); - let testResults: Circus.TestResults = []; - for (const test of describeBlock.tests) { - const testPath = []; - let parent: Circus.TestEntry | Circus.DescribeBlock | undefined = test; - do { - testPath.unshift(parent.name); - } while ((parent = parent.parent)); - - const {status} = test; - - if (!status) { - throw new Error('Status should be present after tests are run.'); - } - - let location = null; - if (includeTestLocationInResult) { - const stackLine = test.asyncError.stack.split('\n')[1]; - const parsedLine = stackUtils.parseLine(stackLine); - if ( - parsedLine && - typeof parsedLine.column === 'number' && - typeof parsedLine.line === 'number' - ) { - location = { - column: parsedLine.column, - line: parsedLine.line, - }; + const testResults: Circus.TestResults = []; + for (const child of describeBlock.children) { + switch (child.type) { + case 'describeBlock': { + testResults.push(...makeTestResults(child)); + break; } + case 'test': + { + const testPath = []; + let parent: + | Circus.TestEntry + | Circus.DescribeBlock + | undefined = child; + do { + testPath.unshift(parent.name); + } while ((parent = parent.parent)); + + const {status} = child; + + if (!status) { + throw new Error('Status should be present after tests are run.'); + } + + let location = null; + if (includeTestLocationInResult) { + const stackLine = child.asyncError.stack.split('\n')[1]; + const parsedLine = stackUtils.parseLine(stackLine); + if ( + parsedLine && + typeof parsedLine.column === 'number' && + typeof parsedLine.line === 'number' + ) { + location = { + column: parsedLine.column, + line: parsedLine.line, + }; + } + } + + testResults.push({ + duration: child.duration, + errors: child.errors.map(_formatError), + invocations: child.invocations, + location, + status, + testPath, + }); + } + break; } - - testResults.push({ - duration: test.duration, - errors: test.errors.map(_formatError), - invocations: test.invocations, - location, - status, - testPath, - }); - } - - for (const child of describeBlock.children) { - testResults = testResults.concat(makeTestResults(child)); } return testResults; @@ -348,12 +388,15 @@ export const addErrorToEachTestUnderDescribe = ( error: Circus.Exception, asyncError: Circus.Exception, ): void => { - for (const test of describeBlock.tests) { - test.errors.push([error, asyncError]); - } - for (const child of describeBlock.children) { - addErrorToEachTestUnderDescribe(child, error, asyncError); + switch (child.type) { + case 'describeBlock': + addErrorToEachTestUnderDescribe(child, error, asyncError); + break; + case 'test': + child.errors.push([error, asyncError]); + break; + } } }; diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index f556af3d0144..e66d72814cab 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -1,34 +1,28 @@ { "name": "jest-cli", "description": "Delightful JavaScript Testing.", - "version": "25.4.0", + "version": "26.0.1", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/core": "^25.4.0", - "@jest/test-result": "^25.4.0", - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", + "@jest/core": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", "exit": "^0.1.2", + "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^25.4.0", - "jest-util": "^25.4.0", - "jest-validate": "^25.4.0", + "jest-config": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", "prompts": "^2.0.1", - "realpath-native": "^2.0.0", "yargs": "^15.3.1" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "@types/exit": "^0.1.30", + "@types/graceful-fs": "^4.1.3", "@types/is-ci": "^2.0.0", "@types/prompts": "^2.0.1", "@types/yargs": "^15.0.0" @@ -37,7 +31,7 @@ "jest": "./bin/jest.js" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "repository": { "type": "git", diff --git a/packages/jest-cli/src/__tests__/cli/args.test.ts b/packages/jest-cli/src/__tests__/cli/args.test.ts index 8e732954b771..6a3808f704c0 100644 --- a/packages/jest-cli/src/__tests__/cli/args.test.ts +++ b/packages/jest-cli/src/__tests__/cli/args.test.ts @@ -72,6 +72,13 @@ describe('check', () => { }, ); + it('raises an exception if selectProjects is not provided any project names', () => { + const argv: Config.Argv = {selectProjects: []} as Config.Argv; + expect(() => check(argv)).toThrow( + 'The --selectProjects option requires the name of at least one project to be specified.\n', + ); + }); + it('raises an exception if config is not a valid JSON string', () => { const argv = {config: 'x:1'} as Config.Argv; expect(() => check(argv)).toThrow( @@ -94,11 +101,11 @@ describe('check', () => { describe('buildArgv', () => { it('should return only camelcased args ', () => { - // @ts-ignore + // @ts-expect-error const mockProcessArgv = jest .spyOn(process.argv, 'slice') .mockImplementation(() => ['--clear-mocks']); - // @ts-ignore + // @ts-expect-error const actual = buildArgv(null); expect(actual).not.toHaveProperty('clear-mocks'); expect(actual).toHaveProperty('clearMocks', true); diff --git a/packages/jest-cli/src/cli/args.ts b/packages/jest-cli/src/cli/args.ts index b368e8a5830d..f7018d51ab10 100644 --- a/packages/jest-cli/src/cli/args.ts +++ b/packages/jest-cli/src/cli/args.ts @@ -49,6 +49,13 @@ export function check(argv: Config.Argv): true { ); } + if (argv.selectProjects && argv.selectProjects.length === 0) { + throw new Error( + 'The --selectProjects option requires the name of at least one project to be specified.\n' + + 'Example usage: jest --selectProjects my-first-project my-second-project', + ); + } + if ( argv.config && !isJSONString(argv.config) && @@ -528,6 +535,13 @@ export const options = { "Allows to use a custom runner instead of Jest's default test runner.", type: 'string', }, + selectProjects: { + description: + 'Run only the tests of the specified projects.' + + 'Jest uses the attribute `displayName` in the configuration to identify each project.', + string: true, + type: 'array', + }, setupFiles: { description: 'A list of paths to modules that run some code to configure or ' + diff --git a/packages/jest-cli/src/cli/index.ts b/packages/jest-cli/src/cli/index.ts index 06fb3bf4d31a..41d3302c7e0c 100644 --- a/packages/jest-cli/src/cli/index.ts +++ b/packages/jest-cli/src/cli/index.ts @@ -8,14 +8,13 @@ import * as path from 'path'; import type {Config} from '@jest/types'; import type {AggregatedResult} from '@jest/test-result'; -import {clearLine} from 'jest-util'; +import {clearLine, tryRealpath} from 'jest-util'; import {validateCLIOptions} from 'jest-validate'; import {deprecationEntries} from 'jest-config'; import {getVersion, runCLI} from '@jest/core'; import chalk = require('chalk'); import exit = require('exit'); import yargs = require('yargs'); -import {sync as realpath} from 'realpath-native'; import init from '../init'; import * as args from './args'; @@ -97,7 +96,7 @@ const getProjectListFromCLIArgs = ( if (!projects.length && process.platform === 'win32') { try { - projects.push(realpath(process.cwd())); + projects.push(tryRealpath(process.cwd())); } catch (err) { // do nothing, just catch error // process.binding('fs').realpath can throw, e.g. on mapped drives diff --git a/packages/jest-cli/src/init/__tests__/__snapshots__/init.test.js.snap b/packages/jest-cli/src/init/__tests__/__snapshots__/init.test.js.snap index a9eb4ea43840..5e4733fabd9d 100644 --- a/packages/jest-cli/src/init/__tests__/__snapshots__/init.test.js.snap +++ b/packages/jest-cli/src/init/__tests__/__snapshots__/init.test.js.snap @@ -56,9 +56,6 @@ module.exports = { // Stop running tests after \`n\` failures // bail: 0, - // Respect \\"browser\\" field in package.json when resolving modules - // browser: false, - // The directory where Jest should store its cached dependency information // cacheDirectory: \\"/tmp/jest\\", diff --git a/packages/jest-cli/src/init/__tests__/init.test.js b/packages/jest-cli/src/init/__tests__/init.test.js index 874a6d958c75..579ab04f24fc 100644 --- a/packages/jest-cli/src/init/__tests__/init.test.js +++ b/packages/jest-cli/src/init/__tests__/init.test.js @@ -6,8 +6,8 @@ */ /* eslint-disable no-eval */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import prompts from 'prompts'; import {constants} from 'jest-config'; import init from '../'; @@ -19,7 +19,7 @@ jest.mock('../../../../jest-config/build/getCacheDirectory', () => () => '/tmp/jest', ); jest.mock('path', () => ({...jest.requireActual('path'), sep: '/'})); -jest.mock('fs', () => ({ +jest.mock('graceful-fs', () => ({ ...jest.requireActual('fs'), writeFileSync: jest.fn(), })); diff --git a/packages/jest-cli/src/init/index.ts b/packages/jest-cli/src/init/index.ts index 5f732534af27..7a92a29ec0d7 100644 --- a/packages/jest-cli/src/init/index.ts +++ b/packages/jest-cli/src/init/index.ts @@ -5,12 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import chalk = require('chalk'); import prompts = require('prompts'); -import {sync as realpath} from 'realpath-native'; import {constants} from 'jest-config'; +import {tryRealpath} from 'jest-util'; import defaultQuestions, {testScriptQuestion} from './questions'; import {MalformedPackageJsonError, NotFoundPackageJsonError} from './errors'; import generateConfigFile from './generate_config_file'; @@ -35,7 +35,7 @@ type PromptsResults = { const getConfigFilename = (ext: string) => JEST_CONFIG_BASE_NAME + ext; export default async ( - rootDir: string = realpath(process.cwd()), + rootDir: string = tryRealpath(process.cwd()), ): Promise => { // prerequisite checks const projectPackageJsonPath: string = path.join(rootDir, PACKAGE_JSON); @@ -108,7 +108,7 @@ export default async ( let promptAborted: boolean = false; - // @ts-ignore: Return type cannot be object - faulty typings + // @ts-expect-error: Return type cannot be object - faulty typings const results: PromptsResults = await prompts(questions, { onCancel: () => { promptAborted = true; diff --git a/packages/jest-config/package.json b/packages/jest-config/package.json index 7cf920caf17f..93bf49c11e86 100644 --- a/packages/jest-config/package.json +++ b/packages/jest-config/package.json @@ -1,6 +1,6 @@ { "name": "jest-config", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,40 +9,34 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^25.4.0", - "@jest/types": "^25.4.0", - "babel-jest": "^25.4.0", - "chalk": "^3.0.0", + "@jest/test-sequencer": "^26.0.1", + "@jest/types": "^26.0.1", + "babel-jest": "^26.0.1", + "chalk": "^4.0.0", "deepmerge": "^4.2.2", "glob": "^7.1.1", - "jest-environment-jsdom": "^25.4.0", - "jest-environment-node": "^25.4.0", - "jest-get-type": "^25.2.6", - "jest-jasmine2": "^25.4.0", - "jest-regex-util": "^25.2.6", - "jest-resolve": "^25.4.0", - "jest-util": "^25.4.0", - "jest-validate": "^25.4.0", + "graceful-fs": "^4.2.4", + "jest-environment-jsdom": "^26.0.1", + "jest-environment-node": "^26.0.1", + "jest-get-type": "^26.0.0", + "jest-jasmine2": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", "micromatch": "^4.0.2", - "pretty-format": "^25.4.0", - "realpath-native": "^2.0.0" + "pretty-format": "^26.0.1" }, "devDependencies": { "@types/babel__core": "^7.0.4", "@types/glob": "^7.1.1", + "@types/graceful-fs": "^4.1.3", "@types/micromatch": "^4.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-config/src/Defaults.ts b/packages/jest-config/src/Defaults.ts index 6cdc3cbe8a01..f10ec309c835 100644 --- a/packages/jest-config/src/Defaults.ts +++ b/packages/jest-config/src/Defaults.ts @@ -15,7 +15,6 @@ const NODE_MODULES_REGEXP = replacePathSepForRegex(NODE_MODULES); const defaultOptions: Config.DefaultOptions = { automock: false, bail: 0, - browser: false, cache: true, cacheDirectory: getCacheDirectory(), changedFilesWithAncestor: false, @@ -30,7 +29,6 @@ const defaultOptions: Config.DefaultOptions = { globals: {}, haste: { computeSha1: false, - providesModuleNodeModules: [], throwOnModuleCollision: false, }, maxConcurrency: 5, diff --git a/packages/jest-config/src/Deprecated.ts b/packages/jest-config/src/Deprecated.ts index a76f26229ddd..388602284c8d 100644 --- a/packages/jest-config/src/Deprecated.ts +++ b/packages/jest-config/src/Deprecated.ts @@ -11,6 +11,14 @@ import prettyFormat = require('pretty-format'); const format = (value: unknown) => prettyFormat(value, {min: true}); export default { + browser: () => ` Option ${chalk.bold( + '"browser"', + )} has been deprecated. Please install "browser-resolve" and use the "resolver" option in Jest configuration as follows: + { + ${chalk.bold('"resolver"')}: ${chalk.bold('"browser-resolve"')} + } + `, + mapCoverage: () => ` Option ${chalk.bold( '"mapCoverage"', )} has been removed, as it's no longer necessary. diff --git a/packages/jest-config/src/Descriptions.ts b/packages/jest-config/src/Descriptions.ts index 8e67339e0637..322a39af3e5b 100644 --- a/packages/jest-config/src/Descriptions.ts +++ b/packages/jest-config/src/Descriptions.ts @@ -10,7 +10,6 @@ import type {Config} from '@jest/types'; const descriptions: {[key in keyof Config.InitialOptions]: string} = { automock: 'All imported modules in your tests should be mocked automatically', bail: 'Stop running tests after `n` failures', - browser: 'Respect "browser" field in package.json when resolving modules', cacheDirectory: 'The directory where Jest should store its cached dependency information', clearMocks: 'Automatically clear mock calls and instances between every test', diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index de566c08c036..4fa4022acc8c 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -15,7 +15,6 @@ const NODE_MODULES_REGEXP = replacePathSepForRegex(NODE_MODULES); const initialOptions: Config.InitialOptions = { automock: false, bail: multipleValidOptions(false, 0), - browser: false, cache: true, cacheDirectory: '/tmp/user/jest', changedFilesWithAncestor: false, @@ -57,7 +56,6 @@ const initialOptions: Config.InitialOptions = { defaultPlatform: 'ios', hasteImplModulePath: '/haste_impl.js', platforms: ['ios', 'android'], - providesModuleNodeModules: ['react', 'react-native'], throwOnModuleCollision: false, }, json: false, diff --git a/packages/jest-config/src/__mocks__/fs.js b/packages/jest-config/src/__mocks__/fs.js index c754fb89e64c..c4324a7869df 100644 --- a/packages/jest-config/src/__mocks__/fs.js +++ b/packages/jest-config/src/__mocks__/fs.js @@ -7,7 +7,7 @@ 'use strict'; -const fs = jest.genMockFromModule('fs'); +const fs = jest.createMockFromModule('fs'); const mockFiles = new Map(); function __setMockFiles(newMockFiles) { diff --git a/packages/jest-config/src/__mocks__/os.js b/packages/jest-config/src/__mocks__/os.js index 3d2c361f318b..a17b60dc17e7 100644 --- a/packages/jest-config/src/__mocks__/os.js +++ b/packages/jest-config/src/__mocks__/os.js @@ -7,7 +7,7 @@ 'use strict'; -const os = jest.genMockFromModule('os'); +const os = jest.createMockFromModule('os'); let cpus; function __setCpus(newCpus) { diff --git a/packages/jest-config/src/__tests__/Defaults.test.ts b/packages/jest-config/src/__tests__/Defaults.test.ts index 739ca8ee771e..31eda54e2efe 100644 --- a/packages/jest-config/src/__tests__/Defaults.test.ts +++ b/packages/jest-config/src/__tests__/Defaults.test.ts @@ -7,8 +7,6 @@ import {defaults} from '../index'; -jest.mock('../importEsm', () => (s: string) => import(s)); - test('get configuration defaults', () => { expect(defaults).toBeDefined(); }); diff --git a/packages/jest-config/src/__tests__/getMaxWorkers.test.ts b/packages/jest-config/src/__tests__/getMaxWorkers.test.ts index 443db5ec141b..9710ad4e87ae 100644 --- a/packages/jest-config/src/__tests__/getMaxWorkers.test.ts +++ b/packages/jest-config/src/__tests__/getMaxWorkers.test.ts @@ -39,19 +39,19 @@ describe('getMaxWorkers', () => { describe('% based', () => { it('50% = 2 workers', () => { const argv = {maxWorkers: '50%'}; - // @ts-ignore: need to fix the typing + // @ts-expect-error: need to fix the typing expect(getMaxWorkers(argv)).toBe(2); }); it('< 0 workers should become 1', () => { const argv = {maxWorkers: '1%'}; - // @ts-ignore: need to fix the typing + // @ts-expect-error: need to fix the typing expect(getMaxWorkers(argv)).toBe(1); }); it("0% shouldn't break", () => { const argv = {maxWorkers: '0%'}; - // @ts-ignore: need to fix the typing + // @ts-expect-error: need to fix the typing expect(getMaxWorkers(argv)).toBe(1); }); }); diff --git a/packages/jest-config/src/__tests__/normalize.test.js b/packages/jest-config/src/__tests__/normalize.test.js index ee4a6658f112..eb7ba42ad4a5 100644 --- a/packages/jest-config/src/__tests__/normalize.test.js +++ b/packages/jest-config/src/__tests__/normalize.test.js @@ -19,7 +19,7 @@ const DEFAULT_CSS_PATTERN = '^.+\\.(css)$'; jest .mock('jest-resolve') .mock('path', () => jest.requireActual('path').posix) - .mock('fs', () => { + .mock('graceful-fs', () => { const realFs = jest.requireActual('fs'); return { @@ -154,20 +154,6 @@ describe('automock', () => { }); }); -describe('browser', () => { - it('falsy browser is not overwritten', () => { - const {options} = normalize( - { - browser: true, - rootDir: '/root/path/foo', - }, - {}, - ); - - expect(options.browser).toBe(true); - }); -}); - describe('collectCoverageOnlyFrom', () => { it('normalizes all paths relative to rootDir', () => { const {options} = normalize( diff --git a/packages/jest-config/src/__tests__/readConfig.test.ts b/packages/jest-config/src/__tests__/readConfig.test.ts index d3583b82ed6c..1452e8355171 100644 --- a/packages/jest-config/src/__tests__/readConfig.test.ts +++ b/packages/jest-config/src/__tests__/readConfig.test.ts @@ -7,12 +7,10 @@ import {readConfig} from '../index'; -jest.mock('../importEsm', () => (s: string) => import(s)); - test('readConfig() throws when an object is passed without a file path', async () => { await expect( readConfig( - // @ts-ignore + // @ts-expect-error null /* argv */, {} /* packageRootOrConfig */, false /* skipArgvConfigOption */, diff --git a/packages/jest-config/src/__tests__/readConfigs.test.ts b/packages/jest-config/src/__tests__/readConfigs.test.ts index 29b3497b4885..25fc0e33c5a8 100644 --- a/packages/jest-config/src/__tests__/readConfigs.test.ts +++ b/packages/jest-config/src/__tests__/readConfigs.test.ts @@ -4,14 +4,50 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ - +import {Config} from '@jest/types'; import {readConfigs} from '../index'; -jest.mock('../importEsm', () => (s: string) => import(s)); +let mockResult; +jest.mock('graceful-fs', () => ({ + ...jest.requireActual('fs'), + existsSync: jest.fn(() => true), + lstatSync: jest.fn(() => ({ + isDirectory: () => false, + })), +})); +jest.mock('../readConfigFileAndSetRootDir', () => jest.fn(() => mockResult)); test('readConfigs() throws when called without project paths', async () => { await expect( - // @ts-ignore + // @ts-expect-error readConfigs(null /* argv */, [] /* projectPaths */), ).rejects.toThrowError('jest: No configuration found for any project.'); }); + +test('readConfigs() loads async config file', async () => { + mockResult = jest.fn(async () => ({ + rootDir: './', + })); + await expect( + // @ts-expect-error + readConfigs( + {} /* argv */, + ['./some-jest-config-file.js'] /* projectPaths */, + ), + ).resolves.toHaveProperty('configs'); + expect(mockResult).toHaveBeenCalled(); +}); + +test('readConfigs() reject if async was rejected', async () => { + mockResult = jest.fn(async () => { + throw new Error('Some error'); + }); + await expect( + // @ts-expect-error + readConfigs( + {} /* argv */, + ['./some-jest-config-file.js'] /* projectPaths */, + ), + ).rejects.toBeTruthy(); + expect(mockResult).toHaveBeenCalled(); +}); diff --git a/packages/jest-config/src/getCacheDirectory.ts b/packages/jest-config/src/getCacheDirectory.ts index 2871d1e5eaab..c23a08870a26 100644 --- a/packages/jest-config/src/getCacheDirectory.ts +++ b/packages/jest-config/src/getCacheDirectory.ts @@ -7,11 +7,12 @@ import * as path from 'path'; import {tmpdir} from 'os'; -import {sync as realpath} from 'realpath-native'; +import type {Config} from '@jest/types'; +import {tryRealpath} from 'jest-util'; -const getCacheDirectory = () => { +const getCacheDirectory: () => Config.Path = () => { const {getuid} = process; - const tmpdirPath = path.join(realpath(tmpdir()), 'jest'); + const tmpdirPath = path.join(tryRealpath(tmpdir()), 'jest'); if (getuid == null) { return tmpdirPath; } else { diff --git a/packages/jest-config/src/importEsm.ts b/packages/jest-config/src/importEsm.ts deleted file mode 100644 index 85d82fa10dd2..000000000000 --- a/packages/jest-config/src/importEsm.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import {pathToFileURL} from 'url'; - -// this is in a separate file so that node 8 don't explode with a syntax error. -// Remove this file when we drop support for Node 8 -export default (specifier: string): Promise<{default: unknown}> => - // node `import()` supports URL, but TypeScript doesn't know that - import(pathToFileURL(specifier).href); diff --git a/packages/jest-config/src/index.ts b/packages/jest-config/src/index.ts index 85b6e34546d8..de88d4423cf8 100644 --- a/packages/jest-config/src/index.ts +++ b/packages/jest-config/src/index.ts @@ -5,11 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; +import {tryRealpath} from 'jest-util'; import chalk = require('chalk'); -import {sync as realpath} from 'realpath-native'; import {isJSONString, replaceRootDirInPath} from './utils'; import normalize from './normalize'; import resolveConfigPath from './resolveConfigPath'; @@ -41,7 +41,9 @@ export async function readConfig( parentConfigPath?: Config.Path | null, projectIndex: number = Infinity, ): Promise { - let rawOptions; + let rawOptions: + | Config.InitialOptions + | (() => Config.InitialOptions | Promise); let configPath = null; if (typeof packageRootOrConfig !== 'string') { @@ -82,6 +84,10 @@ export async function readConfig( rawOptions = await readConfigFileAndSetRootDir(configPath); } + if (typeof rawOptions === 'function') { + rawOptions = await rawOptions(); + } + const {options, hasDeprecationWarnings} = normalize( rawOptions, argv, @@ -163,7 +169,6 @@ const groupOptions = ( }), projectConfig: Object.freeze({ automock: options.automock, - browser: options.browser, cache: options.cache, cacheDirectory: options.cacheDirectory, clearMocks: options.clearMocks, @@ -296,7 +301,7 @@ export async function readConfigs( if (projects.length > 0) { const projectIsCwd = process.platform === 'win32' - ? projects[0] === realpath(process.cwd()) + ? projects[0] === tryRealpath(process.cwd()) : projects[0] === process.cwd(); const parsedConfigs = await Promise.all( diff --git a/packages/jest-config/src/normalize.ts b/packages/jest-config/src/normalize.ts index fb56b9864e26..9f6f35062759 100644 --- a/packages/jest-config/src/normalize.ts +++ b/packages/jest-config/src/normalize.ts @@ -6,15 +6,14 @@ */ import {createHash} from 'crypto'; -import {statSync} from 'fs'; import * as path from 'path'; +import {statSync} from 'graceful-fs'; import {sync as glob} from 'glob'; import type {Config} from '@jest/types'; import {ValidationError, validate} from 'jest-validate'; -import {clearLine, replacePathSepForGlob} from 'jest-util'; +import {clearLine, replacePathSepForGlob, tryRealpath} from 'jest-util'; import chalk = require('chalk'); import micromatch = require('micromatch'); -import {sync as realpath} from 'realpath-native'; import Resolver = require('jest-resolve'); import {replacePathSepForRegex} from 'jest-regex-util'; import merge = require('deepmerge'); @@ -141,7 +140,7 @@ const setupPreset = ( } } catch (e) {} - // @ts-ignore: `presetModule` can be null? + // @ts-expect-error: `presetModule` can be null? preset = require(presetModule); } catch (error) { if (error instanceof SyntaxError || error instanceof TypeError) { @@ -391,7 +390,7 @@ const normalizeRootDir = ( try { // try to resolve windows short paths, ignoring errors (permission errors, mostly) - options.rootDir = realpath(options.rootDir); + options.rootDir = tryRealpath(options.rootDir); } catch (e) { // ignored } @@ -869,7 +868,6 @@ export default function normalize( break; } case 'automock': - case 'browser': case 'cache': case 'changedSince': case 'changedFilesWithAncestor': @@ -945,7 +943,7 @@ export default function normalize( }); break; } - // @ts-ignore: automock is missing in GlobalConfig, so what + // @ts-expect-error: automock is missing in GlobalConfig, so what newOptions[key] = value; return newOptions; }, newOptions); @@ -956,7 +954,7 @@ export default function normalize( try { // try to resolve windows short paths, ignoring errors (permission errors, mostly) - newOptions.cwd = realpath(process.cwd()); + newOptions.cwd = tryRealpath(process.cwd()); } catch (e) { // ignored } diff --git a/packages/jest-config/src/readConfigFileAndSetRootDir.ts b/packages/jest-config/src/readConfigFileAndSetRootDir.ts index 867c553b3019..06cbaecc10d6 100644 --- a/packages/jest-config/src/readConfigFileAndSetRootDir.ts +++ b/packages/jest-config/src/readConfigFileAndSetRootDir.ts @@ -6,12 +6,12 @@ */ import * as path from 'path'; -import * as fs from 'fs'; +import {pathToFileURL} from 'url'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; -// @ts-ignore: vendored +// @ts-expect-error: vendored import jsonlint from './vendor/jsonlint'; import {JEST_CONFIG_EXT_JSON, PACKAGE_JSON} from './constants'; -import importEsm from './importEsm'; // Read the configuration and set its `rootDir` // 1. If it's a `package.json` file, we look into its "jest" property @@ -28,7 +28,10 @@ export default async function readConfigFileAndSetRootDir( } catch (error) { if (error.code === 'ERR_REQUIRE_ESM') { try { - const importedConfig = await importEsm(configPath); + const configUrl = pathToFileURL(configPath); + + // node `import()` supports URL, but TypeScript doesn't know that + const importedConfig = await import(configUrl.href); if (!importedConfig.default) { throw new Error( diff --git a/packages/jest-config/src/resolveConfigPath.ts b/packages/jest-config/src/resolveConfigPath.ts index 52eed9a07e5c..dc8655513858 100644 --- a/packages/jest-config/src/resolveConfigPath.ts +++ b/packages/jest-config/src/resolveConfigPath.ts @@ -6,7 +6,7 @@ */ import * as path from 'path'; -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import { JEST_CONFIG_BASE_NAME, diff --git a/packages/jest-console/package.json b/packages/jest-console/package.json index ba663dc366ca..2b216fdeeb36 100644 --- a/packages/jest-console/package.json +++ b/packages/jest-console/package.json @@ -1,6 +1,6 @@ { "name": "@jest/console", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,25 +9,18 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", - "jest-message-util": "^25.4.0", - "jest-util": "^25.4.0", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "jest-message-util": "^26.0.1", + "jest-util": "^26.0.1", "slash": "^3.0.0" }, "devDependencies": { "@types/node": "*" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-console/src/BufferedConsole.ts b/packages/jest-console/src/BufferedConsole.ts index 2bf53f350f72..6cf73e4d01a9 100644 --- a/packages/jest-console/src/BufferedConsole.ts +++ b/packages/jest-console/src/BufferedConsole.ts @@ -9,7 +9,7 @@ import assert = require('assert'); import {Console} from 'console'; import {format} from 'util'; import chalk = require('chalk'); -import {ErrorWithStack} from 'jest-util'; +import {ErrorWithStack, formatTime} from 'jest-util'; import type { ConsoleBuffer, LogCounters, @@ -154,7 +154,7 @@ export default class BufferedConsole extends Console { if (startTime) { const endTime = new Date(); const time = endTime.getTime() - startTime.getTime(); - this._log('time', format(`${label}: ${time}ms`)); + this._log('time', format(`${label}: ${formatTime(time)}`)); delete this._timers[label]; } } diff --git a/packages/jest-console/src/CustomConsole.ts b/packages/jest-console/src/CustomConsole.ts index 1bd27f3ac923..eecaa706720a 100644 --- a/packages/jest-console/src/CustomConsole.ts +++ b/packages/jest-console/src/CustomConsole.ts @@ -9,7 +9,7 @@ import assert = require('assert'); import {format} from 'util'; import {Console} from 'console'; import chalk = require('chalk'); -import {clearLine} from 'jest-util'; +import {clearLine, formatTime} from 'jest-util'; import type {LogCounters, LogMessage, LogTimers, LogType} from './types'; type Formatter = (type: LogType, message: LogMessage) => string; @@ -51,8 +51,7 @@ export default class CustomConsole extends Console { ); } - // use `asserts` when https://github.com/sandersn/downlevel-dts/issues/32 is fixed - assert(value: unknown, message?: string | Error): void { + assert(value: unknown, message?: string | Error): asserts value { try { assert(value, message); } catch (error) { @@ -132,7 +131,7 @@ export default class CustomConsole extends Console { if (startTime) { const endTime = new Date().getTime(); const time = endTime - startTime.getTime(); - this._log('time', format(`${label}: ${time}ms`)); + this._log('time', format(`${label}: ${formatTime(time)}`)); delete this._timers[label]; } } diff --git a/packages/jest-core/package.json b/packages/jest-core/package.json index 19a6c5d804b8..1b0e15b4b1ac 100644 --- a/packages/jest-core/package.json +++ b/packages/jest-core/package.json @@ -1,48 +1,40 @@ { "name": "@jest/core", "description": "Delightful JavaScript Testing.", - "version": "25.4.0", + "version": "26.0.1", "main": "build/jest.js", "types": "build/jest.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/console": "^25.4.0", - "@jest/reporters": "^25.4.0", - "@jest/test-result": "^25.4.0", - "@jest/transform": "^25.4.0", - "@jest/types": "^25.4.0", + "@jest/console": "^26.0.1", + "@jest/reporters": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", "ansi-escapes": "^4.2.1", - "chalk": "^3.0.0", + "chalk": "^4.0.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.3", - "jest-changed-files": "^25.4.0", - "jest-config": "^25.4.0", - "jest-haste-map": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-regex-util": "^25.2.6", - "jest-resolve": "^25.4.0", - "jest-resolve-dependencies": "^25.4.0", - "jest-runner": "^25.4.0", - "jest-runtime": "^25.4.0", - "jest-snapshot": "^25.4.0", - "jest-util": "^25.4.0", - "jest-validate": "^25.4.0", - "jest-watcher": "^25.4.0", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^26.0.1", + "jest-config": "^26.0.1", + "jest-haste-map": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.0.1", + "jest-resolve-dependencies": "^26.0.1", + "jest-runner": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", + "jest-watcher": "^26.0.1", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", - "realpath-native": "^2.0.0", "rimraf": "^3.0.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, "devDependencies": { - "@jest/test-sequencer": "^25.4.0", + "@jest/test-sequencer": "^26.0.1", "@types/exit": "^0.1.30", "@types/graceful-fs": "^4.1.2", "@types/micromatch": "^4.0.0", @@ -51,7 +43,7 @@ "jest-snapshot-serializer-raw": "^1.1.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "repository": { "type": "git", diff --git a/packages/jest-core/src/__tests__/SearchSource.test.ts b/packages/jest-core/src/__tests__/SearchSource.test.ts index 0a6815062c85..fbc4513ef1f6 100644 --- a/packages/jest-core/src/__tests__/SearchSource.test.ts +++ b/packages/jest-core/src/__tests__/SearchSource.test.ts @@ -15,7 +15,7 @@ import SearchSource, {SearchResult} from '../SearchSource'; jest.setTimeout(15000); -jest.mock('fs', () => { +jest.mock('graceful-fs', () => { const realFs = jest.requireActual('fs'); return { @@ -401,7 +401,6 @@ describe('SearchSource', () => { '__tests__', 'haste_impl.js', ), - providesModuleNodeModules: [], }, name: 'SearchSource-findRelatedTests-tests', rootDir, @@ -546,7 +545,6 @@ describe('SearchSource', () => { __dirname, '../../../jest-haste-map/src/__tests__/haste_impl.js', ), - providesModuleNodeModules: [], }, name: 'SearchSource-findRelatedSourcesFromTestsInChangedFiles-tests', rootDir, diff --git a/packages/jest-core/src/__tests__/watch-file-changes.test.ts b/packages/jest-core/src/__tests__/watch-file-changes.test.ts index be0f3c97760c..17ed2fc5c370 100644 --- a/packages/jest-core/src/__tests__/watch-file-changes.test.ts +++ b/packages/jest-core/src/__tests__/watch-file-changes.test.ts @@ -7,8 +7,8 @@ */ import * as path from 'path'; -import * as fs from 'fs'; import {tmpdir} from 'os'; +import * as fs from 'graceful-fs'; import {JestHook} from 'jest-watcher'; import Runtime = require('jest-runtime'); import {normalize} from 'jest-config'; diff --git a/packages/jest-core/src/cli/index.ts b/packages/jest-core/src/cli/index.ts index 9faffd0dcc15..a1082d079f1c 100644 --- a/packages/jest-core/src/cli/index.ts +++ b/packages/jest-core/src/cli/index.ts @@ -26,6 +26,9 @@ import TestWatcher from '../TestWatcher'; import watch from '../watch'; import pluralize from '../pluralize'; import logDebugMessages from '../lib/log_debug_messages'; +import getConfigsOfProjectsToRun from '../getConfigsOfProjectsToRun'; +import getProjectNamesMissingWarning from '../getProjectNamesMissingWarning'; +import getSelectProjectsMessage from '../getSelectProjectsMessage'; const {print: preRunMessagePrint} = preRunMessage; @@ -38,10 +41,6 @@ export async function runCLI( results: AggregatedResult; globalConfig: Config.GlobalConfig; }> { - const realFs = require('fs'); - const fs = require('graceful-fs'); - fs.gracefulify(realFs); - let results: AggregatedResult | undefined; // If we output a JSON object, we can't write anything to stdout, since @@ -72,9 +71,22 @@ export async function runCLI( exit(0); } - await _run( + let configsOfProjectsToRun = configs; + if (argv.selectProjects) { + const namesMissingWarning = getProjectNamesMissingWarning(configs); + if (namesMissingWarning) { + outputStream.write(namesMissingWarning); + } + configsOfProjectsToRun = getConfigsOfProjectsToRun( + argv.selectProjects, + configs, + ); + outputStream.write(getSelectProjectsMessage(configsOfProjectsToRun)); + } + + await _run10000( globalConfig, - configs, + configsOfProjectsToRun, hasDeprecationWarnings, outputStream, r => (results = r), @@ -138,7 +150,7 @@ const buildContextsAndHasteMaps = async ( return {contexts, hasteMapInstances}; }; -const _run = async ( +const _run10000 = async ( globalConfig: Config.GlobalConfig, configs: Array, hasDeprecationWarnings: boolean, diff --git a/packages/jest-core/src/getConfigsOfProjectsToRun.ts b/packages/jest-core/src/getConfigsOfProjectsToRun.ts new file mode 100644 index 000000000000..b8b8288ccc68 --- /dev/null +++ b/packages/jest-core/src/getConfigsOfProjectsToRun.ts @@ -0,0 +1,20 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {Config} from '@jest/types'; +import getProjectDisplayName from './getProjectDisplayName'; + +export default function getConfigsOfProjectsToRun( + namesOfProjectsToRun: Array, + projectConfigs: Array, +): Array { + const setOfProjectsToRun = new Set(namesOfProjectsToRun); + return projectConfigs.filter(config => { + const name = getProjectDisplayName(config); + return name && setOfProjectsToRun.has(name); + }); +} diff --git a/packages/jest-core/src/getProjectDisplayName.ts b/packages/jest-core/src/getProjectDisplayName.ts new file mode 100644 index 000000000000..d9e8271c622a --- /dev/null +++ b/packages/jest-core/src/getProjectDisplayName.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {Config} from '@jest/types'; + +export default function getProjectDisplayName( + projectConfig: Config.ProjectConfig, +): string | undefined { + const {displayName} = projectConfig; + if (!displayName) { + return undefined; + } + return displayName.name; +} diff --git a/packages/jest-core/src/getProjectNamesMissingWarning.ts b/packages/jest-core/src/getProjectNamesMissingWarning.ts new file mode 100644 index 000000000000..53f0543d1cc8 --- /dev/null +++ b/packages/jest-core/src/getProjectNamesMissingWarning.ts @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import chalk = require('chalk'); +import type {Config} from '@jest/types'; +import getProjectDisplayName from './getProjectDisplayName'; + +export default function getProjectNamesMissingWarning( + projectConfigs: Array, +): string | undefined { + const numberOfProjectsWithoutAName = projectConfigs.filter( + config => !getProjectDisplayName(config), + ).length; + if (numberOfProjectsWithoutAName === 0) { + return undefined; + } + return chalk.yellow( + `You provided values for --selectProjects but ${ + numberOfProjectsWithoutAName === 1 + ? 'a project does not have a name' + : `${numberOfProjectsWithoutAName} projects do not have a name` + }.\n` + + 'Set displayName in the config of all projects in order to disable this warning.\n', + ); +} diff --git a/packages/jest-core/src/getSelectProjectsMessage.ts b/packages/jest-core/src/getSelectProjectsMessage.ts new file mode 100644 index 000000000000..5d3fff3577b4 --- /dev/null +++ b/packages/jest-core/src/getSelectProjectsMessage.ts @@ -0,0 +1,47 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import chalk = require('chalk'); +import type {Config} from '@jest/types'; +import getProjectDisplayName from './getProjectDisplayName'; + +export default function getSelectProjectsMessage( + projectConfigs: Array, +): string { + if (projectConfigs.length === 0) { + return getNoSelectionWarning(); + } + return getProjectsRunningMessage(projectConfigs); +} + +function getNoSelectionWarning(): string { + return chalk.yellow( + 'You provided values for --selectProjects but no projects were found matching the selection.\n', + ); +} + +function getProjectsRunningMessage( + projectConfigs: Array, +): string { + if (projectConfigs.length === 1) { + const name = getProjectDisplayName(projectConfigs[0]); + return `Running one project: ${chalk.bold(name)}\n`; + } + const projectsList = projectConfigs + .map(getProjectNameListElement) + .sort() + .join('\n'); + return `Running ${projectConfigs.length} projects:\n${projectsList}\n`; +} + +function getProjectNameListElement( + projectConfig: Config.ProjectConfig, +): string { + const name = getProjectDisplayName(projectConfig); + const elementContent = name ? chalk.bold(name) : ''; + return `- ${elementContent}`; +} diff --git a/packages/jest-core/src/lib/__tests__/__snapshots__/log_debug_messages.test.ts.snap b/packages/jest-core/src/lib/__tests__/__snapshots__/log_debug_messages.test.ts.snap index 3be6c4ebb716..0d7a420000ea 100644 --- a/packages/jest-core/src/lib/__tests__/__snapshots__/log_debug_messages.test.ts.snap +++ b/packages/jest-core/src/lib/__tests__/__snapshots__/log_debug_messages.test.ts.snap @@ -4,7 +4,6 @@ exports[`prints the config object 1`] = ` { "configs": { "automock": false, - "browser": false, "cache": false, "cacheDirectory": "/test_cache_dir/", "clearMocks": false, @@ -14,14 +13,9 @@ exports[`prints the config object 1`] = ` "detectOpenHandles": false, "errorOnDeprecated": false, "extraGlobals": [], - "filter": null, "forceCoverageMatch": [], - "globalSetup": null, - "globalTeardown": null, "globals": {}, - "haste": { - "providesModuleNodeModules": [] - }, + "haste": {}, "moduleDirectories": [], "moduleFileExtensions": [ "js" @@ -34,7 +28,6 @@ exports[`prints the config object 1`] = ` "prettierPath": "prettier", "resetMocks": false, "resetModules": false, - "resolver": null, "restoreMocks": false, "rootDir": "/path/to/dir", "roots": [ @@ -45,7 +38,6 @@ exports[`prints the config object 1`] = ` "setupFilesAfterEnv": [], "skipFilter": false, "skipNodeResolution": false, - "snapshotResolver": null, "snapshotSerializers": [], "testEnvironment": "node", "testEnvironmentOptions": {}, @@ -60,7 +52,6 @@ exports[`prints the config object 1`] = ` "timers": "real", "transform": [], "transformIgnorePatterns": [], - "unmockedModulePathPatterns": null, "watchPathIgnorePatterns": [] }, "globalConfig": { @@ -69,7 +60,6 @@ exports[`prints the config object 1`] = ` "changedSince": "", "collectCoverage": false, "collectCoverageFrom": [], - "collectCoverageOnlyFrom": null, "coverageDirectory": "coverage", "coverageProvider": "babel", "coverageReporters": [], @@ -78,31 +68,24 @@ exports[`prints the config object 1`] = ` }, "detectLeaks": false, "detectOpenHandles": false, - "enabledTestsMap": null, "errorOnDeprecated": false, "expand": false, - "filter": null, "findRelatedTests": false, "forceExit": false, - "globalSetup": null, - "globalTeardown": null, "json": false, "lastCommit": false, "listTests": false, "logHeapUsage": false, "maxConcurrency": 5, "maxWorkers": 2, - "noSCM": null, "noStackTrace": false, "nonFlagArgs": [], "notify": false, "notifyMode": "failure-change", "onlyChanged": false, "onlyFailures": false, - "outputFile": null, "passWithNoTests": false, "projects": [], - "replname": null, "reporters": [], "rootDir": "/test_root_dir/", "runTestsByPath": false, @@ -111,7 +94,6 @@ exports[`prints the config object 1`] = ` "testFailureExitCode": 1, "testNamePattern": "", "testPathPattern": "", - "testResultsProcessor": null, "testSequencer": "@jest/test-sequencer", "testTimeout": 5000, "updateSnapshot": "none", diff --git a/packages/jest-core/src/lib/active_filters_message.ts b/packages/jest-core/src/lib/active_filters_message.ts index 9f7d40801743..7d2a29780487 100644 --- a/packages/jest-core/src/lib/active_filters_message.ts +++ b/packages/jest-core/src/lib/active_filters_message.ts @@ -11,7 +11,7 @@ import type {Config} from '@jest/types'; const activeFilters = ( globalConfig: Config.GlobalConfig, delimiter: string = '\n', -) => { +): string => { const {testNamePattern, testPathPattern} = globalConfig; if (testNamePattern || testPathPattern) { const filters = [ diff --git a/packages/jest-core/src/plugins/quit.ts b/packages/jest-core/src/plugins/quit.ts index 462de025729c..ac4c0646351e 100644 --- a/packages/jest-core/src/plugins/quit.ts +++ b/packages/jest-core/src/plugins/quit.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import {BaseWatchPlugin} from 'jest-watcher'; +import {BaseWatchPlugin, UsageData} from 'jest-watcher'; class QuitPlugin extends BaseWatchPlugin { isInternal: true; @@ -15,7 +15,7 @@ class QuitPlugin extends BaseWatchPlugin { this.isInternal = true; } - async run() { + async run(): Promise { if (typeof this._stdin.setRawMode === 'function') { this._stdin.setRawMode(false); } @@ -23,7 +23,7 @@ class QuitPlugin extends BaseWatchPlugin { process.exit(0); } - getUsageInfo() { + getUsageInfo(): UsageData { return { key: 'q', prompt: 'quit watch mode', diff --git a/packages/jest-core/src/plugins/test_name_pattern.ts b/packages/jest-core/src/plugins/test_name_pattern.ts index 5c76866ef9ff..64391e1dc18a 100644 --- a/packages/jest-core/src/plugins/test_name_pattern.ts +++ b/packages/jest-core/src/plugins/test_name_pattern.ts @@ -6,7 +6,12 @@ */ import type {Config} from '@jest/types'; -import {BaseWatchPlugin, Prompt, UpdateConfigCallback} from 'jest-watcher'; +import { + BaseWatchPlugin, + Prompt, + UpdateConfigCallback, + UsageData, +} from 'jest-watcher'; import TestNamePatternPrompt from '../TestNamePatternPrompt'; import activeFilters from '../lib/active_filters_message'; @@ -20,14 +25,14 @@ class TestNamePatternPlugin extends BaseWatchPlugin { this.isInternal = true; } - getUsageInfo() { + getUsageInfo(): UsageData { return { key: 't', prompt: 'filter by a test name regex pattern', }; } - onKey(key: string) { + onKey(key: string): void { this._prompt.put(key); } diff --git a/packages/jest-core/src/plugins/test_path_pattern.ts b/packages/jest-core/src/plugins/test_path_pattern.ts index 5abe1e1e9279..05b4e3d67c0c 100644 --- a/packages/jest-core/src/plugins/test_path_pattern.ts +++ b/packages/jest-core/src/plugins/test_path_pattern.ts @@ -6,7 +6,12 @@ */ import type {Config} from '@jest/types'; -import {BaseWatchPlugin, Prompt, UpdateConfigCallback} from 'jest-watcher'; +import { + BaseWatchPlugin, + Prompt, + UpdateConfigCallback, + UsageData, +} from 'jest-watcher'; import TestPathPatternPrompt from '../TestPathPatternPrompt'; import activeFilters from '../lib/active_filters_message'; @@ -20,14 +25,14 @@ class TestPathPatternPlugin extends BaseWatchPlugin { this.isInternal = true; } - getUsageInfo() { + getUsageInfo(): UsageData { return { key: 'p', prompt: 'filter by a filename regex pattern', }; } - onKey(key: string) { + onKey(key: string): void { this._prompt.put(key); } diff --git a/packages/jest-core/src/plugins/update_snapshots.ts b/packages/jest-core/src/plugins/update_snapshots.ts index 9c07e919018d..1a637895d500 100644 --- a/packages/jest-core/src/plugins/update_snapshots.ts +++ b/packages/jest-core/src/plugins/update_snapshots.ts @@ -10,6 +10,7 @@ import { BaseWatchPlugin, JestHookSubscriber, UpdateConfigCallback, + UsageData, } from 'jest-watcher'; class UpdateSnapshotsPlugin extends BaseWatchPlugin { @@ -30,13 +31,13 @@ class UpdateSnapshotsPlugin extends BaseWatchPlugin { return Promise.resolve(false); } - apply(hooks: JestHookSubscriber) { + apply(hooks: JestHookSubscriber): void { hooks.onTestRunComplete(results => { this._hasSnapshotFailure = results.snapshot.failure; }); } - getUsageInfo() { + getUsageInfo(): UsageData | null { if (this._hasSnapshotFailure) { return { key: 'u', diff --git a/packages/jest-core/src/plugins/update_snapshots_interactive.ts b/packages/jest-core/src/plugins/update_snapshots_interactive.ts index 31414365672d..7a73d62b27c9 100644 --- a/packages/jest-core/src/plugins/update_snapshots_interactive.ts +++ b/packages/jest-core/src/plugins/update_snapshots_interactive.ts @@ -7,7 +7,7 @@ import type {Config} from '@jest/types'; import type {AggregatedResult, AssertionLocation} from '@jest/test-result'; -import {BaseWatchPlugin, JestHookSubscriber} from 'jest-watcher'; +import {BaseWatchPlugin, JestHookSubscriber, UsageData} from 'jest-watcher'; import SnapshotInteractiveMode from '../SnapshotInteractiveMode'; class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { @@ -41,7 +41,7 @@ class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { return failedTestPaths; } - apply(hooks: JestHookSubscriber) { + apply(hooks: JestHookSubscriber): void { hooks.onTestRunComplete(results => { this._failedSnapshotTestAssertions = this.getFailedSnapshotTestAssertions( results, @@ -52,7 +52,7 @@ class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { }); } - onKey(key: string) { + onKey(key: string): void { if (this._snapshotInteractiveMode.isActive()) { this._snapshotInteractiveMode.put(key); } @@ -85,11 +85,8 @@ class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { } } - getUsageInfo() { - if ( - this._failedSnapshotTestAssertions && - this._failedSnapshotTestAssertions.length > 0 - ) { + getUsageInfo(): UsageData | null { + if (this._failedSnapshotTestAssertions?.length > 0) { return { key: 'i', prompt: 'update failing snapshots interactively', diff --git a/packages/jest-core/src/runJest.ts b/packages/jest-core/src/runJest.ts index bea930899c0d..91107ee0637c 100644 --- a/packages/jest-core/src/runJest.ts +++ b/packages/jest-core/src/runJest.ts @@ -7,9 +7,8 @@ import * as path from 'path'; import chalk = require('chalk'); -import {sync as realpath} from 'realpath-native'; import {CustomConsole} from '@jest/console'; -import {interopRequireDefault} from 'jest-util'; +import {interopRequireDefault, tryRealpath} from 'jest-util'; import exit = require('exit'); import * as fs from 'graceful-fs'; import {JestHook, JestHookEmitter} from 'jest-watcher'; @@ -100,7 +99,7 @@ const processResults = ( } if (isJSON) { if (outputFile) { - const cwd = realpath(process.cwd()); + const cwd = tryRealpath(process.cwd()); const filePath = path.resolve(cwd, outputFile); fs.writeFileSync(filePath, JSON.stringify(formatTestResults(runResults))); diff --git a/packages/jest-core/src/watch.ts b/packages/jest-core/src/watch.ts index b1f60c3878b4..77fb88417783 100644 --- a/packages/jest-core/src/watch.ts +++ b/packages/jest-core/src/watch.ts @@ -504,7 +504,7 @@ const getPluginIdentifier = (plugin: WatchPlugin) => // WatchPlugin is an interface, and it is my understanding interface // static fields are not definable anymore, no idea how to circumvent // this :-( - // @ts-ignore: leave `displayName` be. + // @ts-expect-error: leave `displayName` be. plugin.constructor.displayName || plugin.constructor.name; const getPluginKey = ( diff --git a/packages/jest-diff/package.json b/packages/jest-diff/package.json index 561942c03c01..18a3323d020c 100644 --- a/packages/jest-diff/package.json +++ b/packages/jest-diff/package.json @@ -1,6 +1,6 @@ { "name": "jest-diff", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,25 +9,18 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "chalk": "^3.0.0", - "diff-sequences": "^25.2.6", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.4.0" + "chalk": "^4.0.0", + "diff-sequences": "^26.0.0", + "jest-get-type": "^26.0.0", + "pretty-format": "^26.0.1" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "strip-ansi": "^6.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap index 6ed36e34275c..962c937514f7 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap @@ -249,9 +249,11 @@ exports[`options change color diffStringsUnified 1`] = ` - changed from + changed to + insert - common + common `; +exports[`options change color no diff 1`] = `Compared values have no visual difference.`; + exports[`options change indicators diff 1`] = ` < Expected > Received diff --git a/packages/jest-diff/src/__tests__/diff.test.ts b/packages/jest-diff/src/__tests__/diff.test.ts index 3367839b8cfe..e63d9b999b70 100644 --- a/packages/jest-diff/src/__tests__/diff.test.ts +++ b/packages/jest-diff/src/__tests__/diff.test.ts @@ -14,13 +14,12 @@ import {diffLinesUnified, diffLinesUnified2} from '../diffLines'; import {noColor} from '../normalizeDiffOptions'; import {diffStringsUnified} from '../printDiffs'; import {DiffOptions} from '../types'; +import {NO_DIFF_MESSAGE} from '../constants'; const optionsCounts: DiffOptions = { includeChangeCounts: true, }; -const NO_DIFF_MESSAGE = 'Compared values have no visual difference.'; - // Use only in toBe assertions for edge case messages. const stripped = (a: unknown, b: unknown) => stripAnsi(diff(a, b) || ''); @@ -975,6 +974,7 @@ describe('options', () => { describe('change color', () => { const options = { changeColor: chalk.bold, + commonColor: chalk.yellow, }; test('diffStringsUnified', () => { @@ -982,17 +982,25 @@ describe('options', () => { const bChanged = b.join('\n').replace('change', 'changed'); expect(diffStringsUnified(aChanged, bChanged, options)).toMatchSnapshot(); }); + + test('no diff', () => { + expect(diff(a, a, options)).toMatchSnapshot(); + }); }); describe('common', () => { const options = { - commonColor: line => line, + commonColor: noColor, commonIndicator: '=', }; test('diff', () => { expect(diff(a, b, options)).toMatchSnapshot(); }); + + test('no diff', () => { + expect(diff(a, a, options)).toBe(NO_DIFF_MESSAGE); + }); }); describe('includeChangeCounts false', () => { diff --git a/packages/jest-diff/src/constants.ts b/packages/jest-diff/src/constants.ts index c8cb4b4bc7f8..b031eacbb578 100644 --- a/packages/jest-diff/src/constants.ts +++ b/packages/jest-diff/src/constants.ts @@ -5,13 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import chalk = require('chalk'); +export const NO_DIFF_MESSAGE = 'Compared values have no visual difference.'; -export const NO_DIFF_MESSAGE = chalk.dim( - 'Compared values have no visual difference.', -); - -export const SIMILAR_MESSAGE = chalk.dim( +export const SIMILAR_MESSAGE = 'Compared values serialize to the same structure.\n' + - 'Printing internal object structure without calling `toJSON` instead.', -); + 'Printing internal object structure without calling `toJSON` instead.'; diff --git a/packages/jest-diff/src/index.ts b/packages/jest-diff/src/index.ts index 9c9b7f7be867..d8d3bb0d1dea 100644 --- a/packages/jest-diff/src/index.ts +++ b/packages/jest-diff/src/index.ts @@ -9,6 +9,7 @@ import prettyFormat = require('pretty-format'); import chalk = require('chalk'); import getType = require('jest-get-type'); import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic'; +import {normalizeDiffOptions} from './normalizeDiffOptions'; import {diffLinesRaw, diffLinesUnified, diffLinesUnified2} from './diffLines'; import {diffStringsRaw, diffStringsUnified} from './printDiffs'; import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants'; @@ -20,6 +21,11 @@ export {diffLinesRaw, diffLinesUnified, diffLinesUnified2}; export {diffStringsRaw, diffStringsUnified}; export {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff}; +const getCommonMessage = (message: string, options?: DiffOptions) => { + const {commonColor} = normalizeDiffOptions(options); + return commonColor(message); +}; + const { AsymmetricMatcher, DOMCollection, @@ -50,9 +56,10 @@ const FALLBACK_FORMAT_OPTIONS_0 = {...FALLBACK_FORMAT_OPTIONS, indent: 0}; // Generate a string that will highlight the difference between two values // with green and red. (similar to how github does code diffing) +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function diff(a: any, b: any, options?: DiffOptions): string | null { if (Object.is(a, b)) { - return NO_DIFF_MESSAGE; + return getCommonMessage(NO_DIFF_MESSAGE, options); } const aType = getType(a); @@ -108,7 +115,7 @@ function comparePrimitive( const aFormat = prettyFormat(a, FORMAT_OPTIONS); const bFormat = prettyFormat(b, FORMAT_OPTIONS); return aFormat === bFormat - ? NO_DIFF_MESSAGE + ? getCommonMessage(NO_DIFF_MESSAGE, options) : diffLinesUnified(aFormat.split('\n'), bFormat.split('\n'), options); } @@ -127,13 +134,14 @@ function compareObjects( ) { let difference; let hasThrown = false; + const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options); try { const aCompare = prettyFormat(a, FORMAT_OPTIONS_0); const bCompare = prettyFormat(b, FORMAT_OPTIONS_0); if (aCompare === bCompare) { - difference = NO_DIFF_MESSAGE; + difference = noDiffMessage; } else { const aDisplay = prettyFormat(a, FORMAT_OPTIONS); const bDisplay = prettyFormat(b, FORMAT_OPTIONS); @@ -152,12 +160,12 @@ function compareObjects( // If the comparison yields no results, compare again but this time // without calling `toJSON`. It's also possible that toJSON might throw. - if (difference === undefined || difference === NO_DIFF_MESSAGE) { + if (difference === undefined || difference === noDiffMessage) { const aCompare = prettyFormat(a, FALLBACK_FORMAT_OPTIONS_0); const bCompare = prettyFormat(b, FALLBACK_FORMAT_OPTIONS_0); if (aCompare === bCompare) { - difference = NO_DIFF_MESSAGE; + difference = noDiffMessage; } else { const aDisplay = prettyFormat(a, FALLBACK_FORMAT_OPTIONS); const bDisplay = prettyFormat(b, FALLBACK_FORMAT_OPTIONS); @@ -171,8 +179,9 @@ function compareObjects( ); } - if (difference !== NO_DIFF_MESSAGE && !hasThrown) { - difference = SIMILAR_MESSAGE + '\n\n' + difference; + if (difference !== noDiffMessage && !hasThrown) { + difference = + getCommonMessage(SIMILAR_MESSAGE, options) + '\n\n' + difference; } } diff --git a/packages/jest-docblock/package.json b/packages/jest-docblock/package.json index 8264e146ade3..49bb6d46c723 100644 --- a/packages/jest-docblock/package.json +++ b/packages/jest-docblock/package.json @@ -1,6 +1,6 @@ { "name": "jest-docblock", - "version": "25.3.0", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "detect-newline": "^3.0.0" }, @@ -23,7 +16,7 @@ "@types/node": "*" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-each/package.json b/packages/jest-each/package.json index 316149df7c50..2612d2da714d 100644 --- a/packages/jest-each/package.json +++ b/packages/jest-each/package.json @@ -1,16 +1,9 @@ { "name": "jest-each", - "version": "25.4.0", + "version": "26.0.1", "description": "Parameterised tests for Jest", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -25,14 +18,14 @@ "author": "Matt Phillips (mattphillips)", "license": "MIT", "dependencies": { - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", - "jest-get-type": "^25.2.6", - "jest-util": "^25.4.0", - "pretty-format": "^25.4.0" + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "jest-get-type": "^26.0.0", + "jest-util": "^26.0.1", + "pretty-format": "^26.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-each/src/index.ts b/packages/jest-each/src/index.ts index 9836bd2136cb..b22d4e305ef6 100644 --- a/packages/jest-each/src/index.ts +++ b/packages/jest-each/src/index.ts @@ -49,8 +49,10 @@ const install = ( return {describe, fdescribe, fit, it, test, xdescribe, xit, xtest}; }; -const each = (table: Global.EachTable, ...data: Global.TemplateData) => - install(global as Global, table, ...data); +const each = ( + table: Global.EachTable, + ...data: Global.TemplateData +): ReturnType => install(global as Global, table, ...data); each.withGlobal = (g: Global) => ( table: Global.EachTable, diff --git a/packages/jest-environment-jsdom/package.json b/packages/jest-environment-jsdom/package.json index 06c38b58c389..bea48a8e67fe 100644 --- a/packages/jest-environment-jsdom/package.json +++ b/packages/jest-environment-jsdom/package.json @@ -1,6 +1,6 @@ { "name": "jest-environment-jsdom", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,26 +9,19 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/environment": "^25.4.0", - "@jest/fake-timers": "^25.4.0", - "@jest/types": "^25.4.0", - "jest-mock": "^25.4.0", - "jest-util": "^25.4.0", - "jsdom": "^15.2.1" + "@jest/environment": "^26.0.1", + "@jest/fake-timers": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-util": "^26.0.1", + "jsdom": "^16.2.2" }, "devDependencies": { - "@types/jsdom": "^12.2.4" + "@types/jsdom": "^16.2.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-environment-jsdom/src/__mocks__/index.ts b/packages/jest-environment-jsdom/src/__mocks__/index.ts index b6f34c08f441..6f2641dfb719 100644 --- a/packages/jest-environment-jsdom/src/__mocks__/index.ts +++ b/packages/jest-environment-jsdom/src/__mocks__/index.ts @@ -8,10 +8,10 @@ const vm = jest.requireActual('vm'); -const JSDOMEnvironment = jest.genMockFromModule('../index') as jest.Mock; +const JSDOMEnvironment = jest.createMockFromModule('../index') as jest.Mock; JSDOMEnvironment.mockImplementation(function (config) { - // @ts-ignore + // @ts-expect-error this.global = { JSON, console: {}, @@ -19,7 +19,7 @@ JSDOMEnvironment.mockImplementation(function (config) { const globalValues = {...config.globals}; for (const customGlobalKey in globalValues) { - // @ts-ignore + // @ts-expect-error this.global[customGlobalKey] = globalValues[customGlobalKey]; } }); @@ -28,7 +28,7 @@ JSDOMEnvironment.prototype.runSourceText.mockImplementation(function ( sourceText: string, filename: string, ) { - // @ts-ignore + // @ts-expect-error return vm.runInNewContext(sourceText, this.global, { displayErrors: false, filename, diff --git a/packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts b/packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts index d3b2439ec7a8..528ed5620cbc 100644 --- a/packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts +++ b/packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts @@ -22,9 +22,9 @@ describe('JSDomEnvironment', () => { }); }); - it('has Lolex fake timers implementation', () => { + it('has modern fake timers implementation', () => { const env = new JSDomEnvironment(makeProjectConfig()); - expect(env.fakeTimersLolex).toBeDefined(); + expect(env.fakeTimersModern).toBeDefined(); }); }); diff --git a/packages/jest-environment-jsdom/src/index.ts b/packages/jest-environment-jsdom/src/index.ts index 4979dcd04e02..bdd5eec27734 100644 --- a/packages/jest-environment-jsdom/src/index.ts +++ b/packages/jest-environment-jsdom/src/index.ts @@ -5,14 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -import type {Script} from 'vm'; +import type {Context, Script} from 'vm'; import type {Config, Global} from '@jest/types'; import {installCommonGlobals} from 'jest-util'; import {ModuleMocker} from 'jest-mock'; -import { - JestFakeTimers as LegacyFakeTimers, - LolexFakeTimers, -} from '@jest/fake-timers'; +import {LegacyFakeTimers, ModernFakeTimers} from '@jest/fake-timers'; import type {EnvironmentContext, JestEnvironment} from '@jest/environment'; import {JSDOM, VirtualConsole} from 'jsdom'; @@ -28,7 +25,7 @@ type Win = Window & class JSDOMEnvironment implements JestEnvironment { dom: JSDOM | null; fakeTimers: LegacyFakeTimers | null; - fakeTimersLolex: LolexFakeTimers | null; + fakeTimersModern: ModernFakeTimers | null; global: Win; errorEventListener: ((event: Event & {error: Error}) => void) | null; moduleMocker: ModuleMocker | null; @@ -41,12 +38,17 @@ class JSDOMEnvironment implements JestEnvironment { virtualConsole: new VirtualConsole().sendTo(options.console || console), ...config.testEnvironmentOptions, }); - const global = (this.global = this.dom.window.document.defaultView as Win); + const global = (this.global = (this.dom.window.document + .defaultView as unknown) as Win); if (!global) { throw new Error('JSDOM did not return a Window object'); } + // In the `jsdom@16`, ArrayBuffer was not added to Window, ref: https://github.com/jsdom/jsdom/commit/3a4fd6258e6b13e9cf8341ddba60a06b9b5c7b5b + // Install ArrayBuffer to Window to fix it. Make sure the test is passed, ref: https://github.com/facebook/jest/pull/7626 + global.ArrayBuffer = ArrayBuffer; + // Node's error-message stack size is limited at 10, but it's pretty useful // to see more than that when a test fails. this.global.Error.stackTraceLimit = 100; @@ -96,7 +98,7 @@ class JSDOMEnvironment implements JestEnvironment { timerConfig, }); - this.fakeTimersLolex = new LolexFakeTimers({config, global}); + this.fakeTimersModern = new ModernFakeTimers({config, global}); } async setup(): Promise {} @@ -105,8 +107,8 @@ class JSDOMEnvironment implements JestEnvironment { if (this.fakeTimers) { this.fakeTimers.dispose(); } - if (this.fakeTimersLolex) { - this.fakeTimersLolex.dispose(); + if (this.fakeTimersModern) { + this.fakeTimersModern.dispose(); } if (this.global) { if (this.errorEventListener) { @@ -117,16 +119,23 @@ class JSDOMEnvironment implements JestEnvironment { this.global.close(); } this.errorEventListener = null; - // @ts-ignore + // @ts-expect-error this.global = null; this.dom = null; this.fakeTimers = null; - this.fakeTimersLolex = null; + this.fakeTimersModern = null; } runScript(script: Script): T | null { if (this.dom) { - return this.dom.runVMScript(script) as any; + return script.runInContext(this.dom.getInternalVMContext()); + } + return null; + } + + getVmContext(): Context | null { + if (this.dom) { + return this.dom.getInternalVMContext(); } return null; } diff --git a/packages/jest-environment-node/package.json b/packages/jest-environment-node/package.json index cfec5d2b3eb0..4b5c5bac86ff 100644 --- a/packages/jest-environment-node/package.json +++ b/packages/jest-environment-node/package.json @@ -1,6 +1,6 @@ { "name": "jest-environment-node", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,26 +9,15 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/environment": "^25.4.0", - "@jest/fake-timers": "^25.4.0", - "@jest/types": "^25.4.0", - "jest-mock": "^25.4.0", - "jest-util": "^25.4.0", - "semver": "^6.3.0" - }, - "devDependencies": { - "@types/semver": "^6.2.1" + "@jest/environment": "^26.0.1", + "@jest/fake-timers": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-util": "^26.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-environment-node/src/__tests__/node_environment.test.ts b/packages/jest-environment-node/src/__tests__/node_environment.test.ts index e43df37a1bf5..3cfb43c6d103 100644 --- a/packages/jest-environment-node/src/__tests__/node_environment.test.ts +++ b/packages/jest-environment-node/src/__tests__/node_environment.test.ts @@ -39,17 +39,17 @@ describe('NodeEnvironment', () => { const timer2 = env1.global.setInterval(() => {}, 0); [timer1, timer2].forEach(timer => { - // @ts-ignore + // @ts-expect-error expect(timer.id).not.toBeUndefined(); expect(typeof timer.ref).toBe('function'); expect(typeof timer.unref).toBe('function'); }); }); - it('has Lolex fake timers implementation', () => { + it('has modern fake timers implementation', () => { const env = new NodeEnvironment(makeProjectConfig()); - expect(env.fakeTimersLolex).toBeDefined(); + expect(env.fakeTimersModern).toBeDefined(); }); if (isTextEncoderDefined) { diff --git a/packages/jest-environment-node/src/index.ts b/packages/jest-environment-node/src/index.ts index 60b4c6ee9bc9..51a803cc5e9b 100644 --- a/packages/jest-environment-node/src/index.ts +++ b/packages/jest-environment-node/src/index.ts @@ -9,12 +9,8 @@ import {Context, Script, createContext, runInContext} from 'vm'; import type {Config, Global} from '@jest/types'; import {ModuleMocker} from 'jest-mock'; import {installCommonGlobals} from 'jest-util'; -import { - JestFakeTimers as LegacyFakeTimers, - LolexFakeTimers, -} from '@jest/fake-timers'; +import {LegacyFakeTimers, ModernFakeTimers} from '@jest/fake-timers'; import type {JestEnvironment} from '@jest/environment'; -import {lt as semverLt} from 'semver'; type Timer = { id: number; @@ -25,7 +21,7 @@ type Timer = { class NodeEnvironment implements JestEnvironment { context: Context | null; fakeTimers: LegacyFakeTimers | null; - fakeTimersLolex: LolexFakeTimers | null; + fakeTimersModern: ModernFakeTimers | null; global: Global.Global; moduleMocker: ModuleMocker | null; @@ -91,7 +87,7 @@ class NodeEnvironment implements JestEnvironment { timerConfig, }); - this.fakeTimersLolex = new LolexFakeTimers({config, global}); + this.fakeTimersModern = new ModernFakeTimers({config, global}); } async setup(): Promise {} @@ -100,12 +96,12 @@ class NodeEnvironment implements JestEnvironment { if (this.fakeTimers) { this.fakeTimers.dispose(); } - if (this.fakeTimersLolex) { - this.fakeTimersLolex.dispose(); + if (this.fakeTimersModern) { + this.fakeTimersModern.dispose(); } this.context = null; this.fakeTimers = null; - this.fakeTimersLolex = null; + this.fakeTimersModern = null; } // TS infers the return type to be `any`, since that's what `runInContext` @@ -122,11 +118,4 @@ class NodeEnvironment implements JestEnvironment { } } -// node 10 had a bug in `vm.compileFunction` that was fixed in https://github.com/nodejs/node/pull/23206. -// Let's just pretend the env doesn't support the function. -// Make sure engine requirement is high enough when we drop node 8 so we can remove this condition -if (semverLt(process.version, '10.14.2')) { - delete NodeEnvironment.prototype.getVmContext; -} - export = NodeEnvironment; diff --git a/packages/jest-environment/package.json b/packages/jest-environment/package.json index 4e68a7f81dd6..2e20a43d3929 100644 --- a/packages/jest-environment/package.json +++ b/packages/jest-environment/package.json @@ -1,6 +1,6 @@ { "name": "@jest/environment", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,23 +9,16 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/fake-timers": "^25.4.0", - "@jest/types": "^25.4.0", - "jest-mock": "^25.4.0" + "@jest/fake-timers": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-mock": "^26.0.1" }, "devDependencies": { "@types/node": "*" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-environment/src/index.ts b/packages/jest-environment/src/index.ts index 42ca2979c3bd..21970ecd1543 100644 --- a/packages/jest-environment/src/index.ts +++ b/packages/jest-environment/src/index.ts @@ -8,10 +8,7 @@ import type {Context, Script} from 'vm'; import type {Circus, Config, Global} from '@jest/types'; import jestMock = require('jest-mock'); -import type { - JestFakeTimers as LegacyFakeTimers, - LolexFakeTimers, -} from '@jest/fake-timers'; +import type {LegacyFakeTimers, ModernFakeTimers} from '@jest/fake-timers'; type JestMockFn = typeof jestMock.fn; type JestMockSpyOn = typeof jestMock.spyOn; @@ -41,7 +38,7 @@ export declare class JestEnvironment { constructor(config: Config.ProjectConfig, context?: EnvironmentContext); global: Global.Global; fakeTimers: LegacyFakeTimers | null; - fakeTimersLolex: LolexFakeTimers | null; + fakeTimersModern: ModernFakeTimers | null; moduleMocker: jestMock.ModuleMocker | null; /** * @deprecated implement getVmContext instead @@ -58,11 +55,6 @@ export declare class JestEnvironment { export type Module = NodeModule; -export interface LocalModuleRequire extends NodeRequire { - requireActual(moduleName: string): unknown; - requireMock(moduleName: string): unknown; -} - // TODO: Move to some separate package export interface Jest { /** @@ -134,8 +126,18 @@ export interface Jest { * * This is useful when you want to create a manual mock that extends the * automatic mock's behavior. + * + * @deprecated Use `jest.createMockFromModule()` instead */ genMockFromModule(moduleName: string): unknown; + /** + * Given the name of a module, use the automatic mocking system to generate a + * mocked version of the module for you. + * + * This is useful when you want to create a manual mock that extends the + * automatic mock's behavior. + */ + createMockFromModule(moduleName: string): unknown; /** * Determines if the given function is a mocked function. */ @@ -207,6 +209,8 @@ export interface Jest { retryTimes(numRetries: number): Jest; /** * Exhausts tasks queued by setImmediate(). + * + * > Note: This function is not available when using Lolex as fake timers implementation */ runAllImmediates(): void; /** @@ -277,7 +281,7 @@ export interface Jest { /** * Instructs Jest to use fake versions of the standard timer functions. */ - useFakeTimers(): Jest; + useFakeTimers(implementation?: 'modern' | 'legacy'): Jest; /** * Instructs Jest to use the real versions of the standard timer functions. */ @@ -289,4 +293,18 @@ export interface Jest { * every test so that local module state doesn't conflict between tests. */ isolateModules(fn: () => void): Jest; + + /** + * When mocking time, `Date.now()` will also be mocked. If you for some reason need access to the real current time, you can invoke this function. + * + * > Note: This function is only available when using Lolex as fake timers implementation + */ + getRealSystemTime(): number; + + /** + * Set the current system time used by fake timers. Simulates a user changing the system clock while your program is running. It affects the current time but it does not in itself cause e.g. timers to fire; they will fire exactly as they would have done without the call to `jest.setSystemTime()`. + * + * > Note: This function is only available when using Lolex as fake timers implementation + */ + setSystemTime(now?: number): void; } diff --git a/packages/jest-fake-timers/package.json b/packages/jest-fake-timers/package.json index e3a22a68beb7..38bf54d895fe 100644 --- a/packages/jest-fake-timers/package.json +++ b/packages/jest-fake-timers/package.json @@ -1,6 +1,6 @@ { "name": "@jest/fake-timers", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,26 +9,19 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-mock": "^25.4.0", - "jest-util": "^25.4.0", - "lolex": "^5.0.0" + "@jest/types": "^26.0.1", + "@sinonjs/fake-timers": "^6.0.1", + "jest-message-util": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-util": "^26.0.1" }, "devDependencies": { - "@types/lolex": "^5.1.0", - "@types/node": "*" + "@types/node": "*", + "@types/sinonjs__fake-timers": "^6.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-fake-timers/src/__tests__/__snapshots__/jestFakeTimers.test.ts.snap b/packages/jest-fake-timers/src/__tests__/__snapshots__/legacyFakeTimers.test.ts.snap similarity index 100% rename from packages/jest-fake-timers/src/__tests__/__snapshots__/jestFakeTimers.test.ts.snap rename to packages/jest-fake-timers/src/__tests__/__snapshots__/legacyFakeTimers.test.ts.snap diff --git a/packages/jest-fake-timers/src/__tests__/__snapshots__/fakeTimersLolex.test.ts.snap b/packages/jest-fake-timers/src/__tests__/__snapshots__/modernFakeTimers.test.ts.snap similarity index 100% rename from packages/jest-fake-timers/src/__tests__/__snapshots__/fakeTimersLolex.test.ts.snap rename to packages/jest-fake-timers/src/__tests__/__snapshots__/modernFakeTimers.test.ts.snap diff --git a/packages/jest-fake-timers/src/__tests__/jestFakeTimers.test.ts b/packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts similarity index 99% rename from packages/jest-fake-timers/src/__tests__/jestFakeTimers.test.ts rename to packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts index 453b28ae83fa..28a335152a11 100644 --- a/packages/jest-fake-timers/src/__tests__/jestFakeTimers.test.ts +++ b/packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts @@ -9,7 +9,7 @@ import * as util from 'util'; import {runInNewContext} from 'vm'; import wrap from 'jest-snapshot-serializer-raw'; import mock = require('jest-mock'); -import FakeTimers from '../jestFakeTimers'; +import FakeTimers from '../legacyFakeTimers'; const timerConfig = { idToRef: (id: number) => id, diff --git a/packages/jest-fake-timers/src/__tests__/fakeTimersLolex.test.ts b/packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts similarity index 99% rename from packages/jest-fake-timers/src/__tests__/fakeTimersLolex.test.ts rename to packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts index bba8df289496..a731c594104c 100644 --- a/packages/jest-fake-timers/src/__tests__/fakeTimersLolex.test.ts +++ b/packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts @@ -6,7 +6,7 @@ * */ -import FakeTimers from '../FakeTimersLolex'; +import FakeTimers from '../modernFakeTimers'; describe('FakeTimers', () => { describe('construction', () => { @@ -288,7 +288,7 @@ describe('FakeTimers', () => { }; const timers = new FakeTimers({global}); - // Lolex uses `setTimeout` during init to figure out if it's in Node or + // @sinonjs/fake-timers uses `setTimeout` during init to figure out if it's in Node or // browser env. So clear its calls before we install them into the env nativeSetTimeout.mockClear(); timers.useFakeTimers(); diff --git a/packages/jest-fake-timers/src/index.ts b/packages/jest-fake-timers/src/index.ts index 295edc2bee29..8e4daf764dda 100644 --- a/packages/jest-fake-timers/src/index.ts +++ b/packages/jest-fake-timers/src/index.ts @@ -5,5 +5,5 @@ * LICENSE file in the root directory of this source tree. */ -export {default as JestFakeTimers} from './jestFakeTimers'; -export {default as LolexFakeTimers} from './FakeTimersLolex'; +export {default as LegacyFakeTimers} from './legacyFakeTimers'; +export {default as ModernFakeTimers} from './modernFakeTimers'; diff --git a/packages/jest-fake-timers/src/jestFakeTimers.ts b/packages/jest-fake-timers/src/legacyFakeTimers.ts similarity index 97% rename from packages/jest-fake-timers/src/jestFakeTimers.ts rename to packages/jest-fake-timers/src/legacyFakeTimers.ts index f425d4ed1607..6185f77f0c27 100644 --- a/packages/jest-fake-timers/src/jestFakeTimers.ts +++ b/packages/jest-fake-timers/src/legacyFakeTimers.ts @@ -366,10 +366,11 @@ export default class FakeTimers { private _createMocks() { const fn = (impl: Function) => - // @ts-ignore TODO: figure out better typings here + // @ts-expect-error TODO: figure out better typings here this._moduleMocker.fn().mockImplementation(impl); const promisifiableFakeSetTimeout = fn(this._fakeSetTimeout.bind(this)); + // @ts-expect-error TODO: figure out better typings here promisifiableFakeSetTimeout[util.promisify.custom] = ( delay?: number, arg?: unknown, @@ -382,8 +383,11 @@ export default class FakeTimers { clearInterval: fn(this._fakeClearTimer.bind(this)), clearTimeout: fn(this._fakeClearTimer.bind(this)), nextTick: fn(this._fakeNextTick.bind(this)), + // @ts-expect-error TODO: figure out better typings here setImmediate: fn(this._fakeSetImmediate.bind(this)), + // @ts-expect-error TODO: figure out better typings here setInterval: fn(this._fakeSetInterval.bind(this)), + // @ts-expect-error TODO: figure out better typings here setTimeout: promisifiableFakeSetTimeout, }; } diff --git a/packages/jest-fake-timers/src/FakeTimersLolex.ts b/packages/jest-fake-timers/src/modernFakeTimers.ts similarity index 89% rename from packages/jest-fake-timers/src/FakeTimersLolex.ts rename to packages/jest-fake-timers/src/modernFakeTimers.ts index 56a767f4cab5..03ca30807a89 100644 --- a/packages/jest-fake-timers/src/FakeTimersLolex.ts +++ b/packages/jest-fake-timers/src/modernFakeTimers.ts @@ -6,10 +6,10 @@ */ import { + FakeTimerWithContext, InstalledClock, - LolexWithContext, - withGlobal as lolexWithGlobal, -} from 'lolex'; + withGlobal, +} from '@sinonjs/fake-timers'; import {StackTraceConfig, formatStackTrace} from 'jest-message-util'; export default class FakeTimers { @@ -17,7 +17,7 @@ export default class FakeTimers { private _config: StackTraceConfig; private _fakingTime: boolean; private _global: NodeJS.Global; - private _lolex: LolexWithContext; + private _fakeTimers: FakeTimerWithContext; private _maxLoops: number; constructor({ @@ -34,7 +34,7 @@ export default class FakeTimers { this._maxLoops = maxLoops || 100000; this._fakingTime = false; - this._lolex = lolexWithGlobal(global); + this._fakeTimers = withGlobal(global); } clearAllTimers(): void { @@ -63,7 +63,7 @@ export default class FakeTimers { if (this._checkFakeTimers()) { for (let i = steps; i > 0; i--) { this._clock.next(); - // Fire all timers at this point: https://github.com/sinonjs/lolex/issues/250 + // Fire all timers at this point: https://github.com/sinonjs/fake-timers/issues/250 this._clock.tick(0); if (this._clock.countTimers() === 0) { @@ -81,7 +81,7 @@ export default class FakeTimers { runAllTicks(): void { if (this._checkFakeTimers()) { - // @ts-ignore + // @ts-expect-error this._clock.runMicrotasks(); } } @@ -95,11 +95,11 @@ export default class FakeTimers { useFakeTimers(): void { if (!this._fakingTime) { - const toFake = Object.keys(this._lolex.timers) as Array< - keyof LolexWithContext['timers'] + const toFake = Object.keys(this._fakeTimers.timers) as Array< + keyof FakeTimerWithContext['timers'] >; - this._clock = this._lolex.install({ + this._clock = this._fakeTimers.install({ loopLimit: this._maxLoops, now: Date.now(), target: this._global, diff --git a/packages/jest-get-type/package.json b/packages/jest-get-type/package.json index ae0524cb5af4..85e5a4b7ee2b 100644 --- a/packages/jest-get-type/package.json +++ b/packages/jest-get-type/package.json @@ -1,25 +1,18 @@ { "name": "jest-get-type", "description": "A utility function to get the type of a value", - "version": "25.2.6", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-get-type" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-globals/package.json b/packages/jest-globals/package.json index c216d3beda23..0e72b005f5c2 100644 --- a/packages/jest-globals/package.json +++ b/packages/jest-globals/package.json @@ -1,28 +1,21 @@ { "name": "@jest/globals", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-globals" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/environment": "^25.4.0", - "@jest/types": "^25.4.0", - "expect": "^25.4.0" + "@jest/environment": "^26.0.1", + "@jest/types": "^26.0.1", + "expect": "^26.0.1" }, "publishConfig": { "access": "public" diff --git a/packages/jest-globals/src/index.ts b/packages/jest-globals/src/index.ts index 82bc15a3b522..cc13927c0d13 100644 --- a/packages/jest-globals/src/index.ts +++ b/packages/jest-globals/src/index.ts @@ -9,22 +9,22 @@ import importedExpect = require('expect'); import type {Jest} from '@jest/environment'; import type {Global} from '@jest/types'; -export declare type jest = Jest; +export declare const jest: Jest; -export declare type expect = typeof importedExpect; +export declare const expect: typeof importedExpect; -export declare type it = Global.GlobalAdditions['it']; -export declare type test = Global.GlobalAdditions['test']; -export declare type fit = Global.GlobalAdditions['fit']; -export declare type xit = Global.GlobalAdditions['xit']; -export declare type xtest = Global.GlobalAdditions['xtest']; -export declare type describe = Global.GlobalAdditions['describe']; -export declare type xdescribe = Global.GlobalAdditions['xdescribe']; -export declare type fdescribe = Global.GlobalAdditions['fdescribe']; -export declare type beforeAll = Global.GlobalAdditions['beforeAll']; -export declare type beforeEach = Global.GlobalAdditions['beforeEach']; -export declare type afterEach = Global.GlobalAdditions['afterEach']; -export declare type afterAll = Global.GlobalAdditions['afterAll']; +export declare const it: Global.GlobalAdditions['it']; +export declare const test: Global.GlobalAdditions['test']; +export declare const fit: Global.GlobalAdditions['fit']; +export declare const xit: Global.GlobalAdditions['xit']; +export declare const xtest: Global.GlobalAdditions['xtest']; +export declare const describe: Global.GlobalAdditions['describe']; +export declare const xdescribe: Global.GlobalAdditions['xdescribe']; +export declare const fdescribe: Global.GlobalAdditions['fdescribe']; +export declare const beforeAll: Global.GlobalAdditions['beforeAll']; +export declare const beforeEach: Global.GlobalAdditions['beforeEach']; +export declare const afterEach: Global.GlobalAdditions['afterEach']; +export declare const afterAll: Global.GlobalAdditions['afterAll']; throw new Error( 'Do not import `@jest/globals` outside of the Jest test environment', diff --git a/packages/jest-haste-map/package.json b/packages/jest-haste-map/package.json index 8d8db4832b20..27c83cc27d59 100644 --- a/packages/jest-haste-map/package.json +++ b/packages/jest-haste-map/package.json @@ -1,6 +1,6 @@ { "name": "jest-haste-map", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,31 +9,24 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", + "@jest/types": "^26.0.1", + "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.3", - "jest-serializer": "^25.2.6", - "jest-util": "^25.4.0", - "jest-worker": "^25.4.0", + "graceful-fs": "^4.2.4", + "jest-serializer": "^26.0.0", + "jest-util": "^26.0.1", + "jest-worker": "^26.0.0", "micromatch": "^4.0.2", "sane": "^4.0.3", "walker": "^1.0.7", "which": "^2.0.2" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "@types/anymatch": "^1.3.1", "@types/fb-watchman": "^2.0.0", - "@types/graceful-fs": "^4.1.2", "@types/micromatch": "^4.0.0", "@types/node": "*", "@types/sane": "^2.0.0", @@ -43,7 +36,7 @@ "fsevents": "^2.1.2" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-haste-map/src/__tests__/index.test.js b/packages/jest-haste-map/src/__tests__/index.test.js index fee7fce17ff9..5d67e670dcde 100644 --- a/packages/jest-haste-map/src/__tests__/index.test.js +++ b/packages/jest-haste-map/src/__tests__/index.test.js @@ -105,7 +105,6 @@ jest.mock('graceful-fs', () => ({ mockFs[path] = data; }), })); -jest.mock('fs', () => require('graceful-fs')); const cacheFilePath = '/cache-file'; const object = data => Object.assign(Object.create(null), data); @@ -330,7 +329,6 @@ describe('HasteMap', () => { const hasteMap = new HasteMap({ ...defaultConfig, mocksPattern: '/__mocks__/', - providesModuleNodeModules: ['react', 'fbjs'], }); return hasteMap.build().then(({__hasteMapForTest: data}) => { @@ -342,23 +340,6 @@ describe('HasteMap', () => { 'fruits/Pear.js': ['Pear', 32, 42, 1, 'Banana\0Strawberry', null], 'fruits/Strawberry.js': ['Strawberry', 32, 42, 1, '', null], 'fruits/__mocks__/Pear.js': ['', 32, 42, 1, 'Melon', null], - // node modules - 'fruits/node_modules/fbjs/lib/flatMap.js': [ - 'flatMap', - 32, - 42, - 1, - '', - null, - ], - 'fruits/node_modules/react/React.js': [ - 'React', - 32, - 42, - 1, - 'Component', - null, - ], 'vegetables/Melon.js': ['Melon', 32, 42, 1, '', null], }), ); @@ -368,21 +349,9 @@ describe('HasteMap', () => { Banana: {[H.GENERIC_PLATFORM]: ['fruits/Banana.js', H.MODULE]}, Melon: {[H.GENERIC_PLATFORM]: ['vegetables/Melon.js', H.MODULE]}, Pear: {[H.GENERIC_PLATFORM]: ['fruits/Pear.js', H.MODULE]}, - React: { - [H.GENERIC_PLATFORM]: [ - 'fruits/node_modules/react/React.js', - H.MODULE, - ], - }, Strawberry: { [H.GENERIC_PLATFORM]: ['fruits/Strawberry.js', H.MODULE], }, - flatMap: { - [H.GENERIC_PLATFORM]: [ - 'fruits/node_modules/fbjs/lib/flatMap.js', - H.MODULE, - ], - }, }), ); diff --git a/packages/jest-haste-map/src/__tests__/worker.test.js b/packages/jest-haste-map/src/__tests__/worker.test.js index cf313fe2e042..35d049ef76fe 100644 --- a/packages/jest-haste-map/src/__tests__/worker.test.js +++ b/packages/jest-haste-map/src/__tests__/worker.test.js @@ -38,7 +38,7 @@ jest.mock('graceful-fs', () => { }; return { - ...jest.genMockFromModule('graceful-fs'), + ...jest.createMockFromModule('graceful-fs'), readFileSync: jest.fn((path, options) => { if (mockFs[path]) { return options === 'utf8' ? mockFs[path] : Buffer.from(mockFs[path]); diff --git a/packages/jest-haste-map/src/crawlers/__tests__/node.test.js b/packages/jest-haste-map/src/crawlers/__tests__/node.test.js index 863ecb8c4ad2..c972f0da6dd1 100644 --- a/packages/jest-haste-map/src/crawlers/__tests__/node.test.js +++ b/packages/jest-haste-map/src/crawlers/__tests__/node.test.js @@ -33,7 +33,7 @@ jest.mock('child_process', () => ({ let mockHasReaddirWithFileTypesSupport = false; -jest.mock('fs', () => { +jest.mock('graceful-fs', () => { let mtime = 32; const size = 42; const stat = (path, callback) => { @@ -384,7 +384,7 @@ describe('node crawler', () => { describe('readdir withFileTypes support', () => { it('calls lstat for directories and symlinks if readdir withFileTypes is not supported', () => { nodeCrawl = require('../node'); - const fs = require('fs'); + const fs = require('graceful-fs'); const files = new Map(); return nodeCrawl({ @@ -416,7 +416,7 @@ describe('node crawler', () => { it('avoids calling lstat for directories and symlinks if readdir withFileTypes is supported', () => { mockHasReaddirWithFileTypesSupport = true; nodeCrawl = require('../node'); - const fs = require('fs'); + const fs = require('graceful-fs'); const files = new Map(); return nodeCrawl({ diff --git a/packages/jest-haste-map/src/crawlers/node.ts b/packages/jest-haste-map/src/crawlers/node.ts index c8254bd36361..0266816d91fb 100644 --- a/packages/jest-haste-map/src/crawlers/node.ts +++ b/packages/jest-haste-map/src/crawlers/node.ts @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; import {spawn} from 'child_process'; +import * as fs from 'graceful-fs'; import which = require('which'); import H from '../constants'; import * as fastPath from '../lib/fast_path'; diff --git a/packages/jest-haste-map/src/getMockName.ts b/packages/jest-haste-map/src/getMockName.ts index a30db82f1c73..428456985d7a 100644 --- a/packages/jest-haste-map/src/getMockName.ts +++ b/packages/jest-haste-map/src/getMockName.ts @@ -9,7 +9,7 @@ import * as path from 'path'; const MOCKS_PATTERN = path.sep + '__mocks__' + path.sep; -const getMockName = (filePath: string) => { +const getMockName = (filePath: string): string => { const mockPath = filePath.split(MOCKS_PATTERN)[1]; return mockPath .substring(0, mockPath.lastIndexOf(path.extname(mockPath))) diff --git a/packages/jest-haste-map/src/index.ts b/packages/jest-haste-map/src/index.ts index 5a0fbe7b96f8..572164a4bbf2 100644 --- a/packages/jest-haste-map/src/index.ts +++ b/packages/jest-haste-map/src/index.ts @@ -8,9 +8,9 @@ import {execSync} from 'child_process'; import {createHash} from 'crypto'; import {EventEmitter} from 'events'; -import type {Stats} from 'fs'; import {tmpdir} from 'os'; import * as path from 'path'; +import type {Stats} from 'graceful-fs'; import {NodeWatcher, Watcher as SaneWatcher} from 'sane'; import type {Config} from '@jest/types'; import serializer from 'jest-serializer'; @@ -26,7 +26,7 @@ import HasteModuleMap, { import nodeCrawl = require('./crawlers/node'); import normalizePathSep from './lib/normalizePathSep'; import watchmanCrawl = require('./crawlers/watchman'); -// @ts-ignore: not converted to TypeScript - it's a fork: https://github.com/facebook/jest/pull/5387 +// @ts-expect-error: not converted to TypeScript - it's a fork: https://github.com/facebook/jest/pull/5387 import WatchmanWatcher from './lib/WatchmanWatcher'; import FSEventsWatcher = require('./lib/FSEventsWatcher'); import * as fastPath from './lib/fast_path'; @@ -61,7 +61,6 @@ type Options = { mocksPattern?: string; name: string; platforms: Array; - providesModuleNodeModules?: Array; resetCache?: boolean; retainAllFiles: boolean; rootDir: string; @@ -127,28 +126,6 @@ const canUseWatchman = ((): boolean => { return false; })(); -const escapePathSeparator = (string: string) => - path.sep === '\\' ? string.replace(/(\/|\\)/g, '\\\\') : string; - -const getWhiteList = (list: Array | undefined): RegExp | null => { - if (list && list.length) { - const newList = list.map(item => - escapePathSeparator(item.replace(/(\/)/g, path.sep)), - ); - return new RegExp( - '(' + - escapePathSeparator(NODE_MODULES) + - '(?:' + - newList.join('|') + - ')(?=$|' + - escapePathSeparator(path.sep) + - '))', - 'g', - ); - } - return null; -}; - function invariant(condition: unknown, message?: string): asserts condition { if (!condition) { throw new Error(message); @@ -241,7 +218,6 @@ class HasteMap extends EventEmitter { private _console: Console; private _options: InternalOptions; private _watchers: Array; - private _whitelist: RegExp | null; private _worker: WorkerInterface | null; constructor(options: Options) { @@ -315,7 +291,6 @@ class HasteMap extends EventEmitter { hasteImplHash, dependencyExtractorHash, ); - this._whitelist = getWhiteList(options.providesModuleNodeModules); this._buildPromise = null; this._watchers = []; this._worker = null; @@ -538,7 +513,6 @@ class HasteMap extends EventEmitter { error.stack = ''; // Remove stack for stack-less errors. } - // @ts-ignore: checking error code is OK if error comes from "fs". if (!['ENOENT', 'EACCES'].includes(error.code)) { throw error; } @@ -550,7 +524,7 @@ class HasteMap extends EventEmitter { // If we retain all files in the virtual HasteFS representation, we avoid // reading them if they aren't important (node_modules). - if (this._options.retainAllFiles && this._isNodeModulesDir(filePath)) { + if (this._options.retainAllFiles && filePath.includes(NODE_MODULES)) { if (computeSha1) { return this._getWorker(workerOptions) .getSha1({ @@ -702,9 +676,9 @@ class HasteMap extends EventEmitter { private _cleanup() { const worker = this._worker; - // @ts-ignore + // @ts-expect-error if (worker && typeof worker.end === 'function') { - // @ts-ignore + // @ts-expect-error worker.end(); } @@ -726,7 +700,7 @@ class HasteMap extends EventEmitter { if ((options && options.forceInBand) || this._options.maxWorkers <= 1) { this._worker = {getSha1, worker}; } else { - // @ts-ignore: assignment of a worker with custom properties. + // @ts-expect-error: assignment of a worker with custom properties. this._worker = new Worker(require.resolve('./worker'), { exposedMethods: ['getSha1', 'worker'], maxRetries: 3, @@ -814,7 +788,7 @@ class HasteMap extends EventEmitter { let mustCopy = true; const createWatcher = (root: Config.Path): Promise => { - // @ts-ignore: TODO how? "Cannot use 'new' with an expression whose type lacks a call or construct signature." + // @ts-expect-error: TODO how? "Cannot use 'new' with an expression whose type lacks a call or construct signature." const watcher = new Watcher(root, { dot: false, glob: extensions.map(extension => '**/*.' + extension), @@ -871,6 +845,19 @@ class HasteMap extends EventEmitter { return; } + const relativeFilePath = fastPath.relative(rootDir, filePath); + const fileMetadata = hasteMap.files.get(relativeFilePath); + + // The file has been accessed, not modified + if ( + type === 'change' && + fileMetadata && + stat && + fileMetadata[H.MTIME] === stat.mtime.getTime() + ) { + return; + } + changeQueue = changeQueue .then(() => { // If we get duplicate events for the same file, ignore them. @@ -904,7 +891,6 @@ class HasteMap extends EventEmitter { return null; }; - const relativeFilePath = fastPath.relative(rootDir, filePath); const fileMetadata = hasteMap.files.get(relativeFilePath); // If it's not an addition, delete the file and all its metadata @@ -1048,7 +1034,7 @@ class HasteMap extends EventEmitter { } end(): Promise { - // @ts-ignore: TODO TS cannot decide if `setInterval` and `clearInterval` comes from NodeJS or the DOM + // @ts-expect-error: TODO TS cannot decide if `setInterval` and `clearInterval` comes from NodeJS or the DOM clearInterval(this._changeInterval); if (!this._watchers.length) { return Promise.resolve(); @@ -1075,32 +1061,10 @@ class HasteMap extends EventEmitter { return ( ignoreMatched || - (!this._options.retainAllFiles && this._isNodeModulesDir(filePath)) + (!this._options.retainAllFiles && filePath.includes(NODE_MODULES)) ); } - private _isNodeModulesDir(filePath: Config.Path): boolean { - if (!filePath.includes(NODE_MODULES)) { - return false; - } - - if (this._whitelist) { - const whitelist = this._whitelist; - const match = whitelist.exec(filePath); - const matchEndIndex = whitelist.lastIndex; - whitelist.lastIndex = 0; - - if (!match) { - return true; - } - - const filePathInPackage = filePath.substr(matchEndIndex); - return filePathInPackage.startsWith(NODE_MODULES); - } - - return true; - } - private _createEmptyMap(): InternalHasteMap { return { clocks: new Map(), diff --git a/packages/jest-haste-map/src/lib/FSEventsWatcher.ts b/packages/jest-haste-map/src/lib/FSEventsWatcher.ts index f41305b1cd31..2cf05da9655b 100644 --- a/packages/jest-haste-map/src/lib/FSEventsWatcher.ts +++ b/packages/jest-haste-map/src/lib/FSEventsWatcher.ts @@ -6,14 +6,15 @@ * */ -import * as fs from 'fs'; import * as path from 'path'; import {EventEmitter} from 'events'; +import * as fs from 'graceful-fs'; import anymatch, {Matcher} from 'anymatch'; import micromatch = require('micromatch'); -// @ts-ignore no types +// @ts-expect-error no types import walker from 'walker'; +// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error // @ts-ignore: this is for CI which runs linux and might not have this let fsevents: typeof import('fsevents') | null = null; try { diff --git a/packages/jest-haste-map/src/lib/WatchmanWatcher.js b/packages/jest-haste-map/src/lib/WatchmanWatcher.js index adce679cdf08..5f10a750684f 100644 --- a/packages/jest-haste-map/src/lib/WatchmanWatcher.js +++ b/packages/jest-haste-map/src/lib/WatchmanWatcher.js @@ -5,10 +5,10 @@ * LICENSE file in the root directory of this source tree. */ -import fs from 'fs'; import path from 'path'; import assert from 'assert'; import {EventEmitter} from 'events'; +import * as fs from 'graceful-fs'; import watchman from 'fb-watchman'; import common from 'sane/src/common'; import RecrawlWarning from 'sane/src/utils/recrawl-warning-dedupe'; diff --git a/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js b/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js index 6ce7e444fae9..f2196a19c4b5 100644 --- a/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js +++ b/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js @@ -184,46 +184,6 @@ describe('dependencyExtractor', () => { expect(extract(code)).toEqual(new Set(['dep1', 'dep2', 'dep3'])); }); - it('should extract dependencies from `require.requireActual` calls', () => { - const code = ` - // Good - require.requireActual('dep1'); - const dep2 = require.requireActual( - "dep2", - ); - if (require.requireActual(\`dep3\`).cond) {} - require - .requireActual('dep4'); - - // Bad - ${COMMENT_NO_NEG_LB} foo . require.requireActual('inv1') - xrequire.requireActual('inv2'); - require.requireActualx('inv3'); - require.requireActual('inv4', 'inv5'); - `; - expect(extract(code)).toEqual(new Set(['dep1', 'dep2', 'dep3', 'dep4'])); - }); - - it('should extract dependencies from `require.requireMock` calls', () => { - const code = ` - // Good - require.requireMock('dep1'); - const dep2 = require.requireMock( - "dep2", - ); - if (require.requireMock(\`dep3\`).cond) {} - require - .requireMock('dep4'); - - // Bad - ${COMMENT_NO_NEG_LB} foo . require.requireMock('inv1') - xrequire.requireMock('inv2'); - require.requireMockx('inv3'); - require.requireMock('inv4', 'inv5'); - `; - expect(extract(code)).toEqual(new Set(['dep1', 'dep2', 'dep3', 'dep4'])); - }); - it('should extract dependencies from `jest.requireActual` calls', () => { const code = ` // Good @@ -283,4 +243,24 @@ describe('dependencyExtractor', () => { `; expect(extract(code)).toEqual(new Set(['dep1', 'dep2', 'dep3', 'dep4'])); }); + + it('should extract dependencies from `jest.createMockFromModule` calls', () => { + const code = ` + // Good + jest.createMockFromModule('dep1'); + const dep2 = jest.createMockFromModule( + "dep2", + ); + if (jest.createMockFromModule(\`dep3\`).cond) {} + jest + .requireMock('dep4'); + + // Bad + ${COMMENT_NO_NEG_LB} foo . jest.createMockFromModule('inv1') + xjest.createMockFromModule('inv2'); + jest.createMockFromModulex('inv3'); + jest.createMockFromModule('inv4', 'inv5'); + `; + expect(extract(code)).toEqual(new Set(['dep1', 'dep2', 'dep3', 'dep4'])); + }); }); diff --git a/packages/jest-haste-map/src/lib/dependencyExtractor.ts b/packages/jest-haste-map/src/lib/dependencyExtractor.ts index d1aa4445ff3c..56dce5ebfd81 100644 --- a/packages/jest-haste-map/src/lib/dependencyExtractor.ts +++ b/packages/jest-haste-map/src/lib/dependencyExtractor.ts @@ -63,8 +63,7 @@ const IMPORT_OR_EXPORT_RE = createRegExp( const JEST_EXTENSIONS_RE = createRegExp( [ ...functionCallStart( - 'require\\s*\\.\\s*(?:requireActual|requireMock)', - 'jest\\s*\\.\\s*(?:requireActual|requireMock|genMockFromModule)', + 'jest\\s*\\.\\s*(?:requireActual|requireMock|genMockFromModule|createMockFromModule)', ), CAPTURE_STRING_LITERAL(1), WHITESPACE, diff --git a/packages/jest-haste-map/src/lib/normalizePathSep.ts b/packages/jest-haste-map/src/lib/normalizePathSep.ts index 9e89d0c87e11..2dc7ea57e503 100644 --- a/packages/jest-haste-map/src/lib/normalizePathSep.ts +++ b/packages/jest-haste-map/src/lib/normalizePathSep.ts @@ -9,9 +9,10 @@ import * as path from 'path'; let normalizePathSep: (string: string) => string; if (path.sep === '/') { - normalizePathSep = (filePath: string) => filePath; + normalizePathSep = (filePath: string): string => filePath; } else { - normalizePathSep = (filePath: string) => filePath.replace(/\//g, path.sep); + normalizePathSep = (filePath: string): string => + filePath.replace(/\//g, path.sep); } export default normalizePathSep; diff --git a/packages/jest-haste-map/src/types.ts b/packages/jest-haste-map/src/types.ts index 953b2ecc9858..6d09b1fdc182 100644 --- a/packages/jest-haste-map/src/types.ts +++ b/packages/jest-haste-map/src/types.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import type {Stats} from 'fs'; +import type {Stats} from 'graceful-fs'; import type {Config} from '@jest/types'; import type ModuleMap from './ModuleMap'; import type HasteFS from './HasteFS'; diff --git a/packages/jest-jasmine2/package.json b/packages/jest-jasmine2/package.json index 6a00b3ee56c7..4ecf77950a42 100644 --- a/packages/jest-jasmine2/package.json +++ b/packages/jest-jasmine2/package.json @@ -1,6 +1,6 @@ { "name": "jest-jasmine2", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,30 +9,23 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^25.4.0", - "@jest/source-map": "^25.2.6", - "@jest/test-result": "^25.4.0", - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", + "@jest/environment": "^26.0.1", + "@jest/source-map": "^26.0.0", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^25.4.0", + "expect": "^26.0.1", "is-generator-fn": "^2.0.0", - "jest-each": "^25.4.0", - "jest-matcher-utils": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-runtime": "^25.4.0", - "jest-snapshot": "^25.4.0", - "jest-util": "^25.4.0", - "pretty-format": "^25.4.0", + "jest-each": "^26.0.1", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "pretty-format": "^26.0.1", "throat": "^5.0.0" }, "devDependencies": { @@ -40,7 +33,7 @@ "@types/co": "^4.6.2" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-jasmine2/src/__tests__/Suite.test.ts b/packages/jest-jasmine2/src/__tests__/Suite.test.ts index e8323ea2e589..caf44ac93ffa 100644 --- a/packages/jest-jasmine2/src/__tests__/Suite.test.ts +++ b/packages/jest-jasmine2/src/__tests__/Suite.test.ts @@ -19,7 +19,7 @@ describe('Suite', () => { it("doesn't throw on addExpectationResult when there are no children", () => { expect(() => { - // @ts-ignore + // @ts-expect-error suite.addExpectationResult(); }).not.toThrow(); }); diff --git a/packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts b/packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts index fdf940eab04c..59cebccb4cd9 100644 --- a/packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts +++ b/packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts @@ -55,6 +55,18 @@ describe('expectationResultFactory', () => { expect(result.message).toEqual('Error: Expected `Pass`, received `Fail`.'); }); + it('returns the error name if the error message is empty', () => { + const options = { + actual: 'Fail', + error: new Error(), + expected: 'Pass', + matcherName: 'testMatcher', + passed: false, + }; + const result = expectationResultFactory(options); + expect(result.message).toEqual('Error'); + }); + it('returns the result if failed (with `error` as a string).', () => { const options = { actual: 'Fail', diff --git a/packages/jest-jasmine2/src/__tests__/itTestError.test.ts b/packages/jest-jasmine2/src/__tests__/itTestError.test.ts index e230949e8f28..2c37efeab2c8 100644 --- a/packages/jest-jasmine2/src/__tests__/itTestError.test.ts +++ b/packages/jest-jasmine2/src/__tests__/itTestError.test.ts @@ -16,13 +16,13 @@ describe('test/it error throwing', () => { }); it(`it throws an error when first argument isn't a string`, () => { expect(() => { - // @ts-ignore + // @ts-expect-error it(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); it('it throws an error when callback function is not a function', () => { expect(() => { - // @ts-ignore + // @ts-expect-error it('test3', 'test3b'); }).toThrowError( 'Invalid second argument, test3b. It must be a callback function.', @@ -37,13 +37,13 @@ describe('test/it error throwing', () => { }); test(`test throws an error when first argument isn't a string`, () => { expect(() => { - // @ts-ignore + // @ts-expect-error test(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); test('test throws an error when callback function is not a function', () => { expect(() => { - // @ts-ignore + // @ts-expect-error test('test6', 'test6b'); }).toThrowError( 'Invalid second argument, test6b. It must be a callback function.', diff --git a/packages/jest-jasmine2/src/__tests__/queueRunner.test.ts b/packages/jest-jasmine2/src/__tests__/queueRunner.test.ts index d98fe7fcfe3d..9cbf1570dac4 100644 --- a/packages/jest-jasmine2/src/__tests__/queueRunner.test.ts +++ b/packages/jest-jasmine2/src/__tests__/queueRunner.test.ts @@ -26,7 +26,7 @@ describe('queueRunner', () => { ], setTimeout, }; - // @ts-ignore + // @ts-expect-error await queueRunner(options); expect(fnOne).toHaveBeenCalled(); expect(fnTwo).toHaveBeenCalled(); @@ -50,7 +50,7 @@ describe('queueRunner', () => { ], setTimeout, }; - // @ts-ignore + // @ts-expect-error await queueRunner(options); expect(fnOne).toHaveBeenCalled(); expect(fail).toHaveBeenCalled(); @@ -79,7 +79,7 @@ describe('queueRunner', () => { ], setTimeout, }; - // @ts-ignore + // @ts-expect-error await queueRunner(options); expect(fnOne).toHaveBeenCalled(); expect(onException).toHaveBeenCalledWith(error); @@ -107,13 +107,13 @@ describe('queueRunner', () => { ], setTimeout, }; - // @ts-ignore + // @ts-expect-error await queueRunner(options); expect(fnOne).toHaveBeenCalled(); expect(onException).toHaveBeenCalled(); // i.e. the `message` of the error passed to `onException`. expect(onException.mock.calls[0][0].message).toEqual( - 'Timeout - Async callback was not invoked within the 0ms timeout ' + + 'Timeout - Async callback was not invoked within the 0 ms timeout ' + 'specified by jest.setTimeout.', ); expect(fnTwo).toHaveBeenCalled(); @@ -127,7 +127,7 @@ describe('queueRunner', () => { queueableFns: [{fn: failFn}], setTimeout, }; - // @ts-ignore + // @ts-expect-error await queueRunner(options); expect(options.fail).toHaveBeenCalledWith('miserably', 'failed'); @@ -152,7 +152,7 @@ describe('queueRunner', () => { ], setTimeout, }; - // @ts-ignore + // @ts-expect-error await queueRunner(options); expect(fnOne).toHaveBeenCalled(); expect(fail).toHaveBeenCalledWith(error); diff --git a/packages/jest-jasmine2/src/__tests__/reporter.test.ts b/packages/jest-jasmine2/src/__tests__/reporter.test.ts index 4e92f9b9cf4a..4bd50777fcc1 100644 --- a/packages/jest-jasmine2/src/__tests__/reporter.test.ts +++ b/packages/jest-jasmine2/src/__tests__/reporter.test.ts @@ -14,7 +14,7 @@ describe('Jasmine2Reporter', () => { let reporter: JasmineReporter; beforeEach(() => { - // @ts-ignore + // @ts-expect-error reporter = new JasmineReporter({}); }); @@ -28,11 +28,11 @@ describe('Jasmine2Reporter', () => { reporter.suiteStarted({description: 'parent'} as SuiteResult); reporter.suiteStarted({description: 'child'} as SuiteResult); reporter.specDone(makeSpec('spec 1')); - // @ts-ignore + // @ts-expect-error reporter.suiteDone(); reporter.suiteStarted({description: 'child 2'} as SuiteResult); reporter.specDone(makeSpec('spec 2')); - // @ts-ignore + // @ts-expect-error reporter.jasmineDone(); return reporter.getResults().then(runResults => { diff --git a/packages/jest-jasmine2/src/__tests__/todoError.test.ts b/packages/jest-jasmine2/src/__tests__/todoError.test.ts index 758cfda9140e..aab30f522aca 100644 --- a/packages/jest-jasmine2/src/__tests__/todoError.test.ts +++ b/packages/jest-jasmine2/src/__tests__/todoError.test.ts @@ -9,7 +9,7 @@ describe('test/it.todo error throwing', () => { it('it throws error when given no arguments', () => { expect(() => { - // @ts-ignore + // @ts-expect-error it.todo(); }).toThrowError('Todo must be called with only a description.'); }); @@ -20,7 +20,7 @@ describe('test/it.todo error throwing', () => { }); it('it throws error when given none string description', () => { expect(() => { - // @ts-ignore + // @ts-expect-error it.todo(() => {}); }).toThrowError('Todo must be called with only a description.'); }); diff --git a/packages/jest-jasmine2/src/assertionErrorMessage.ts b/packages/jest-jasmine2/src/assertionErrorMessage.ts index 98433f477fb8..9f252eec604c 100644 --- a/packages/jest-jasmine2/src/assertionErrorMessage.ts +++ b/packages/jest-jasmine2/src/assertionErrorMessage.ts @@ -95,7 +95,7 @@ const assertMatcherHint = ( function assertionErrorMessage( error: AssertionErrorWithStack, options: DiffOptions, -) { +): string { const {expected, actual, generatedMessage, message, operator, stack} = error; const diffString = diff(expected, actual, options); const hasCustomMessage = !generatedMessage; diff --git a/packages/jest-jasmine2/src/errorOnPrivate.ts b/packages/jest-jasmine2/src/errorOnPrivate.ts index b619dba153f9..0df3568af49a 100644 --- a/packages/jest-jasmine2/src/errorOnPrivate.ts +++ b/packages/jest-jasmine2/src/errorOnPrivate.ts @@ -53,7 +53,7 @@ export function installErrorOnPrivate(global: Global.Global): void { (Object.keys(disabledJasmineMethods) as Array< DisabledJasmineMethodsKeys >).forEach(methodName => { - // @ts-ignore + // @ts-expect-error jasmine[methodName] = () => { throwAtFunction(disabledJasmineMethods[methodName], jasmine[methodName]); }; diff --git a/packages/jest-jasmine2/src/expectationResultFactory.ts b/packages/jest-jasmine2/src/expectationResultFactory.ts index d7c8e6221520..d4533fdf3dcc 100644 --- a/packages/jest-jasmine2/src/expectationResultFactory.ts +++ b/packages/jest-jasmine2/src/expectationResultFactory.ts @@ -25,6 +25,9 @@ function messageFormatter({error, message, passed}: Options) { typeof error.message === 'string' && typeof error.name === 'string' ) { + if (error.message === '') { + return error.name; + } return `${error.name}: ${error.message}`; } return `thrown: ${prettyFormat(error, {maxDepth: 3})}`; diff --git a/packages/jest-jasmine2/src/index.ts b/packages/jest-jasmine2/src/index.ts index 03d2eebdc851..7c081b7846b1 100644 --- a/packages/jest-jasmine2/src/index.ts +++ b/packages/jest-jasmine2/src/index.ts @@ -52,7 +52,7 @@ async function jasmine2( const stack = getCallsite(1, runtime.getSourceMaps()); const it = originalIt(...args); - // @ts-ignore + // @ts-expect-error it.result.__callsite = stack; return it; @@ -63,7 +63,7 @@ async function jasmine2( const stack = getCallsite(1, runtime.getSourceMaps()); const xit = originalXit(...args); - // @ts-ignore + // @ts-expect-error xit.result.__callsite = stack; return xit; @@ -74,7 +74,7 @@ async function jasmine2( const stack = getCallsite(1, runtime.getSourceMaps()); const fit = originalFit(...args); - // @ts-ignore + // @ts-expect-error fit.result.__callsite = stack; return fit; @@ -93,8 +93,10 @@ async function jasmine2( environment.global.describe.skip = environment.global.xdescribe; environment.global.describe.only = environment.global.fdescribe; - if (config.timers === 'fake') { + if (config.timers === 'fake' || config.timers === 'legacy') { environment.fakeTimers!.useFakeTimers(); + } else if (config.timers === 'modern') { + environment.fakeTimersModern!.useFakeTimers(); } env.beforeEach(() => { @@ -109,7 +111,7 @@ async function jasmine2( if (config.resetMocks) { runtime.resetAllMocks(); - if (config.timers === 'fake') { + if (config.timers === 'fake' || config.timers === 'legacy') { environment.fakeTimers!.useFakeTimers(); } } @@ -156,7 +158,8 @@ async function jasmine2( }); for (const path of config.setupFilesAfterEnv) { - const esm = runtime.unstable_shouldLoadAsEsm(path); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(path); if (esm) { await runtime.unstable_importModule(path); @@ -177,7 +180,8 @@ async function jasmine2( env.specFilter = (spec: Spec) => testNameRegex.test(spec.getFullName()); } - const esm = runtime.unstable_shouldLoadAsEsm(testPath); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(testPath); if (esm) { await runtime.unstable_importModule(testPath); diff --git a/packages/jest-jasmine2/src/jasmine/Env.ts b/packages/jest-jasmine2/src/jasmine/Env.ts index a94173a7321f..cc2acc3eee6a 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.ts +++ b/packages/jest-jasmine2/src/jasmine/Env.ts @@ -384,7 +384,7 @@ export default function (j$: Jasmine) { suite.pend(); } if (currentDeclarationSuite.markedTodo) { - // @ts-ignore TODO Possible error: Suite does not have todo method + // @ts-expect-error TODO Possible error: Suite does not have todo method suite.todo(); } addSpecsToSuite(suite, specDefinitions); @@ -664,7 +664,7 @@ export default function (j$: Jasmine) { (error && error.name === AssertionError.name) ) { checkIsError = false; - // @ts-ignore TODO Possible error: j$.Spec does not have expand property + // @ts-expect-error TODO Possible error: j$.Spec does not have expand property message = assertionErrorMessage(error, {expand: j$.Spec.expand}); } else { const check = isError(error); diff --git a/packages/jest-jasmine2/src/jasmine/ReportDispatcher.ts b/packages/jest-jasmine2/src/jasmine/ReportDispatcher.ts index a4548b69b212..7995d25424d5 100644 --- a/packages/jest-jasmine2/src/jasmine/ReportDispatcher.ts +++ b/packages/jest-jasmine2/src/jasmine/ReportDispatcher.ts @@ -37,17 +37,17 @@ export default class ReportDispatcher implements Reporter { provideFallbackReporter: (reporter: Reporter) => void; clearReporters: () => void; - // @ts-ignore + // @ts-expect-error jasmineDone: (runDetails: RunDetails) => void; - // @ts-ignore + // @ts-expect-error jasmineStarted: (runDetails: RunDetails) => void; - // @ts-ignore + // @ts-expect-error specDone: (result: SpecResult) => void; - // @ts-ignore + // @ts-expect-error specStarted: (spec: SpecResult) => void; - // @ts-ignore + // @ts-expect-error suiteDone: (result: SuiteResult) => void; - // @ts-ignore + // @ts-expect-error suiteStarted: (result: SuiteResult) => void; constructor(methods: Array) { @@ -86,7 +86,7 @@ export default class ReportDispatcher implements Reporter { for (let i = 0; i < reporters.length; i++) { const reporter = reporters[i]; if (reporter[method]) { - // @ts-ignore + // @ts-expect-error reporter[method].apply(reporter, args); } } diff --git a/packages/jest-jasmine2/src/jasmine/Spec.ts b/packages/jest-jasmine2/src/jasmine/Spec.ts index a8d4e53a5685..8f0bcdfe5db4 100644 --- a/packages/jest-jasmine2/src/jasmine/Spec.ts +++ b/packages/jest-jasmine2/src/jasmine/Spec.ts @@ -142,7 +142,7 @@ export default class Spec { this.queueableFn.initError = this.initError; - // @ts-ignore + // @ts-expect-error this.result = { id: this.id, description: this.description, @@ -192,7 +192,7 @@ export default class Spec { this.currentRun = this.queueRunnerFactory({ queueableFns: allFns, onException() { - // @ts-ignore + // @ts-expect-error self.onException.apply(self, arguments); }, userContext: this.userContext(), diff --git a/packages/jest-jasmine2/src/jestExpect.ts b/packages/jest-jasmine2/src/jestExpect.ts index 6d8cf5a9cb63..e0495cb9f0b7 100644 --- a/packages/jest-jasmine2/src/jestExpect.ts +++ b/packages/jest-jasmine2/src/jestExpect.ts @@ -59,12 +59,12 @@ export default (config: {expand: boolean}): void => { return this.isNot ? negativeCompare.apply( null, - // @ts-ignore + // @ts-expect-error args, ) : result.compare.apply( null, - // @ts-ignore + // @ts-expect-error args, ); }; diff --git a/packages/jest-jasmine2/src/queueRunner.ts b/packages/jest-jasmine2/src/queueRunner.ts index c20c6d601cbb..21af10a51de6 100644 --- a/packages/jest-jasmine2/src/queueRunner.ts +++ b/packages/jest-jasmine2/src/queueRunner.ts @@ -5,7 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -// @ts-ignore ignore vendor file +import {formatTime} from 'jest-util'; +// @ts-expect-error ignore vendor file import PCancelable from './PCancelable'; import pTimeout from './pTimeout'; @@ -71,8 +72,8 @@ export default function queueRunner(options: Options) { () => { initError.message = 'Timeout - Async callback was not invoked within the ' + - timeoutMs + - 'ms timeout specified by jest.setTimeout.'; + formatTime(timeoutMs) + + ' timeout specified by jest.setTimeout.'; initError.stack = initError.message + initError.stack; options.onException(initError); }, diff --git a/packages/jest-jasmine2/src/treeProcessor.ts b/packages/jest-jasmine2/src/treeProcessor.ts index 5bd4eeebe255..e46b9abfaca8 100644 --- a/packages/jest-jasmine2/src/treeProcessor.ts +++ b/packages/jest-jasmine2/src/treeProcessor.ts @@ -23,7 +23,7 @@ export type TreeNode = { onException: (error: Error) => void; sharedUserContext: () => any; children?: Array; -} & Pick; +} & Pick; export default function treeProcessor(options: Options): void { const { @@ -64,11 +64,11 @@ export default function treeProcessor(options: Options): void { }; } - function hasEnabledTest(node: TreeNode): boolean { + function hasNoEnabledTest(node: TreeNode): boolean { if (node.children) { - return node.children.some(hasEnabledTest); + return node.children.every(hasNoEnabledTest); } - return !node.disabled; + return node.disabled || node.markedPending; } function wrapChildren(node: TreeNode, enabled: boolean) { @@ -78,7 +78,7 @@ export default function treeProcessor(options: Options): void { const children = node.children.map(child => ({ fn: getNodeHandler(child, enabled), })); - if (!hasEnabledTest(node)) { + if (hasNoEnabledTest(node)) { return children; } return node.beforeAllFns.concat(children).concat(node.afterAllFns); diff --git a/packages/jest-leak-detector/package.json b/packages/jest-leak-detector/package.json index 1cfcbab61a70..c453f56aaae8 100644 --- a/packages/jest-leak-detector/package.json +++ b/packages/jest-leak-detector/package.json @@ -1,6 +1,6 @@ { "name": "jest-leak-detector", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,23 +9,16 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "jest-get-type": "^25.2.6", - "pretty-format": "^25.4.0" + "jest-get-type": "^26.0.0", + "pretty-format": "^26.0.1" }, "devDependencies": { "@types/weak-napi": "^1.0.0", - "weak-napi": "^1.0.3" + "weak-napi": "^2.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-leak-detector/src/__tests__/index.test.ts b/packages/jest-leak-detector/src/__tests__/index.test.ts index 1d8f0c6f0896..e5833ccf3acd 100644 --- a/packages/jest-leak-detector/src/__tests__/index.test.ts +++ b/packages/jest-leak-detector/src/__tests__/index.test.ts @@ -31,7 +31,7 @@ it('complains if the value is a primitive', () => { it('does not show the GC if hidden', async () => { const detector = new LeakDetector({}); - // @ts-ignore: purposefully removed + // @ts-expect-error: purposefully removed global.gc = undefined; await detector.isLeaking(); expect(global.gc).not.toBeDefined(); diff --git a/packages/jest-matcher-utils/package.json b/packages/jest-matcher-utils/package.json index d0e896a247f4..1ef5f889f1cf 100644 --- a/packages/jest-matcher-utils/package.json +++ b/packages/jest-matcher-utils/package.json @@ -1,33 +1,26 @@ { "name": "jest-matcher-utils", "description": "A set of utility functions for expect and related packages", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-matcher-utils" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "chalk": "^3.0.0", - "jest-diff": "^25.4.0", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.4.0" + "chalk": "^4.0.0", + "jest-diff": "^26.0.1", + "jest-get-type": "^26.0.0", + "pretty-format": "^26.0.1" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "@types/node": "*" }, "publishConfig": { diff --git a/packages/jest-matcher-utils/src/__tests__/index.test.ts b/packages/jest-matcher-utils/src/__tests__/index.test.ts index 2afa9f79de62..96412e07d461 100644 --- a/packages/jest-matcher-utils/src/__tests__/index.test.ts +++ b/packages/jest-matcher-utils/src/__tests__/index.test.ts @@ -105,12 +105,12 @@ describe('stringify()', () => { describe('ensureNumbers()', () => { test('dont throw error when variables are numbers', () => { expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(1, 2); }).not.toThrow(); if (isBigIntDefined) { expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(BigInt(1), BigInt(2)); }).not.toThrow(); } @@ -118,14 +118,14 @@ describe('ensureNumbers()', () => { test('throws error when expected is not a number (backward compatibility)', () => { expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(1, 'not_a_number', '.toBeCloseTo'); }).toThrowErrorMatchingSnapshot(); }); test('throws error when received is not a number (backward compatibility)', () => { expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers('not_a_number', 3, '.toBeCloseTo'); }).toThrowErrorMatchingSnapshot(); }); @@ -140,7 +140,7 @@ describe('ensureNumbers()', () => { secondArgument: 'precision', }; expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers('', 0, matcherName, options); }).toThrowErrorMatchingSnapshot(); }); @@ -151,7 +151,7 @@ describe('ensureNumbers()', () => { // promise undefined is equivalent to empty string }; expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(0.1, undefined, matcherName, options); }).toThrowErrorMatchingSnapshot(); }); @@ -162,7 +162,7 @@ describe('ensureNumbers()', () => { promise: 'rejects', }; expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(0.01, '0', matcherName, options); }).toThrowErrorMatchingSnapshot(); }); @@ -173,7 +173,7 @@ describe('ensureNumbers()', () => { promise: 'rejects', }; expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(Symbol('0.1'), 0, matcherName, options); }).toThrowErrorMatchingSnapshot(); }); @@ -184,7 +184,7 @@ describe('ensureNumbers()', () => { promise: 'resolves', }; expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(false, 0, matcherName, options); }).toThrowErrorMatchingSnapshot(); }); @@ -195,7 +195,7 @@ describe('ensureNumbers()', () => { promise: 'resolves', }; expect(() => { - // @ts-ignore + // @ts-expect-error ensureNumbers(0.1, null, matcherName, options); }).toThrowErrorMatchingSnapshot(); }); @@ -205,7 +205,7 @@ describe('ensureNumbers()', () => { describe('ensureNoExpected()', () => { test('dont throw error when undefined', () => { expect(() => { - // @ts-ignore + // @ts-expect-error ensureNoExpected(undefined); }).not.toThrow(); }); diff --git a/packages/jest-message-util/package.json b/packages/jest-message-util/package.json index 4f579e9d82da..a05bf137adde 100644 --- a/packages/jest-message-util/package.json +++ b/packages/jest-message-util/package.json @@ -1,35 +1,30 @@ { "name": "jest-message-util", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-message-util" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/code-frame": "^7.0.0", - "@jest/types": "^25.4.0", + "@jest/types": "^26.0.1", "@types/stack-utils": "^1.0.1", - "chalk": "^3.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", "micromatch": "^4.0.2", "slash": "^3.0.0", - "stack-utils": "^1.0.1" + "stack-utils": "^2.0.2" }, "devDependencies": { "@types/babel__code-frame": "^7.0.0", + "@types/graceful-fs": "^4.1.3", "@types/micromatch": "^4.0.0" }, "publishConfig": { diff --git a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap index 99256df0436c..ccce82f85b46 100644 --- a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap +++ b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.ts.snap @@ -31,7 +31,6 @@ exports[`formatStackTrace should strip node internals 1`] = ` \\"string\\" at Object.it (__tests__/test.js:8:14) - at internal/process/next_tick.js:188:7 " `; diff --git a/packages/jest-message-util/src/__tests__/messages.test.ts b/packages/jest-message-util/src/__tests__/messages.test.ts index e4b3d3bf8dad..55c24797cb58 100644 --- a/packages/jest-message-util/src/__tests__/messages.test.ts +++ b/packages/jest-message-util/src/__tests__/messages.test.ts @@ -6,14 +6,14 @@ * */ -import {readFileSync} from 'fs'; +import {readFileSync} from 'graceful-fs'; import slash = require('slash'); import tempy = require('tempy'); import {formatExecError, formatResultsErrors, formatStackTrace} from '..'; const rootDir = tempy.directory(); -jest.mock('fs', () => ({ +jest.mock('graceful-fs', () => ({ ...jest.requireActual('fs'), readFileSync: jest.fn(), })); diff --git a/packages/jest-message-util/src/index.ts b/packages/jest-message-util/src/index.ts index e205c823d648..4b49f66dab5d 100644 --- a/packages/jest-message-util/src/index.ts +++ b/packages/jest-message-util/src/index.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import type {Config, TestResult} from '@jest/types'; import chalk = require('chalk'); import micromatch = require('micromatch'); diff --git a/packages/jest-mock/package.json b/packages/jest-mock/package.json index 294324e7630d..b883b188f2c4 100644 --- a/packages/jest-mock/package.json +++ b/packages/jest-mock/package.json @@ -1,16 +1,16 @@ { "name": "jest-mock", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-mock" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "dependencies": { - "@jest/types": "^25.4.0" + "@jest/types": "^26.0.1" }, "devDependencies": { "@types/node": "*" @@ -18,14 +18,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, - "browser": "build-es5/index.js", "publishConfig": { "access": "public" }, diff --git a/packages/jest-mock/src/index.ts b/packages/jest-mock/src/index.ts index a72847029b0d..7251b0a9ec02 100644 --- a/packages/jest-mock/src/index.ts +++ b/packages/jest-mock/src/index.ts @@ -417,7 +417,6 @@ class ModuleMockerClass { if (!isReadonlyProp(object, prop)) { const propDesc = Object.getOwnPropertyDescriptor(object, prop); - // @ts-ignore Object.__esModule if ((propDesc !== undefined && !propDesc.get) || object.__esModule) { slots.add(prop); } @@ -566,11 +565,11 @@ class ModuleMockerClass { // it easier to interact with mock instance call and // return values if (prototype[slot].type === 'function') { - // @ts-ignore no index signature + // @ts-expect-error no index signature const protoImpl = this[slot]; - // @ts-ignore no index signature + // @ts-expect-error no index signature this[slot] = mocker.generateFromMetadata(prototype[slot]); - // @ts-ignore no index signature + // @ts-expect-error no index signature this[slot]._protoImpl = protoImpl; } }); @@ -795,7 +794,7 @@ class ModuleMockerClass { ): Mock { // metadata not compatible but it's the same type, maybe problem with // overloading of _makeComponent and not _generateMock? - // @ts-ignore + // @ts-expect-error const mock = this._makeComponent(metadata); if (metadata.refID != null) { refs[metadata.refID] = mock; @@ -823,7 +822,7 @@ class ModuleMockerClass { mock.prototype.constructor = mock; } - return mock; + return mock as Mock; } /** @@ -870,11 +869,11 @@ class ModuleMockerClass { metadata.value = component; return metadata; } else if (type === 'function') { - // @ts-ignore this is a function so it has a name + // @ts-expect-error this is a function so it has a name metadata.name = component.name; - // @ts-ignore may be a mock + // @ts-expect-error may be a mock if (component._isMockFunction === true) { - // @ts-ignore may be a mock + // @ts-expect-error may be a mock metadata.mockImpl = component.getMockImplementation(); } } @@ -890,13 +889,13 @@ class ModuleMockerClass { this._getSlots(component).forEach(slot => { if ( type === 'function' && - // @ts-ignore may be a mock + // @ts-expect-error may be a mock component._isMockFunction === true && slot.match(/^mock/) ) { return; } - // @ts-ignore no index signature + // @ts-expect-error no index signature const slotMetadata = this.getMetadata(component[slot], refs); if (slotMetadata) { if (!members) { @@ -978,7 +977,7 @@ class ModuleMockerClass { const isMethodOwner = object.hasOwnProperty(methodName); - // @ts-ignore overriding original method with a Mock + // @ts-expect-error overriding original method with a Mock object[methodName] = this._makeComponent({type: 'function'}, () => { if (isMethodOwner) { object[methodName] = original; @@ -987,7 +986,7 @@ class ModuleMockerClass { } }); - // @ts-ignore original method is now a Mock + // @ts-expect-error original method is now a Mock object[methodName].mockImplementation(function (this: unknown) { return original.apply(this, arguments); }); @@ -1052,9 +1051,9 @@ class ModuleMockerClass { ); } - // @ts-ignore: mock is assignable + // @ts-expect-error: mock is assignable descriptor[accessType] = this._makeComponent({type: 'function'}, () => { - // @ts-ignore: mock is assignable + // @ts-expect-error: mock is assignable descriptor![accessType] = original; Object.defineProperty(obj, propertyName, descriptor!); }); @@ -1062,7 +1061,7 @@ class ModuleMockerClass { (descriptor[accessType] as Mock).mockImplementation(function ( this: unknown, ) { - // @ts-ignore + // @ts-expect-error return original.apply(this, arguments); }); } diff --git a/packages/jest-phabricator/README.md b/packages/jest-phabricator/README.md index 97a3fdf505be..c657a1f7276c 100644 --- a/packages/jest-phabricator/README.md +++ b/packages/jest-phabricator/README.md @@ -16,6 +16,15 @@ You need to add the jest unit engine to your .arcconfig: ... ``` +Or use the `ArcanistConfigurationDrivenUnitTestEngine` and add an entry to your .arcunit + +```json +"jest": { + "type": "jest", + "include": "(\\.js$)" +} +``` + In `JestUnitTestEngine` there are a couple of constants you probably need to modify: - `PROCESSOR` points to the path or the processor @@ -26,12 +35,16 @@ If you need to pass to Jest a custom configuration you can either use `JEST_PATH ## Reference implementation ```php -class JestUnitTestEngine extends ArcanistBaseUnitTestEngine { +final class JestUnitTestEngine extends ArcanistUnitTestEngine { const PROCESSOR = 'jest/packages/jest-phabricator/build/index.js'; const JEST_PATH = 'jest/packages/jest/bin/jest.js'; const TOO_MANY_FILES_TO_COVER = 100; const GIGANTIC_DIFF_THRESHOLD = 200; + public function getEngineConfigurationName() { + return 'jest'; + } + private function getRoot() { return $this->getWorkingCopy()->getProjectRoot(); } @@ -129,6 +142,9 @@ class JestUnitTestEngine extends ArcanistBaseUnitTestEngine { $results[] = $this->getFutureResults($future); } + if (empty($results)) { + return array(); + } return call_user_func_array('array_merge', $results); } @@ -177,6 +193,7 @@ class JestUnitTestEngine extends ArcanistBaseUnitTestEngine { } $console->writeOut("Finished tests.\n"); + // $console->writeErr(implode(', ', $result_arrays)); return call_user_func_array('array_merge', $result_arrays); } @@ -184,8 +201,8 @@ class JestUnitTestEngine extends ArcanistBaseUnitTestEngine { $output_JSON = $this->getOutputJSON(); $options = array( '--colors', - '--findRelatedTests', '--json', + '--passWithNoTests true', '--outputFile=' . $output_JSON, '--testResultsProcessor=' . self::PROCESSOR ); @@ -194,6 +211,7 @@ class JestUnitTestEngine extends ArcanistBaseUnitTestEngine { // A better solution would involve knowing what's the machine buffer size limit // for exec and check if the command can stay within it. if (count($paths) < self::TOO_MANY_FILES_TO_COVER) { + $options[] = '--findRelatedTests ' . join(' ', $paths); $options[] = '--coverage'; $options[] = '--collectCoverageOnlyFrom '. join(' ', $paths); } diff --git a/packages/jest-phabricator/package.json b/packages/jest-phabricator/package.json index 3d0b2297fe44..927731a07662 100644 --- a/packages/jest-phabricator/package.json +++ b/packages/jest-phabricator/package.json @@ -1,24 +1,17 @@ { "name": "jest-phabricator", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-phabricator" }, "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/test-result": "^25.4.0" + "@jest/test-result": "^26.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", diff --git a/packages/jest-regex-util/package.json b/packages/jest-regex-util/package.json index e7b7206e03eb..0886157f4865 100644 --- a/packages/jest-regex-util/package.json +++ b/packages/jest-regex-util/package.json @@ -1,6 +1,6 @@ { "name": "jest-regex-util", - "version": "25.2.6", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -10,18 +10,11 @@ "@types/node": "*" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-regex-util/src/__tests__/index.test.ts b/packages/jest-regex-util/src/__tests__/index.test.ts index ca3ed9d1001f..ecfa008fd662 100644 --- a/packages/jest-regex-util/src/__tests__/index.test.ts +++ b/packages/jest-regex-util/src/__tests__/index.test.ts @@ -10,7 +10,10 @@ describe('replacePathSepForRegex()', () => { describe('posix', () => { beforeAll(() => { - jest.mock('path', () => ({...jest.genMockFromModule('path'), sep: '/'})); + jest.mock('path', () => ({ + ...jest.createMockFromModule('path'), + sep: '/', + })); jest.isolateModules(() => { replacePathSepForRegex = require('../').replacePathSepForRegex; }); @@ -24,7 +27,10 @@ describe('replacePathSepForRegex()', () => { describe('win32', () => { beforeAll(() => { - jest.mock('path', () => ({...jest.genMockFromModule('path'), sep: '\\'})); + jest.mock('path', () => ({ + ...jest.createMockFromModule('path'), + sep: '\\', + })); jest.isolateModules(() => { replacePathSepForRegex = require('../').replacePathSepForRegex; }); diff --git a/packages/jest-repl/package.json b/packages/jest-repl/package.json index b93eeb57cfc3..fd1b1d69f98e 100644 --- a/packages/jest-repl/package.json +++ b/packages/jest-repl/package.json @@ -1,6 +1,6 @@ { "name": "jest-repl", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,29 +9,22 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/transform": "^25.4.0", - "@jest/types": "^25.4.0", - "jest-config": "^25.4.0", - "jest-runtime": "^25.4.0", - "jest-validate": "^25.4.0", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-config": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-validate": "^26.0.1", "repl": "^0.1.3", "yargs": "^15.3.1" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "@types/yargs": "^15.0.0" }, "bin": "./bin/jest-repl.js", "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-repl/src/cli/index.ts b/packages/jest-repl/src/cli/index.ts index 94728bc9d1b1..9d027435023c 100644 --- a/packages/jest-repl/src/cli/index.ts +++ b/packages/jest-repl/src/cli/index.ts @@ -21,7 +21,6 @@ const REPL_SCRIPT = require.resolve('./repl.js'); export = function (): void { const argv = yargs.usage(args.usage).options(args.options).argv; - // @ts-ignore: fix this at some point validateCLIOptions(argv, {...args.options, deprecationEntries}); argv._ = [REPL_SCRIPT]; diff --git a/packages/jest-reporters/package.json b/packages/jest-reporters/package.json index d9ca29b2bbb8..02c2d0eff3ce 100644 --- a/packages/jest-reporters/package.json +++ b/packages/jest-reporters/package.json @@ -1,44 +1,39 @@ { "name": "@jest/reporters", "description": "Jest's reporters", - "version": "25.4.0", + "version": "26.0.1", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^25.4.0", - "@jest/test-result": "^25.4.0", - "@jest/transform": "^25.4.0", - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", + "@jest/console": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.2", + "graceful-fs": "^4.2.4", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-instrument": "^4.0.3", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", - "jest-haste-map": "^25.4.0", - "jest-resolve": "^25.4.0", - "jest-util": "^25.4.0", - "jest-worker": "^25.4.0", + "jest-haste-map": "^26.0.1", + "jest-resolve": "^26.0.1", + "jest-util": "^26.0.1", + "jest-worker": "^26.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", - "string-length": "^3.1.0", + "string-length": "^4.0.1", "terminal-link": "^2.0.0", "v8-to-istanbul": "^4.1.3" }, "devDependencies": { "@types/exit": "^0.1.30", "@types/glob": "^7.1.1", + "@types/graceful-fs": "^4.1.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-lib-instrument": "^1.7.2", "@types/istanbul-lib-report": "^3.0.0", @@ -49,10 +44,10 @@ "strip-ansi": "^6.0.0" }, "optionalDependencies": { - "node-notifier": "^6.0.0" + "node-notifier": "^7.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "repository": { "type": "git", diff --git a/packages/jest-reporters/src/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-reporters/src/__tests__/__snapshots__/summary_reporter.test.js.snap index 81cc12f595a4..93092c94bb4c 100644 --- a/packages/jest-reporters/src/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-reporters/src/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -13,7 +13,7 @@ exports[`snapshots all have results (after update) 1`] = ` Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 1 failed, 1 removed, 1 file removed, 1 updated, 1 written, 2 passed, 2 total -Time: 0.01s +Time: 0.01 s Ran all test suites. " `; @@ -31,7 +31,7 @@ exports[`snapshots all have results (no update) 1`] = ` Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 1 failed, 1 obsolete, 1 file obsolete, 1 updated, 1 written, 2 passed, 2 total -Time: 0.01s +Time: 0.01 s Ran all test suites. " `; @@ -43,7 +43,7 @@ exports[`snapshots needs update with npm test 1`] = ` Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 2 failed, 2 total -Time: 0.01s +Time: 0.01 s Ran all test suites. " `; @@ -55,7 +55,7 @@ exports[`snapshots needs update with yarn test 1`] = ` Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 2 failed, 2 total -Time: 0.01s +Time: 0.01 s Ran all test suites. " `; diff --git a/packages/jest-reporters/src/__tests__/coverage_reporter.test.js b/packages/jest-reporters/src/__tests__/coverage_reporter.test.js index 7e1cf5c4ceb6..e15df8cbdd59 100644 --- a/packages/jest-reporters/src/__tests__/coverage_reporter.test.js +++ b/packages/jest-reporters/src/__tests__/coverage_reporter.test.js @@ -13,7 +13,7 @@ jest summarizers: {pkg: jest.fn(() => ({visit: jest.fn()}))}, })) .mock('istanbul-reports', () => ({ - ...jest.genMockFromModule('istanbul-reports'), + ...jest.createMockFromModule('istanbul-reports'), create: jest.fn(() => ({execute: jest.fn()})), })); diff --git a/packages/jest-reporters/src/__tests__/coverage_worker.test.js b/packages/jest-reporters/src/__tests__/coverage_worker.test.js index 86cfeecb1ab3..913cf4753c9a 100644 --- a/packages/jest-reporters/src/__tests__/coverage_worker.test.js +++ b/packages/jest-reporters/src/__tests__/coverage_worker.test.js @@ -7,7 +7,7 @@ 'use strict'; -jest.mock('fs').mock('../generateEmptyCoverage'); +jest.mock('graceful-fs').mock('../generateEmptyCoverage'); const globalConfig = {collectCoverage: true}; const config = {}; @@ -20,7 +20,7 @@ let worker; beforeEach(() => { jest.resetModules(); - fs = require('fs'); + fs = require('graceful-fs'); generateEmptyCoverage = require('../generateEmptyCoverage').default; worker = require('../coverage_worker').worker; }); diff --git a/packages/jest-reporters/src/__tests__/utils.test.ts b/packages/jest-reporters/src/__tests__/utils.test.ts index b23fcc2e63b9..8e1887daf7f5 100644 --- a/packages/jest-reporters/src/__tests__/utils.test.ts +++ b/packages/jest-reporters/src/__tests__/utils.test.ts @@ -118,7 +118,10 @@ describe('printDisplayName', () => { expect( printDisplayName( makeProjectConfig({ - displayName: 'hello', + displayName: { + color: 'white', + name: 'hello', + }, }), ), ).toMatchSnapshot(); diff --git a/packages/jest-reporters/src/coverage_reporter.ts b/packages/jest-reporters/src/coverage_reporter.ts index 1e87c21bdbd8..7b4ded54abe5 100644 --- a/packages/jest-reporters/src/coverage_reporter.ts +++ b/packages/jest-reporters/src/coverage_reporter.ts @@ -6,7 +6,7 @@ */ import * as path from 'path'; -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import type { AggregatedResult, @@ -96,10 +96,9 @@ export default class CoverageReporter extends BaseReporter { maxCols: process.stdout.columns || Infinity, ...additionalOptions, }) - // @ts-ignore + // @ts-expect-error .execute(reportContext); }); - // @ts-ignore aggregatedResults.coverageMap = map; } catch (e) { console.error( @@ -111,7 +110,6 @@ export default class CoverageReporter extends BaseReporter { ); } - // @ts-ignore this._checkThreshold(map); } @@ -487,19 +485,13 @@ export default class CoverageReporter extends BaseReporter { } const map = await this._sourceMapStore.transformCoverage(this._coverageMap); - const reportContext = istanbulReport.createContext( - // @ts-ignore - { - // @ts-ignore - coverageMap: map, - dir: this._globalConfig.coverageDirectory, - // @ts-ignore - sourceFinder: this._sourceMapStore.sourceFinder, - watermarks: getWatermarks(this._globalConfig), - }, - ); + const reportContext = istanbulReport.createContext({ + coverageMap: map, + dir: this._globalConfig.coverageDirectory, + sourceFinder: this._sourceMapStore.sourceFinder, + watermarks: getWatermarks(this._globalConfig), + }); - // @ts-ignore return {map, reportContext}; } } diff --git a/packages/jest-reporters/src/coverage_worker.ts b/packages/jest-reporters/src/coverage_worker.ts index d1894b97574c..f40c1aadc3d4 100644 --- a/packages/jest-reporters/src/coverage_worker.ts +++ b/packages/jest-reporters/src/coverage_worker.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import exit = require('exit'); import type {CoverageReporterSerializedOptions} from './types'; diff --git a/packages/jest-reporters/src/generateEmptyCoverage.ts b/packages/jest-reporters/src/generateEmptyCoverage.ts index 38f184d61558..e4f35e7c02cf 100644 --- a/packages/jest-reporters/src/generateEmptyCoverage.ts +++ b/packages/jest-reporters/src/generateEmptyCoverage.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import {readInitialCoverage} from 'istanbul-lib-instrument'; import {FileCoverage, createFileCoverage} from 'istanbul-lib-coverage'; diff --git a/packages/jest-reporters/src/get_result_header.ts b/packages/jest-reporters/src/get_result_header.ts index ff2c951cf039..2b9dd7b25403 100644 --- a/packages/jest-reporters/src/get_result_header.ts +++ b/packages/jest-reporters/src/get_result_header.ts @@ -8,6 +8,7 @@ import type {Config} from '@jest/types'; import type {TestResult} from '@jest/test-result'; import chalk = require('chalk'); +import {formatTime} from 'jest-util'; import {formatTestPath, printDisplayName} from './utils'; import terminalLink = require('terminal-link'); @@ -47,7 +48,7 @@ export default ( const testDetail = []; if (runTime !== null && runTime > 5) { - testDetail.push(LONG_TEST_COLOR(runTime + 's')); + testDetail.push(LONG_TEST_COLOR(formatTime(runTime, 0))); } if (result.memoryUsage) { diff --git a/packages/jest-reporters/src/notify_reporter.ts b/packages/jest-reporters/src/notify_reporter.ts index 2fda318987d3..f6186f078ca9 100644 --- a/packages/jest-reporters/src/notify_reporter.ts +++ b/packages/jest-reporters/src/notify_reporter.ts @@ -79,7 +79,6 @@ export default class NotifyReporter extends BaseReporter { result.numPassedTests, )} passed`; - // @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42303 this._notifier.notify({icon, message, timeout: false, title}); } else if ( testsHaveRun && @@ -108,7 +107,6 @@ export default class NotifyReporter extends BaseReporter { const quitAnswer = 'Exit tests'; if (!watchMode) { - // @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42303 this._notifier.notify({icon, message, timeout: false, title}); } else { this._notifier.notify( diff --git a/packages/jest-reporters/src/utils.ts b/packages/jest-reporters/src/utils.ts index fbb85e1166d7..752e7c9f60f2 100644 --- a/packages/jest-reporters/src/utils.ts +++ b/packages/jest-reporters/src/utils.ts @@ -10,7 +10,7 @@ import type {Config} from '@jest/types'; import type {AggregatedResult} from '@jest/test-result'; import chalk = require('chalk'); import slash = require('slash'); -import {pluralize} from 'jest-util'; +import {formatTime, pluralize} from 'jest-util'; import type {SummaryOptions} from './types'; const PROGRESS_BAR_WIDTH = 40; @@ -22,10 +22,6 @@ export const printDisplayName = (config: Config.ProjectConfig): string => { return ''; } - if (typeof displayName === 'string') { - return chalk.supportsColor ? white(` ${displayName} `) : displayName; - } - const {name, color} = displayName; const chosenColor = chalk.reset.inverse[color] ? chalk.reset.inverse[color] @@ -185,11 +181,11 @@ const renderTime = (runTime: number, estimatedTime: number, width: number) => { // If we are more than one second over the estimated time, highlight it. const renderedTime = estimatedTime && runTime >= estimatedTime + 1 - ? chalk.bold.yellow(runTime + 's') - : runTime + 's'; + ? chalk.bold.yellow(formatTime(runTime, 0)) + : formatTime(runTime, 0); let time = chalk.bold(`Time:`) + ` ${renderedTime}`; if (runTime < estimatedTime) { - time += `, estimated ${estimatedTime}s`; + time += `, estimated ${formatTime(estimatedTime, 0)}`; } // Only show a progress bar if the test run is actually going to take diff --git a/packages/jest-reporters/src/verbose_reporter.ts b/packages/jest-reporters/src/verbose_reporter.ts index 98f0877d449a..61620532170a 100644 --- a/packages/jest-reporters/src/verbose_reporter.ts +++ b/packages/jest-reporters/src/verbose_reporter.ts @@ -13,7 +13,7 @@ import type { TestResult, } from '@jest/test-result'; import chalk = require('chalk'); -import {specialChars} from 'jest-util'; +import {formatTime, specialChars} from 'jest-util'; import type {Test} from './types'; import DefaultReporter from './default_reporter'; @@ -107,7 +107,9 @@ export default class VerboseReporter extends DefaultReporter { private _logTest(test: AssertionResult, indentLevel: number) { const status = this._getIcon(test.status); - const time = test.duration ? ` (${test.duration.toFixed(0)}ms)` : ''; + const time = test.duration + ? ` (${formatTime(Math.round(test.duration))})` + : ''; this._logLine(status + ' ' + chalk.dim(test.title + time), indentLevel); } diff --git a/packages/jest-resolve-dependencies/package.json b/packages/jest-resolve-dependencies/package.json index 91ff489f1bab..f669ee56e6d3 100644 --- a/packages/jest-resolve-dependencies/package.json +++ b/packages/jest-resolve-dependencies/package.json @@ -1,6 +1,6 @@ { "name": "jest-resolve-dependencies", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,25 +9,18 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "jest-regex-util": "^25.2.6", - "jest-snapshot": "^25.4.0" + "@jest/types": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-snapshot": "^26.0.1" }, "devDependencies": { - "jest-haste-map": "^25.4.0", - "jest-resolve": "^25.4.0", - "jest-runtime": "^25.4.0" + "jest-haste-map": "^26.0.1", + "jest-resolve": "^26.0.1", + "jest-runtime": "^26.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-resolve/package.json b/packages/jest-resolve/package.json index 7dc336af75c3..2a5702e0ef43 100644 --- a/packages/jest-resolve/package.json +++ b/packages/jest-resolve/package.json @@ -1,6 +1,6 @@ { "name": "jest-resolve", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,30 +9,23 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "browser-resolve": "^1.11.3", - "chalk": "^3.0.0", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", "jest-pnp-resolver": "^1.2.1", + "jest-util": "^26.0.1", "read-pkg-up": "^7.0.1", - "realpath-native": "^2.0.0", "resolve": "^1.17.0", "slash": "^3.0.0" }, "devDependencies": { - "@types/browser-resolve": "^1.11.0", - "@types/resolve": "^1.14.0", - "jest-haste-map": "^25.4.0" + "@types/graceful-fs": "^4.1.3", + "@types/resolve": "^1.17.0", + "jest-haste-map": "^26.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-resolve/src/__tests__/resolve.test.ts b/packages/jest-resolve/src/__tests__/resolve.test.ts index 9e5499c5832f..c7d985a0b523 100644 --- a/packages/jest-resolve/src/__tests__/resolve.test.ts +++ b/packages/jest-resolve/src/__tests__/resolve.test.ts @@ -6,11 +6,11 @@ * */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import {ModuleMap} from 'jest-haste-map'; import Resolver = require('../'); -// @ts-ignore: js file +// @ts-expect-error: js file import userResolver from '../__mocks__/userResolver'; import nodeModulesPaths from '../nodeModulesPaths'; import defaultResolver from '../defaultResolver'; @@ -234,8 +234,11 @@ describe('Resolver.getModulePaths() -> nodeModulesPaths()', () => { // pathstrings instead of actually trying to access the physical directory. // This test suite won't work otherwise, since we cannot make assumptions // about the test environment when it comes to absolute paths. - jest.doMock('realpath-native', () => ({ - sync: (dirInput: string) => dirInput, + jest.doMock('graceful-fs', () => ({ + ...jest.requireActual('graceful-fs'), + realPathSync: { + native: (dirInput: string) => dirInput, + }, })); }); diff --git a/packages/jest-resolve/src/defaultResolver.ts b/packages/jest-resolve/src/defaultResolver.ts index 0e20699364ba..b62270dab5c3 100644 --- a/packages/jest-resolve/src/defaultResolver.ts +++ b/packages/jest-resolve/src/defaultResolver.ts @@ -5,11 +5,10 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import {sync as resolveSync} from 'resolve'; -import {sync as browserResolve} from 'browser-resolve'; -import {sync as realpath} from 'realpath-native'; import pnpResolver from 'jest-pnp-resolver'; +import {tryRealpath} from 'jest-util'; import type {Config} from '@jest/types'; type ResolverOptions = { @@ -26,14 +25,12 @@ export default function defaultResolver( path: Config.Path, options: ResolverOptions, ): Config.Path { - // @ts-ignore: the "pnp" version named isn't in DefinitelyTyped + // @ts-expect-error: the "pnp" version named isn't in DefinitelyTyped if (process.versions.pnp) { return pnpResolver(path, options); } - const resolve = options.browser ? browserResolve : resolveSync; - - const result = resolve(path, { + const result = resolveSync(path, { basedir: options.basedir, extensions: options.extensions, isDirectory, @@ -41,7 +38,6 @@ export default function defaultResolver( moduleDirectory: options.moduleDirectory, paths: options.paths, preserveSymlinks: false, - // @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44137 realpathSync, }); @@ -98,17 +94,7 @@ function realpathCached(path: Config.Path): Config.Path { return result; } - try { - result = realpath(path); - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } - } - - if (!result) { - result = path; - } + result = tryRealpath(path); checkedRealpathPaths.set(path, result); diff --git a/packages/jest-resolve/src/index.ts b/packages/jest-resolve/src/index.ts index 00faa0e5f535..42d4bf44afca 100644 --- a/packages/jest-resolve/src/index.ts +++ b/packages/jest-resolve/src/index.ts @@ -8,14 +8,15 @@ import * as path from 'path'; import type {Config} from '@jest/types'; import type {ModuleMap} from 'jest-haste-map'; -import {sync as realpath} from 'realpath-native'; -import chalk = require('chalk'); +import {tryRealpath} from 'jest-util'; +import slash = require('slash'); import nodeModulesPaths from './nodeModulesPaths'; import isBuiltinModule from './isBuiltinModule'; import defaultResolver, {clearDefaultResolverCache} from './defaultResolver'; import type {ResolverConfig} from './types'; import ModuleNotFoundError from './ModuleNotFoundError'; import shouldLoadAsEsm, {clearCachedLookups} from './shouldLoadAsEsm'; +import chalk = require('chalk'); type FindNodeModuleConfig = { basedir: Config.Path; @@ -28,6 +29,7 @@ type FindNodeModuleConfig = { throwIfNotFound?: boolean; }; +// TODO: replace with a Map in Jest 26 type BooleanObject = Record; namespace Resolver { @@ -40,8 +42,7 @@ namespace Resolver { const NATIVE_PLATFORM = 'native'; // We might be inside a symlink. -const cwd = process.cwd(); -const resolvedCwd = realpath(cwd) || cwd; +const resolvedCwd = tryRealpath(process.cwd()); const {NODE_PATH} = process.env; const nodePaths = NODE_PATH ? NODE_PATH.split(path.delimiter) @@ -61,7 +62,6 @@ class Resolver { constructor(moduleMap: ModuleMap, options: ResolverConfig) { this._options = { - browser: options.browser, defaultPlatform: options.defaultPlatform, extensions: options.extensions, hasCoreModules: @@ -183,7 +183,6 @@ class Resolver { const resolveNodeModule = (name: Config.Path, throwIfNotFound = false) => Resolver.findNodeModule(name, { basedir: dirname, - browser: this._options.browser, extensions, moduleDirectory, paths, @@ -193,7 +192,7 @@ class Resolver { }); if (!skipResolution) { - // @ts-ignore: the "pnp" version named isn't in DefinitelyTyped + // @ts-expect-error: the "pnp" version named isn't in DefinitelyTyped module = resolveNodeModule(moduleName, Boolean(process.versions.pnp)); if (module) { @@ -238,10 +237,11 @@ class Resolver { // 5. Throw an error if the module could not be found. `resolve.sync` only // produces an error based on the dirname but we have the actual current // module name available. - const relativePath = path.relative(dirname, from); + const relativePath = + slash(path.relative(this._options.rootDir, from)) || '.'; throw new ModuleNotFoundError( - `Cannot find module '${moduleName}' from '${relativePath || '.'}'`, + `Cannot find module '${moduleName}' from '${relativePath}'`, moduleName, ); } @@ -437,7 +437,6 @@ class Resolver { this.getModule(updatedName) || Resolver.findNodeModule(updatedName, { basedir: dirname, - browser: this._options.browser, extensions, moduleDirectory, paths, diff --git a/packages/jest-resolve/src/isBuiltinModule.ts b/packages/jest-resolve/src/isBuiltinModule.ts index 4df97846acab..63e16aeb59a1 100644 --- a/packages/jest-resolve/src/isBuiltinModule.ts +++ b/packages/jest-resolve/src/isBuiltinModule.ts @@ -7,7 +7,7 @@ import module = require('module'); -// @ts-ignore: "private" api +// "private" api declare const process: { binding(type: string): {}; }; diff --git a/packages/jest-resolve/src/nodeModulesPaths.ts b/packages/jest-resolve/src/nodeModulesPaths.ts index dddf52229a13..1c311b70df52 100644 --- a/packages/jest-resolve/src/nodeModulesPaths.ts +++ b/packages/jest-resolve/src/nodeModulesPaths.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import type {Config} from '@jest/types'; -import {sync as realpath} from 'realpath-native'; +import {tryRealpath} from 'jest-util'; type NodeModulesPathsOptions = { moduleDirectory?: Array; @@ -40,7 +40,7 @@ export default function nodeModulesPaths( // traverses parents of the physical path, not the symlinked path let physicalBasedir; try { - physicalBasedir = realpath(basedirAbs); + physicalBasedir = tryRealpath(basedirAbs); } catch (err) { // realpath can throw, e.g. on mapped drives physicalBasedir = basedirAbs; diff --git a/packages/jest-resolve/src/shouldLoadAsEsm.ts b/packages/jest-resolve/src/shouldLoadAsEsm.ts index a1938e70d5e6..cab7b850eae6 100644 --- a/packages/jest-resolve/src/shouldLoadAsEsm.ts +++ b/packages/jest-resolve/src/shouldLoadAsEsm.ts @@ -6,7 +6,7 @@ */ import {dirname, extname} from 'path'; -// @ts-ignore: experimental, not added to the types +// @ts-expect-error: experimental, not added to the types import {SyntheticModule} from 'vm'; import type {Config} from '@jest/types'; import readPkgUp = require('read-pkg-up'); diff --git a/packages/jest-resolve/src/types.ts b/packages/jest-resolve/src/types.ts index 7d8a11d48fc9..cbe7666ac21f 100644 --- a/packages/jest-resolve/src/types.ts +++ b/packages/jest-resolve/src/types.ts @@ -8,7 +8,6 @@ import type {Config} from '@jest/types'; export type ResolverConfig = { - browser?: boolean; defaultPlatform?: string | null; extensions: Array; hasCoreModules: boolean; diff --git a/packages/jest-runner/package.json b/packages/jest-runner/package.json index 87c46de216ca..9aa6d4dd1685 100644 --- a/packages/jest-runner/package.json +++ b/packages/jest-runner/package.json @@ -1,6 +1,6 @@ { "name": "jest-runner", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,31 +9,24 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/console": "^25.4.0", - "@jest/environment": "^25.4.0", - "@jest/test-result": "^25.4.0", - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", + "@jest/console": "^26.0.1", + "@jest/environment": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.3", - "jest-config": "^25.4.0", - "jest-docblock": "^25.3.0", - "jest-haste-map": "^25.4.0", - "jest-jasmine2": "^25.4.0", - "jest-leak-detector": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-resolve": "^25.4.0", - "jest-runtime": "^25.4.0", - "jest-util": "^25.4.0", - "jest-worker": "^25.4.0", + "graceful-fs": "^4.2.4", + "jest-config": "^26.0.1", + "jest-docblock": "^26.0.0", + "jest-haste-map": "^26.0.1", + "jest-jasmine2": "^26.0.1", + "jest-leak-detector": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-resolve": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-util": "^26.0.1", + "jest-worker": "^26.0.0", "source-map-support": "^0.5.6", "throat": "^5.0.0" }, @@ -42,10 +35,10 @@ "@types/graceful-fs": "^4.1.2", "@types/node": "*", "@types/source-map-support": "^0.5.0", - "jest-circus": "^25.4.0" + "jest-circus": "^26.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-runner/src/index.ts b/packages/jest-runner/src/index.ts index 9cf5659426cb..0f1d069c6af0 100644 --- a/packages/jest-runner/src/index.ts +++ b/packages/jest-runner/src/index.ts @@ -158,6 +158,9 @@ class TestRunner { changedFiles: this._context.changedFiles && Array.from(this._context.changedFiles), + sourcesRelatedToTestsInChangedFiles: + this._context.sourcesRelatedToTestsInChangedFiles && + Array.from(this._context.sourcesRelatedToTestsInChangedFiles), }, globalConfig: this._globalConfig, path: test.path, diff --git a/packages/jest-runner/src/runTest.ts b/packages/jest-runner/src/runTest.ts index dd8735be8b57..deb20ff7d7ec 100644 --- a/packages/jest-runner/src/runTest.ts +++ b/packages/jest-runner/src/runTest.ts @@ -6,7 +6,6 @@ * */ -import {compileFunction} from 'vm'; import type {Config} from '@jest/types'; import type {TestResult} from '@jest/test-result'; import { @@ -39,7 +38,7 @@ function freezeConsole( testConsole: BufferedConsole | CustomConsole | NullConsole, config: Config.ProjectConfig, ) { - // @ts-ignore: `_log` is `private` - we should figure out some proper API here + // @ts-expect-error: `_log` is `private` - we should figure out some proper API here testConsole._log = function fakeConsolePush( _type: LogType, message: LogMessage, @@ -159,7 +158,8 @@ async function runTestInternal( const start = Date.now(); for (const path of config.setupFiles) { - const esm = runtime.unstable_shouldLoadAsEsm(path); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(path); if (esm) { await runtime.unstable_importModule(path); @@ -225,11 +225,10 @@ async function runTestInternal( }; } - // if we don't have `getVmContext` on the env,or `compileFunction` available skip coverage + // if we don't have `getVmContext` on the env skip coverage const collectV8Coverage = globalConfig.coverageProvider === 'v8' && - typeof environment.getVmContext === 'function' && - typeof compileFunction === 'function'; + typeof environment.getVmContext === 'function'; try { await environment.setup(); @@ -300,6 +299,8 @@ async function runTestInternal( }); } finally { await environment.teardown(); + // TODO: this function might be missing, remove ? in Jest 26 + runtime.teardown?.(); sourcemapSupport.resetRetrieveHandlers(); } diff --git a/packages/jest-runner/src/testWorker.ts b/packages/jest-runner/src/testWorker.ts index b7a3dcf858ff..70d45328a4ab 100644 --- a/packages/jest-runner/src/testWorker.ts +++ b/packages/jest-runner/src/testWorker.ts @@ -89,6 +89,9 @@ export async function worker({ context && { ...context, changedFiles: context.changedFiles && new Set(context.changedFiles), + sourcesRelatedToTestsInChangedFiles: + context.sourcesRelatedToTestsInChangedFiles && + new Set(context.sourcesRelatedToTestsInChangedFiles), }, ); } catch (error) { diff --git a/packages/jest-runner/src/types.ts b/packages/jest-runner/src/types.ts index 4862c886ce86..c4fc43117ff0 100644 --- a/packages/jest-runner/src/types.ts +++ b/packages/jest-runner/src/types.ts @@ -49,6 +49,7 @@ export type TestRunnerOptions = { serial: boolean; }; +// make sure all props here are present in the type below it as well export type TestRunnerContext = { changedFiles?: Set; sourcesRelatedToTestsInChangedFiles?: Set; @@ -56,6 +57,7 @@ export type TestRunnerContext = { export type TestRunnerSerializedContext = { changedFiles?: Array; + sourcesRelatedToTestsInChangedFiles?: Array; }; // TODO: Should live in `@jest/core` or `jest-watcher` diff --git a/packages/jest-runtime/package.json b/packages/jest-runtime/package.json index 856194f2d8fc..e8c0ea9c80aa 100644 --- a/packages/jest-runtime/package.json +++ b/packages/jest-runtime/package.json @@ -1,6 +1,6 @@ { "name": "jest-runtime", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,53 +9,46 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/console": "^25.4.0", - "@jest/environment": "^25.4.0", - "@jest/globals": "^25.4.0", - "@jest/source-map": "^25.2.6", - "@jest/test-result": "^25.4.0", - "@jest/transform": "^25.4.0", - "@jest/types": "^25.4.0", + "@jest/console": "^26.0.1", + "@jest/environment": "^26.0.1", + "@jest/fake-timers": "^26.0.1", + "@jest/globals": "^26.0.1", + "@jest/source-map": "^26.0.0", + "@jest/test-result": "^26.0.1", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", "@types/yargs": "^15.0.0", - "chalk": "^3.0.0", + "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", - "graceful-fs": "^4.2.3", - "jest-config": "^25.4.0", - "jest-haste-map": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-mock": "^25.4.0", - "jest-regex-util": "^25.2.6", - "jest-resolve": "^25.4.0", - "jest-snapshot": "^25.4.0", - "jest-util": "^25.4.0", - "jest-validate": "^25.4.0", - "realpath-native": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-config": "^26.0.1", + "jest-haste-map": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.3.1" }, "devDependencies": { - "@jest/test-utils": "^25.3.0", + "@jest/test-utils": "^26.0.0", "@types/exit": "^0.1.30", "@types/glob": "^7.1.1", "@types/graceful-fs": "^4.1.2", - "execa": "^3.2.0", - "jest-environment-node": "^25.4.0", + "execa": "^4.0.0", + "jest-environment-node": "^26.0.1", "jest-snapshot-serializer-raw": "^1.1.0" }, "bin": "./bin/jest-runtime.js", "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-runtime/src/__tests__/resolve_browser.test.js b/packages/jest-runtime/src/__tests__/resolve_browser.test.js deleted file mode 100644 index f0c5d289e84d..000000000000 --- a/packages/jest-runtime/src/__tests__/resolve_browser.test.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -'use strict'; - -let createRuntime; - -describe('resolve', () => { - beforeEach(() => { - createRuntime = require('createRuntime'); - }); - - it('respects "browser" dependency when browser:true configured', () => - createRuntime(__filename, { - browser: true, - }).then(runtime => { - const exports = runtime.requireModuleOrMock( - runtime.__mockRootPath, - 'jest-resolve-test', - ); - expect(exports.isBrowser).toBe(true); - })); - - it(`doesn't resolve "browser" dependency by default`, () => - createRuntime( - __filename, - {}, - { - browser: false, - }, - ).then(runtime => { - const exports = runtime.requireModuleOrMock( - runtime.__mockRootPath, - 'jest-resolve-test', - ); - expect(exports.isBrowser).toBe(false); - })); -}); diff --git a/packages/jest-runtime/src/__tests__/runtime_gen_mock_from_module.test.js b/packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js similarity index 86% rename from packages/jest-runtime/src/__tests__/runtime_gen_mock_from_module.test.js rename to packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js index 818b87eaec97..301c4e3910fa 100644 --- a/packages/jest-runtime/src/__tests__/runtime_gen_mock_from_module.test.js +++ b/packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js @@ -19,7 +19,7 @@ describe('Runtime', () => { createRuntime = require('createRuntime'); }); - describe('genMockFromModule', () => { + describe('createMockFromModule', () => { it('does not cause side effects in the rest of the module system when generating a mock', () => createRuntime(__filename).then(runtime => { const testRequire = runtime.requireModule.bind( @@ -33,7 +33,7 @@ describe('Runtime', () => { expect(origModuleStateValue).toBe('default'); // Generate a mock for a module with side effects - const mock = module.jest.genMockFromModule('ModuleWithSideEffects'); + const mock = module.jest.createMockFromModule('ModuleWithSideEffects'); // Make sure we get a mock. expect(mock.fn()).toBe(undefined); @@ -43,8 +43,8 @@ describe('Runtime', () => { it('resolves mapped modules correctly', () => createRuntime(__filename, {moduleNameMapper}).then(runtime => { const root = runtime.requireModule(runtime.__mockRootPath); - const mockModule = root.jest.genMockFromModule( - 'module/name/genMockFromModule', + const mockModule = root.jest.createMockFromModule( + 'module/name/createMockFromModule', ); expect(mockModule.test.mock).toBeTruthy(); @@ -59,7 +59,7 @@ describe('Runtime', () => { ); const module = testRequire('RegularModule'); - const mockModule = module.jest.genMockFromModule('RegularModule'); + const mockModule = module.jest.createMockFromModule('RegularModule'); const testObjectPrototype = Object.getPrototypeOf(module.object); const mockObjectPrototype = Object.getPrototypeOf(mockModule.object); expect(mockObjectPrototype).toBe(testObjectPrototype); diff --git a/packages/jest-runtime/src/__tests__/runtime_require_module.test.js b/packages/jest-runtime/src/__tests__/runtime_require_module.test.js index 685667dea150..a617c267d551 100644 --- a/packages/jest-runtime/src/__tests__/runtime_require_module.test.js +++ b/packages/jest-runtime/src/__tests__/runtime_require_module.test.js @@ -252,22 +252,6 @@ describe('Runtime requireModule', () => { expect(hastePackage.isHastePackage).toBe(true); })); - it('resolves node modules properly when crawling node_modules', () => - // While we are crawling a node module, we shouldn't put package.json - // files of node modules to resolve to `package.json` but rather resolve - // to whatever the package.json's `main` field says. - createRuntime(__filename, { - haste: { - providesModuleNodeModules: ['not-a-haste-package'], - }, - }).then(runtime => { - const hastePackage = runtime.requireModule( - runtime.__mockRootPath, - 'not-a-haste-package', - ); - expect(hastePackage.isNodeModule).toBe(true); - })); - it('resolves platform extensions based on the default platform', () => Promise.all([ createRuntime(__filename).then(runtime => { diff --git a/packages/jest-runtime/src/__tests__/test_root/mapped_module_genMockFromModule.js b/packages/jest-runtime/src/__tests__/test_root/mapped_module_createMockFromModule.js similarity index 100% rename from packages/jest-runtime/src/__tests__/test_root/mapped_module_genMockFromModule.js rename to packages/jest-runtime/src/__tests__/test_root/mapped_module_createMockFromModule.js diff --git a/packages/jest-runtime/src/cli/index.ts b/packages/jest-runtime/src/cli/index.ts index 54857611e5c2..490848a2ba1e 100644 --- a/packages/jest-runtime/src/cli/index.ts +++ b/packages/jest-runtime/src/cli/index.ts @@ -8,12 +8,11 @@ import {cpus} from 'os'; import * as path from 'path'; import chalk = require('chalk'); -import {sync as realpath} from 'realpath-native'; import yargs = require('yargs'); import type {Config} from '@jest/types'; import type {JestEnvironment} from '@jest/environment'; import {CustomConsole} from '@jest/console'; -import {setGlobal} from 'jest-util'; +import {setGlobal, tryRealpath} from 'jest-util'; import {validateCLIOptions} from 'jest-validate'; import {deprecationEntries, readConfig} from 'jest-config'; import {VERSION} from '../version'; @@ -24,10 +23,6 @@ export async function run( cliArgv?: Config.Argv, cliInfo?: Array, ): Promise { - const realFs = require('fs'); - const fs = require('graceful-fs'); - fs.gracefulify(realFs); - let argv; if (cliArgv) { argv = cliArgv; @@ -57,7 +52,7 @@ export async function run( return; } - const root = realpath(process.cwd()); + const root = tryRealpath(process.cwd()); const filePath = path.resolve(root, argv._[0]); if (argv.debug) { @@ -94,7 +89,8 @@ export async function run( const runtime = new Runtime(config, environment, hasteMap.resolver); for (const path of config.setupFiles) { - const esm = runtime.unstable_shouldLoadAsEsm(path); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(path); if (esm) { await runtime.unstable_importModule(path); @@ -102,7 +98,8 @@ export async function run( runtime.requireModule(path); } } - const esm = runtime.unstable_shouldLoadAsEsm(filePath); + // TODO: remove ? in Jest 26 + const esm = runtime.unstable_shouldLoadAsEsm?.(filePath); if (esm) { await runtime.unstable_importModule(filePath); diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index 1215f2538091..2cfe0a14d10a 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -9,12 +9,12 @@ import {URL, fileURLToPath, pathToFileURL} from 'url'; import * as path from 'path'; import { Script, - // @ts-ignore: experimental, not added to the types + // @ts-expect-error: experimental, not added to the types SourceTextModule, - // @ts-ignore: experimental, not added to the types + // @ts-expect-error: experimental, not added to the types SyntheticModule, Context as VMContext, - // @ts-ignore: experimental, not added to the types + // @ts-expect-error: experimental, not added to the types Module as VMModule, compileFunction, } from 'vm'; @@ -23,12 +23,12 @@ import type {Config, Global} from '@jest/types'; import type { Jest, JestEnvironment, - LocalModuleRequire, Module, ModuleWrapper, } from '@jest/environment'; import type * as JestGlobals from '@jest/globals'; import type {SourceMapRegistry} from '@jest/source-map'; +import {LegacyFakeTimers, ModernFakeTimers} from '@jest/fake-timers'; import {formatStackTrace, separateMessageFromStack} from 'jest-message-util'; import {createDirectory, deepCyclicCopy} from 'jest-util'; import {escapePathForRegex} from 'jest-regex-util'; @@ -58,8 +58,8 @@ import Snapshot = require('jest-snapshot'); import stripBOM = require('strip-bom'); interface JestGlobalsValues extends Global.TestFrameworkGlobals { - jest: JestGlobals.jest; - expect: JestGlobals.expect; + jest: typeof JestGlobals.jest; + expect: typeof JestGlobals.expect; } type HasteMapOptions = { @@ -93,10 +93,17 @@ type ResolveOptions = Parameters[1] & { [OUTSIDE_JEST_VM_RESOLVE_OPTION]?: true; }; -type BooleanObject = Record; -type CacheFS = {[path: string]: string}; +type StringMap = Map; +type BooleanMap = Map; -type RequireCache = {[key: string]: Module}; +const fromEntries: typeof Object.fromEntries = + Object.fromEntries ?? + function fromEntries(iterable: Iterable<[string, T]>) { + return [...iterable].reduce>((obj, [key, val]) => { + obj[key] = val; + return obj; + }, {}); + }; namespace Runtime { export type Context = JestContext; @@ -132,18 +139,23 @@ const runtimeSupportsVmModules = typeof SyntheticModule === 'function'; /* eslint-disable-next-line no-redeclare */ class Runtime { - private _cacheFS: CacheFS; + private _cacheFS: StringMap; private _config: Config.ProjectConfig; private _coverageOptions: ShouldInstrumentOptions; private _currentlyExecutingModulePath: string; private _environment: JestEnvironment; - private _explicitShouldMock: BooleanObject; + private _explicitShouldMock: BooleanMap; + private _fakeTimersImplementation: + | LegacyFakeTimers + | ModernFakeTimers + | null; private _internalModuleRegistry: ModuleRegistry; private _isCurrentlyExecutingManualMock: string | null; - private _mockFactories: Record unknown>; - private _mockMetaDataCache: { - [key: string]: jestMock.MockFunctionMetadata>; - }; + private _mockFactories: Map unknown>; + private _mockMetaDataCache: Map< + string, + jestMock.MockFunctionMetadata> + >; private _mockRegistry: Map; private _isolatedMockRegistry: Map | null; private _moduleMocker: typeof jestMock; @@ -152,28 +164,27 @@ class Runtime { private _esmoduleRegistry: Map>; private _resolver: Resolver; private _shouldAutoMock: boolean; - private _shouldMockModuleCache: BooleanObject; - private _shouldUnmockTransitiveDependenciesCache: BooleanObject; - private _sourceMapRegistry: SourceMapRegistry; + private _shouldMockModuleCache: BooleanMap; + private _shouldUnmockTransitiveDependenciesCache: BooleanMap; + private _sourceMapRegistry: StringMap; private _scriptTransformer: ScriptTransformer; private _fileTransforms: Map; private _v8CoverageInstrumenter: CoverageInstrumenter | undefined; private _v8CoverageResult: V8Coverage | undefined; - private _transitiveShouldMock: BooleanObject; + private _transitiveShouldMock: BooleanMap; private _unmockList: RegExp | undefined; - private _virtualMocks: BooleanObject; + private _virtualMocks: BooleanMap; private _moduleImplementation?: typeof nativeModule.Module; private jestObjectCaches: Map; - private _hasWarnedAboutRequireCacheModification = false; constructor( config: Config.ProjectConfig, environment: JestEnvironment, resolver: Resolver, - cacheFS?: CacheFS, + cacheFS: Record = {}, coverageOptions?: ShouldInstrumentOptions, ) { - this._cacheFS = cacheFS || Object.create(null); + this._cacheFS = new Map(Object.entries(cacheFS)); this._config = config; this._coverageOptions = coverageOptions || { changedFiles: undefined, @@ -185,10 +196,10 @@ class Runtime { }; this._currentlyExecutingModulePath = ''; this._environment = environment; - this._explicitShouldMock = Object.create(null); + this._explicitShouldMock = new Map(); this._internalModuleRegistry = new Map(); this._isCurrentlyExecutingManualMock = null; - this._mockFactories = Object.create(null); + this._mockFactories = new Map(); this._mockRegistry = new Map(); // during setup, this cannot be null (and it's fine to explode if it is) this._moduleMocker = this._environment.moduleMocker!; @@ -199,15 +210,20 @@ class Runtime { this._resolver = resolver; this._scriptTransformer = new ScriptTransformer(config); this._shouldAutoMock = config.automock; - this._sourceMapRegistry = Object.create(null); + this._sourceMapRegistry = new Map(); this._fileTransforms = new Map(); - this._virtualMocks = Object.create(null); + this._virtualMocks = new Map(); this.jestObjectCaches = new Map(); - this._mockMetaDataCache = Object.create(null); - this._shouldMockModuleCache = Object.create(null); - this._shouldUnmockTransitiveDependenciesCache = Object.create(null); - this._transitiveShouldMock = Object.create(null); + this._mockMetaDataCache = new Map(); + this._shouldMockModuleCache = new Map(); + this._shouldUnmockTransitiveDependenciesCache = new Map(); + this._transitiveShouldMock = new Map(); + + this._fakeTimersImplementation = + config.timers === 'modern' + ? this._environment.fakeTimersModern + : this._environment.fakeTimers; this._unmockList = unmockRegExpCache.get(config); if (!this._unmockList && config.unmockedModulePathPatterns) { @@ -218,13 +234,11 @@ class Runtime { } if (config.automock) { + const virtualMocks = fromEntries(this._virtualMocks); config.setupFiles.forEach(filePath => { if (filePath && filePath.includes(NODE_MODULES)) { - const moduleID = this._resolver.getModuleID( - this._virtualMocks, - filePath, - ); - this._transitiveShouldMock[moduleID] = false; + const moduleID = this._resolver.getModuleID(virtualMocks, filePath); + this._transitiveShouldMock.set(moduleID, false); } }); } @@ -291,7 +305,6 @@ class Runtime { mocksPattern: escapePathForRegex(path.sep + '__mocks__' + path.sep), name: config.name, platforms: config.haste.platforms || ['ios', 'android'], - providesModuleNodeModules: config.haste.providesModuleNodeModules, resetCache: options && options.resetCache, retainAllFiles: false, rootDir: config.rootDir, @@ -307,7 +320,6 @@ class Runtime { moduleMap: HasteMap.ModuleMap, ): Resolver { return new Resolver(moduleMap, { - browser: config.browser, defaultPlatform: config.haste.defaultPlatform, extensions: config.moduleFileExtensions.map(extension => '.' + extension), hasCoreModules: true, @@ -353,13 +365,13 @@ class Runtime { return core; } - const transformedFile = this.transformFile(modulePath, { + const transformedCode = this.transformFile(modulePath, { isInternalModule: false, supportsDynamicImport: true, supportsStaticESM: true, }); - const module = new SourceTextModule(transformedFile.code, { + const module = new SourceTextModule(transformedCode, { context, identifier: modulePath, importModuleDynamically: this.linkModules.bind(this), @@ -403,16 +415,15 @@ class Runtime { return globals; } - const resolved = this._resolveModule( - referencingModule.identifier, - specifier, - ); + const [path, query] = specifier.split('?'); + + const resolved = this._resolveModule(referencingModule.identifier, path); if ( this._resolver.isCoreModule(resolved) || this.unstable_shouldLoadAsEsm(resolved) ) { - return this.loadEsmModule(resolved); + return this.loadEsmModule(resolved, query); } return this.loadCjsAsEsm( @@ -431,9 +442,11 @@ class Runtime { 'You need to run with a version of node that supports ES Modules in the VM API.', ); - const modulePath = this._resolveModule(from, moduleName); + const [path, query] = (moduleName ?? '').split('?'); + + const modulePath = this._resolveModule(from, path); - return this.loadEsmModule(modulePath); + return this.loadEsmModule(modulePath, query); } private async loadCjsAsEsm( @@ -447,7 +460,7 @@ class Runtime { const module = new SyntheticModule( ['default'], function () { - // @ts-ignore: TS doesn't know what `this` is + // @ts-expect-error: TS doesn't know what `this` is this.setExport('default', cjs); }, {context, identifier: modulePath}, @@ -469,7 +482,7 @@ class Runtime { isRequireActual?: boolean | null, ): T { const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); @@ -481,12 +494,12 @@ class Runtime { const manualMock = moduleName && this._resolver.getMockModule(from, moduleName); if ( - (!options || !options.isInternalModule) && + !options?.isInternalModule && !isRequireActual && !moduleResource && manualMock && manualMock !== this._isCurrentlyExecutingManualMock && - this._explicitShouldMock[moduleID] !== false + this._explicitShouldMock.get(moduleID) !== false ) { modulePath = manualMock; } @@ -501,7 +514,9 @@ class Runtime { let moduleRegistry; - if (!options || !options.isInternalModule) { + if (options?.isInternalModule) { + moduleRegistry = this._internalModuleRegistry; + } else { if ( this._moduleRegistry.get(modulePath) || !this._isolatedModuleRegistry @@ -510,8 +525,6 @@ class Runtime { } else { moduleRegistry = this._isolatedModuleRegistry; } - } else { - moduleRegistry = this._internalModuleRegistry; } const module = moduleRegistry.get(modulePath); @@ -564,7 +577,7 @@ class Runtime { requireMock(from: Config.Path, moduleName: string): T { const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); @@ -580,19 +593,18 @@ class Runtime { const mockRegistry = this._isolatedMockRegistry || this._mockRegistry; - if (moduleID in this._mockFactories) { - const module = this._mockFactories[moduleID](); + if (this._mockFactories.has(moduleID)) { + // has check above makes this ok + const module = this._mockFactories.get(moduleID)!(); mockRegistry.set(moduleID, module); return module as T; } const manualMockOrStub = this._resolver.getMockModule(from, moduleName); - let modulePath; - if (manualMockOrStub) { - modulePath = this._resolveModule(from, manualMockOrStub); - } else { - modulePath = this._resolveModule(from, moduleName); - } + + let modulePath = + this._resolver.getMockModule(from, moduleName) || + this._resolveModule(from, moduleName); let isManualMock = manualMockOrStub && @@ -658,7 +670,7 @@ class Runtime { moduleRegistry: ModuleRegistry, ) { if (path.extname(modulePath) === '.json') { - const text = stripBOM(fs.readFileSync(modulePath, 'utf8')); + const text = stripBOM(this.readFile(modulePath)); const transformedFile = this._scriptTransformer.transformJson( modulePath, @@ -691,7 +703,7 @@ class Runtime { requireModuleOrMock(from: Config.Path, moduleName: string): T { // this module is unmockable if (moduleName === '@jest/globals') { - // @ts-ignore: we don't care that it's not assignable to T + // @ts-expect-error: we don't care that it's not assignable to T return this.getGlobalsForCjs(from); } @@ -735,12 +747,17 @@ class Runtime { try { fn(); } finally { + // might be cleared within the callback + this._isolatedModuleRegistry?.clear(); + this._isolatedMockRegistry?.clear(); this._isolatedModuleRegistry = null; this._isolatedMockRegistry = null; } } resetModules(): void { + this._isolatedModuleRegistry?.clear(); + this._isolatedMockRegistry?.clear(); this._isolatedModuleRegistry = null; this._isolatedMockRegistry = null; this._mockRegistry.clear(); @@ -816,7 +833,7 @@ class Runtime { } getSourceMaps(): SourceMapRegistry { - return this._sourceMapRegistry; + return fromEntries(this._sourceMapRegistry); } setMock( @@ -825,17 +842,18 @@ class Runtime { mockFactory: () => unknown, options?: {virtual?: boolean}, ): void { - if (options && options.virtual) { + if (options?.virtual) { const mockPath = this._resolver.getModulePath(from, moduleName); - this._virtualMocks[mockPath] = true; + + this._virtualMocks.set(mockPath, true); } const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); - this._explicitShouldMock[moduleID] = true; - this._mockFactories[moduleID] = mockFactory; + this._explicitShouldMock.set(moduleID, true); + this._mockFactories.set(moduleID, mockFactory); } restoreAllMocks(): void { @@ -850,6 +868,32 @@ class Runtime { this._moduleMocker.clearAllMocks(); } + teardown(): void { + this.restoreAllMocks(); + this.resetAllMocks(); + this.resetModules(); + + this._internalModuleRegistry.clear(); + this._mockFactories.clear(); + this._mockMetaDataCache.clear(); + this._shouldMockModuleCache.clear(); + this._shouldUnmockTransitiveDependenciesCache.clear(); + this._explicitShouldMock.clear(); + this._transitiveShouldMock.clear(); + this._virtualMocks.clear(); + this._cacheFS.clear(); + this._unmockList = undefined; + + this._sourceMapRegistry.clear(); + + this._fileTransforms.clear(); + this.jestObjectCaches.clear(); + + this._v8CoverageResult = []; + this._v8CoverageInstrumenter = undefined; + this._moduleImplementation = undefined; + } + private _resolveModule(from: Config.Path, to?: string) { return to ? this._resolver.resolveModule(from, to) : from; } @@ -954,7 +998,7 @@ class Runtime { value: this._createRequireImplementation(localModule, options), }); - const transformedFile = this.transformFile(filename, options); + const transformedCode = this.transformFile(filename, options); let compiledFunction: ModuleWrapper | null = null; @@ -963,38 +1007,21 @@ class Runtime { const vmContext = this._environment.getVmContext(); if (vmContext) { - if (typeof compileFunction === 'function') { - try { - compiledFunction = compileFunction( - transformedFile.code, - this.constructInjectedModuleParameters(), - { - filename, - parsingContext: vmContext, - }, - ) as ModuleWrapper; - } catch (e) { - throw handlePotentialSyntaxError(e); - } - } else { - const script = this.createScriptFromCode( - transformedFile.code, - filename, - ); - - const runScript = script.runInContext( - vmContext, - ) as RunScriptEvalResult; - - if (runScript === null) { - compiledFunction = null; - } else { - compiledFunction = runScript[EVAL_RESULT_VARIABLE]; - } + try { + compiledFunction = compileFunction( + transformedCode, + this.constructInjectedModuleParameters(), + { + filename, + parsingContext: vmContext, + }, + ) as ModuleWrapper; + } catch (e) { + throw handlePotentialSyntaxError(e); } } } else { - const script = this.createScriptFromCode(transformedFile.code, filename); + const script = this.createScriptFromCode(transformedCode, filename); const runScript = this._environment.runScript( script, @@ -1047,22 +1074,28 @@ class Runtime { this._currentlyExecutingModulePath = lastExecutingModulePath; } - private transformFile(filename: string, options?: InternalModuleOptions) { + private transformFile( + filename: string, + options?: InternalModuleOptions, + ): string { + const source = this.readFile(filename); + + if (options?.isInternalModule) { + return source; + } + const transformedFile = this._scriptTransformer.transform( filename, this._getFullTransformationOptions(options), - this._cacheFS[filename], + source, ); - // we only care about non-internal modules - if (!options || !options.isInternalModule) { - this._fileTransforms.set(filename, transformedFile); - } + this._fileTransforms.set(filename, transformedFile); if (transformedFile.sourceMapPath) { - this._sourceMapRegistry[filename] = transformedFile.sourceMapPath; + this._sourceMapRegistry.set(filename, transformedFile.sourceMapPath); } - return transformedFile; + return transformedFile.code; } private createScriptFromCode(scriptSource: string, filename: string) { @@ -1096,10 +1129,10 @@ class Runtime { return new SyntheticModule( ['default', ...Object.keys(required)], function () { - // @ts-ignore: TS doesn't know what `this` is + // @ts-expect-error: TS doesn't know what `this` is this.setExport('default', required); Object.entries(required).forEach(([key, value]) => { - // @ts-ignore: TS doesn't know what `this` is + // @ts-expect-error: TS doesn't know what `this` is this.setExport(key, value); }); }, @@ -1125,7 +1158,7 @@ class Runtime { const error = new TypeError( `The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '${filename}'`, ); - // @ts-ignore + // @ts-expect-error error.code = 'ERR_INVALID_ARG_TYPE'; throw error; } @@ -1143,7 +1176,7 @@ class Runtime { class Module extends nativeModule.Module {} Object.entries(nativeModule.Module).forEach(([key, value]) => { - // @ts-ignore + // @ts-expect-error Module[key] = value; }); @@ -1164,7 +1197,7 @@ class Runtime { : '' }`, ); - // @ts-ignore + // @ts-expect-error error.code = 'ERR_INVALID_ARG_TYPE'; throw error; } @@ -1184,12 +1217,14 @@ class Runtime { const modulePath = this._resolver.resolveStubModuleName(from, moduleName) || this._resolveModule(from, moduleName); - if (!(modulePath in this._mockMetaDataCache)) { + if (!this._mockMetaDataCache.has(modulePath)) { // This allows us to handle circular dependencies while generating an // automock - this._mockMetaDataCache[modulePath] = - this._moduleMocker.getMetadata({}) || {}; + this._mockMetaDataCache.set( + modulePath, + this._moduleMocker.getMetadata({}) || {}, + ); // In order to avoid it being possible for automocking to potentially // cause side-effects within the module environment, we need to execute @@ -1213,36 +1248,39 @@ class Runtime { `See: https://jestjs.io/docs/manual-mocks.html#content`, ); } - this._mockMetaDataCache[modulePath] = mockMetadata; + this._mockMetaDataCache.set(modulePath, mockMetadata); } return this._moduleMocker.generateFromMetadata( - this._mockMetaDataCache[modulePath], + // added above if missing + this._mockMetaDataCache.get(modulePath)!, ); } - private _shouldMock(from: Config.Path, moduleName: string) { + private _shouldMock(from: Config.Path, moduleName: string): boolean { const explicitShouldMock = this._explicitShouldMock; const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); const key = from + path.delimiter + moduleID; - if (moduleID in explicitShouldMock) { - return explicitShouldMock[moduleID]; + if (explicitShouldMock.has(moduleID)) { + // guaranteed by `has` above + return explicitShouldMock.get(moduleID)!; } if ( !this._shouldAutoMock || this._resolver.isCoreModule(moduleName) || - this._shouldUnmockTransitiveDependenciesCache[key] + this._shouldUnmockTransitiveDependenciesCache.get(key) ) { return false; } - if (moduleID in this._shouldMockModuleCache) { - return this._shouldMockModuleCache[moduleID]; + if (this._shouldMockModuleCache.has(moduleID)) { + // guaranteed by `has` above + return this._shouldMockModuleCache.get(moduleID)!; } let modulePath; @@ -1251,41 +1289,41 @@ class Runtime { } catch (e) { const manualMock = this._resolver.getMockModule(from, moduleName); if (manualMock) { - this._shouldMockModuleCache[moduleID] = true; + this._shouldMockModuleCache.set(moduleID, true); return true; } throw e; } if (this._unmockList && this._unmockList.test(modulePath)) { - this._shouldMockModuleCache[moduleID] = false; + this._shouldMockModuleCache.set(moduleID, false); return false; } // transitive unmocking for package managers that store flat packages (npm3) const currentModuleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, ); if ( - this._transitiveShouldMock[currentModuleID] === false || + this._transitiveShouldMock.get(currentModuleID) === false || (from.includes(NODE_MODULES) && modulePath.includes(NODE_MODULES) && ((this._unmockList && this._unmockList.test(from)) || - explicitShouldMock[currentModuleID] === false)) + explicitShouldMock.get(currentModuleID) === false)) ) { - this._transitiveShouldMock[moduleID] = false; - this._shouldUnmockTransitiveDependenciesCache[key] = true; + this._transitiveShouldMock.set(moduleID, false); + this._shouldUnmockTransitiveDependenciesCache.set(key, true); return false; } - - return (this._shouldMockModuleCache[moduleID] = true); + this._shouldMockModuleCache.set(moduleID, true); + return true; } private _createRequireImplementation( from: InitialModule, options?: InternalModuleOptions, - ): LocalModuleRequire { + ): NodeRequire { const resolve = (moduleName: string, resolveOptions?: ResolveOptions) => { const resolved = this._requireResolve( from.filename, @@ -1303,29 +1341,16 @@ class Runtime { resolve.paths = (moduleName: string) => this._requireResolvePaths(from.filename, moduleName); - const moduleRequire = (options && options.isInternalModule + const moduleRequire = (options?.isInternalModule ? (moduleName: string) => this.requireInternalModule(from.filename, moduleName) - : this.requireModuleOrMock.bind( - this, - from.filename, - )) as LocalModuleRequire; + : this.requireModuleOrMock.bind(this, from.filename)) as NodeRequire; moduleRequire.extensions = Object.create(null); - moduleRequire.requireActual = this.requireActual.bind(this, from.filename); - moduleRequire.requireMock = this.requireMock.bind(this, from.filename); moduleRequire.resolve = resolve; moduleRequire.cache = (() => { - const notPermittedMethod = () => { - if (!this._hasWarnedAboutRequireCacheModification) { - this._environment.global.console.warn( - '`require.cache` modification is not permitted', - ); - - this._hasWarnedAboutRequireCacheModification = true; - } - return true; - }; - return new Proxy(Object.create(null), { + // TODO: consider warning somehow that this does nothing. We should support deletions, anyways + const notPermittedMethod = () => true; + return new Proxy(Object.create(null), { defineProperty: notPermittedMethod, deleteProperty: notPermittedMethod, get: (_target, key) => @@ -1371,21 +1396,21 @@ class Runtime { }; const unmock = (moduleName: string) => { const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); - this._explicitShouldMock[moduleID] = false; + this._explicitShouldMock.set(moduleID, false); return jestObject; }; const deepUnmock = (moduleName: string) => { const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); - this._explicitShouldMock[moduleID] = false; - this._transitiveShouldMock[moduleID] = false; + this._explicitShouldMock.set(moduleID, false); + this._transitiveShouldMock.set(moduleID, false); return jestObject; }; const mock: Jest['mock'] = (moduleName, mockFactory, options) => { @@ -1394,11 +1419,11 @@ class Runtime { } const moduleID = this._resolver.getModuleID( - this._virtualMocks, + fromEntries(this._virtualMocks), from, moduleName, ); - this._explicitShouldMock[moduleID] = true; + this._explicitShouldMock.set(moduleID, true); return jestObject; }; const setMockFactory = ( @@ -1421,8 +1446,25 @@ class Runtime { this.restoreAllMocks(); return jestObject; }; - const useFakeTimers = () => { - _getFakeTimers().useFakeTimers(); + const _getFakeTimers = () => { + if ( + !(this._environment.fakeTimers || this._environment.fakeTimersModern) + ) { + this._logFormattedReferenceError( + 'You are trying to access a property or method of the Jest environment after it has been torn down.', + ); + process.exitCode = 1; + } + + return this._fakeTimersImplementation!; + }; + const useFakeTimers = (type: string = 'legacy') => { + if (type === 'modern') { + this._fakeTimersImplementation = this._environment.fakeTimersModern; + } else { + this._fakeTimersImplementation = this._environment.fakeTimers; + } + this._fakeTimersImplementation!.useFakeTimers(); return jestObject; }; const useRealTimers = () => { @@ -1444,30 +1486,18 @@ class Runtime { if (this._environment.global.jasmine) { this._environment.global.jasmine._DEFAULT_TIMEOUT_INTERVAL = timeout; } else { - // @ts-ignore: https://github.com/Microsoft/TypeScript/issues/24587 + // @ts-expect-error: https://github.com/Microsoft/TypeScript/issues/24587 this._environment.global[testTimeoutSymbol] = timeout; } return jestObject; }; const retryTimes = (numTestRetries: number) => { - // @ts-ignore: https://github.com/Microsoft/TypeScript/issues/24587 + // @ts-expect-error: https://github.com/Microsoft/TypeScript/issues/24587 this._environment.global[retryTimesSymbol] = numTestRetries; return jestObject; }; - const _getFakeTimers = (): NonNullable => { - if (!this._environment.fakeTimers) { - this._logFormattedReferenceError( - 'You are trying to access a property or method of the Jest environment after it has been torn down.', - ); - process.exitCode = 1; - } - - // We've logged a user message above, so it doesn't matter if we return `null` here - return this._environment.fakeTimers!; - }; - const jestObject: Jest = { addMatchers: (matchers: Record) => this._environment.global.jasmine.addMatchers(matchers), @@ -1479,6 +1509,8 @@ class Runtime { autoMockOn: enableAutomock, clearAllMocks, clearAllTimers: () => _getFakeTimers().clearAllTimers(), + createMockFromModule: (moduleName: string) => + this._generateMock(from, moduleName), deepUnmock, disableAutomock, doMock: mock, @@ -1487,6 +1519,17 @@ class Runtime { fn, genMockFromModule: (moduleName: string) => this._generateMock(from, moduleName), + getRealSystemTime: () => { + const fakeTimers = _getFakeTimers(); + + if (fakeTimers instanceof ModernFakeTimers) { + return fakeTimers.getRealSystemTime(); + } else { + throw new TypeError( + 'getRealSystemTime is not available when not using modern timers', + ); + } + }, getTimerCount: () => _getFakeTimers().getTimerCount(), isMockFunction: this._moduleMocker.isMockFunction, isolateModules, @@ -1498,7 +1541,17 @@ class Runtime { resetModules, restoreAllMocks, retryTimes, - runAllImmediates: () => _getFakeTimers().runAllImmediates(), + runAllImmediates: () => { + const fakeTimers = _getFakeTimers(); + + if (fakeTimers instanceof LegacyFakeTimers) { + fakeTimers.runAllImmediates(); + } else { + throw new TypeError( + 'runAllImmediates is not available when using modern timers', + ); + } + }, runAllTicks: () => _getFakeTimers().runAllTicks(), runAllTimers: () => _getFakeTimers().runAllTimers(), runOnlyPendingTimers: () => _getFakeTimers().runOnlyPendingTimers(), @@ -1506,6 +1559,17 @@ class Runtime { _getFakeTimers().advanceTimersByTime(msToRun), setMock: (moduleName: string, mock: unknown) => setMockFactory(moduleName, () => mock), + setSystemTime: (now?: number) => { + const fakeTimers = _getFakeTimers(); + + if (fakeTimers instanceof ModernFakeTimers) { + fakeTimers.setSystemTime(now); + } else { + throw new TypeError( + 'setSystemTime is not available when not using modern timers', + ); + } + }, setTimeout, spyOn, unmock, @@ -1602,7 +1666,7 @@ class Runtime { Object.keys(globals), function () { Object.entries(globals).forEach(([key, value]) => { - // @ts-ignore: TS doesn't know what `this` is + // @ts-expect-error: TS doesn't know what `this` is this.setExport(key, value); }); }, @@ -1635,6 +1699,18 @@ class Runtime { xtest: this._environment.global.xtest, }; } + + private readFile(filename: Config.Path): string { + let source = this._cacheFS.get(filename); + + if (!source) { + source = fs.readFileSync(filename, 'utf8'); + + this._cacheFS.set(filename, source); + } + + return source; + } } function invariant(condition: unknown, message?: string): asserts condition { diff --git a/packages/jest-runtime/tsconfig.json b/packages/jest-runtime/tsconfig.json index 2955d779d6b1..fb40160ffc2b 100644 --- a/packages/jest-runtime/tsconfig.json +++ b/packages/jest-runtime/tsconfig.json @@ -9,6 +9,7 @@ {"path": "../jest-console"}, {"path": "../jest-environment"}, {"path": "../jest-environment-node"}, + {"path": "../jest-fake-timers"}, {"path": "../jest-globals"}, {"path": "../jest-haste-map"}, {"path": "../jest-message-util"}, diff --git a/packages/jest-serializer/package.json b/packages/jest-serializer/package.json index ae4bd8ec7703..908d4913ebc9 100644 --- a/packages/jest-serializer/package.json +++ b/packages/jest-serializer/package.json @@ -1,27 +1,24 @@ { "name": "jest-serializer", - "version": "25.2.6", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-serializer" }, "devDependencies": { + "@types/graceful-fs": "^4.1.3", "@types/node": "*" }, + "dependencies": { + "graceful-fs": "^4.2.4" + }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-serializer/src/__tests__/index.test.ts b/packages/jest-serializer/src/__tests__/index.test.ts index f27a68911932..174e3de5067c 100644 --- a/packages/jest-serializer/src/__tests__/index.test.ts +++ b/packages/jest-serializer/src/__tests__/index.test.ts @@ -5,11 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -'use strict'; - -import * as fs from 'fs'; import {tmpdir} from 'os'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import prettyFormat = require('pretty-format'); import serializer from '..'; @@ -21,7 +19,7 @@ const objs = [ {key1: 'foo', key2: 'bar', key3: {array: [null, {}]}}, {minusInf: -Infinity, nan: NaN, plusInf: +Infinity}, {date: new Date(1234567890), re: /foo/gi}, - // @ts-ignore - testing NaN + // @ts-expect-error - testing NaN { map: new Map([ [NaN, 4], diff --git a/packages/jest-serializer/src/index.ts b/packages/jest-serializer/src/index.ts index 4483f5b45f7d..8f6bd7a9913d 100644 --- a/packages/jest-serializer/src/index.ts +++ b/packages/jest-serializer/src/index.ts @@ -7,8 +7,8 @@ // TODO: Remove this /// -import * as fs from 'fs'; import {deserialize as v8Deserialize, serialize as v8Serialize} from 'v8'; +import * as fs from 'graceful-fs'; type Path = string; diff --git a/packages/jest-snapshot/package.json b/packages/jest-snapshot/package.json index 7082f7ee0e96..88b963e754ef 100644 --- a/packages/jest-snapshot/package.json +++ b/packages/jest-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "jest-snapshot", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,40 +9,35 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/types": "^7.0.0", - "@jest/types": "^25.4.0", - "@types/prettier": "^1.19.0", - "chalk": "^3.0.0", - "expect": "^25.4.0", - "jest-diff": "^25.4.0", - "jest-get-type": "^25.2.6", - "jest-matcher-utils": "^25.4.0", - "jest-message-util": "^25.4.0", - "jest-resolve": "^25.4.0", + "@jest/types": "^26.0.1", + "@types/prettier": "^2.0.0", + "chalk": "^4.0.0", + "expect": "^26.0.1", + "graceful-fs": "^4.2.4", + "jest-diff": "^26.0.1", + "jest-get-type": "^26.0.0", + "jest-haste-map": "^26.0.1", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-resolve": "^26.0.1", "make-dir": "^3.0.0", "natural-compare": "^1.4.0", - "pretty-format": "^25.4.0", - "semver": "^6.3.0" + "pretty-format": "^26.0.1", + "semver": "^7.3.2" }, "devDependencies": { "@babel/traverse": "^7.3.4", + "@types/graceful-fs": "^4.1.3", "@types/natural-compare": "^1.4.0", - "@types/semver": "^6.0.1", + "@types/semver": "^7.1.0", "ansi-regex": "^5.0.0", "ansi-styles": "^4.2.0", - "jest-haste-map": "^25.4.0", - "prettier": "^1.13.4" + "prettier": "^1.19.1" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-snapshot/src/State.ts b/packages/jest-snapshot/src/State.ts index 8e7824bc15c4..24fbbee262f5 100644 --- a/packages/jest-snapshot/src/State.ts +++ b/packages/jest-snapshot/src/State.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import {getStackTraceLines, getTopFrame} from 'jest-message-util'; @@ -54,7 +54,7 @@ type SaveStatus = { export default class SnapshotState { private _counters: Map; private _dirty: boolean; - // @ts-ignore + // @ts-expect-error private _index: number; private _updateSnapshot: Config.SnapshotUpdateState; private _snapshotData: SnapshotData; diff --git a/packages/jest-snapshot/src/__tests__/inline_snapshots.test.ts b/packages/jest-snapshot/src/__tests__/inline_snapshots.test.ts index ceb3ac422d8b..b605a863eff1 100644 --- a/packages/jest-snapshot/src/__tests__/inline_snapshots.test.ts +++ b/packages/jest-snapshot/src/__tests__/inline_snapshots.test.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -jest.mock('fs', () => ({ - ...jest.genMockFromModule('fs'), +jest.mock('graceful-fs', () => ({ + ...jest.createMockFromModule('fs'), existsSync: jest.fn().mockReturnValue(true), readdirSync: jest.fn().mockReturnValue([]), statSync: jest.fn(filePath => ({ @@ -15,8 +15,8 @@ jest.mock('fs', () => ({ })); jest.mock('prettier'); -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import prettier from 'prettier'; import babelTraverse from '@babel/traverse'; import {Frame} from 'jest-message-util'; diff --git a/packages/jest-snapshot/src/__tests__/utils.test.ts b/packages/jest-snapshot/src/__tests__/utils.test.ts index df0845440f49..4e7816161d23 100644 --- a/packages/jest-snapshot/src/__tests__/utils.test.ts +++ b/packages/jest-snapshot/src/__tests__/utils.test.ts @@ -5,13 +5,13 @@ * LICENSE file in the root directory of this source tree. */ -jest.mock('fs', () => ({ - ...jest.genMockFromModule('fs'), +jest.mock('graceful-fs', () => ({ + ...jest.createMockFromModule('fs'), existsSync: jest.fn().mockReturnValue(true), })); -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import assert = require('assert'); import chalk = require('chalk'); @@ -179,7 +179,7 @@ test('escaping', () => { 'exports[`key`] = `"\'\\\\`;\n', ); - // @ts-ignore + // @ts-expect-error const exports = {}; // eslint-disable-line @typescript-eslint/no-unused-vars // eslint-disable-next-line no-eval const readData = eval('var exports = {}; ' + writtenData + ' exports'); diff --git a/packages/jest-snapshot/src/index.ts b/packages/jest-snapshot/src/index.ts index a1edaaa8da49..2fed614d7d53 100644 --- a/packages/jest-snapshot/src/index.ts +++ b/packages/jest-snapshot/src/index.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import type {FS as HasteFS} from 'jest-haste-map'; diff --git a/packages/jest-snapshot/src/inline_snapshots.ts b/packages/jest-snapshot/src/inline_snapshots.ts index 83691b63ed08..9ed55f8ae0c0 100644 --- a/packages/jest-snapshot/src/inline_snapshots.ts +++ b/packages/jest-snapshot/src/inline_snapshots.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import semver = require('semver'); import { CallExpression, diff --git a/packages/jest-snapshot/src/utils.ts b/packages/jest-snapshot/src/utils.ts index 0b75df741b8e..d1ef478e7fbf 100644 --- a/packages/jest-snapshot/src/utils.ts +++ b/packages/jest-snapshot/src/utils.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import makeDir = require('make-dir'); import naturalCompare = require('natural-compare'); import chalk = require('chalk'); diff --git a/packages/jest-source-map/package.json b/packages/jest-source-map/package.json index 35dd3a4b03c5..75d347cdb343 100644 --- a/packages/jest-source-map/package.json +++ b/packages/jest-source-map/package.json @@ -1,6 +1,6 @@ { "name": "@jest/source-map", - "version": "25.2.6", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,23 +9,16 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "callsites": "^3.0.0", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.4", "source-map": "^0.6.0" }, "devDependencies": { "@types/graceful-fs": "^4.1.2" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-source-map/src/__tests__/getCallsite.test.ts b/packages/jest-source-map/src/__tests__/getCallsite.test.ts index 0de9b483bc64..7ddf40b4a51b 100644 --- a/packages/jest-source-map/src/__tests__/getCallsite.test.ts +++ b/packages/jest-source-map/src/__tests__/getCallsite.test.ts @@ -5,13 +5,13 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import SourceMap from 'source-map'; import getCallsite from '../getCallsite'; // Node 10.5.x compatibility -jest.mock('fs', () => ({ - ...jest.genMockFromModule('fs'), +jest.mock('graceful-fs', () => ({ + ...jest.createMockFromModule('fs'), ReadStream: jest.requireActual('fs').ReadStream, WriteStream: jest.requireActual('fs').WriteStream, })); @@ -44,7 +44,7 @@ describe('getCallsite', () => { const sourceMapColumn = 1; const sourceMapLine = 2; - // @ts-ignore + // @ts-expect-error SourceMap.SourceMapConsumer = class { originalPositionFor(params: Record) { expect(params).toMatchObject({ diff --git a/packages/jest-source-map/src/getCallsite.ts b/packages/jest-source-map/src/getCallsite.ts index ecb903d7729e..863ce4327f94 100644 --- a/packages/jest-source-map/src/getCallsite.ts +++ b/packages/jest-source-map/src/getCallsite.ts @@ -57,7 +57,7 @@ export default ( if (sourceMapFileName) { try { const sourceMap = readFileSync(sourceMapFileName, 'utf8'); - // @ts-ignore: Not allowed to pass string + // @ts-expect-error: Not allowed to pass string addSourceMapConsumer(stack, new SourceMapConsumer(sourceMap)); } catch (e) { // ignore diff --git a/packages/jest-test-result/package.json b/packages/jest-test-result/package.json index fba5b4302545..16d101b0d721 100644 --- a/packages/jest-test-result/package.json +++ b/packages/jest-test-result/package.json @@ -1,6 +1,6 @@ { "name": "@jest/test-result", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,21 +9,14 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/console": "^25.4.0", - "@jest/types": "^25.4.0", + "@jest/console": "^26.0.1", + "@jest/types": "^26.0.1", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-test-result/src/__tests__/formatTestResults.test.ts b/packages/jest-test-result/src/__tests__/formatTestResults.test.ts index 523d79b34d7c..3b448597d90c 100644 --- a/packages/jest-test-result/src/__tests__/formatTestResults.test.ts +++ b/packages/jest-test-result/src/__tests__/formatTestResults.test.ts @@ -20,7 +20,7 @@ describe('formatTestResults', () => { { numFailingTests: 0, perfStats: {end: 2, start: 1}, - // @ts-ignore + // @ts-expect-error testResults: [assertion], }, ], diff --git a/packages/jest-test-result/src/helpers.ts b/packages/jest-test-result/src/helpers.ts index 9076b2127fae..1e56aecebb23 100644 --- a/packages/jest-test-result/src/helpers.ts +++ b/packages/jest-test-result/src/helpers.ts @@ -48,7 +48,7 @@ export const buildFailureTestResult = ( err: SerializableError, ): TestResult => ({ console: undefined, - displayName: '', + displayName: undefined, failureMessage: null, leaks: false, numFailingTests: 0, diff --git a/packages/jest-test-sequencer/package.json b/packages/jest-test-sequencer/package.json index 167fe0758485..e770122a4b8f 100644 --- a/packages/jest-test-sequencer/package.json +++ b/packages/jest-test-sequencer/package.json @@ -1,6 +1,6 @@ { "name": "@jest/test-sequencer", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,21 +9,18 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/test-result": "^25.4.0", - "jest-haste-map": "^25.4.0", - "jest-runner": "^25.4.0", - "jest-runtime": "^25.4.0" + "@jest/test-result": "^26.0.1", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.0.1", + "jest-runner": "^26.0.1", + "jest-runtime": "^26.0.1" + }, + "devDependencies": { + "@types/graceful-fs": "^4.1.3" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js b/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js index 005338de0063..bebb86400145 100644 --- a/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js +++ b/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js @@ -4,14 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -'use strict'; -import * as fs from 'fs'; import * as path from 'path'; +import * as fs from 'graceful-fs'; import TestSequencer from '../index'; -jest.mock('fs', () => ({ - ...jest.genMockFromModule('fs'), +jest.mock('graceful-fs', () => ({ + ...jest.createMockFromModule('fs'), existsSync: jest.fn(() => true), readFileSync: jest.fn(() => '{}'), })); diff --git a/packages/jest-test-sequencer/src/index.ts b/packages/jest-test-sequencer/src/index.ts index 286188126d30..26b45976311e 100644 --- a/packages/jest-test-sequencer/src/index.ts +++ b/packages/jest-test-sequencer/src/index.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {AggregatedResult} from '@jest/test-result'; import {getCacheFilePath} from 'jest-haste-map'; import type {Context} from 'jest-runtime'; diff --git a/packages/jest-transform/package.json b/packages/jest-transform/package.json index d3e250138097..03ebfa288e7d 100644 --- a/packages/jest-transform/package.json +++ b/packages/jest-transform/package.json @@ -1,6 +1,6 @@ { "name": "@jest/transform", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,27 +9,19 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/core": "^7.1.0", - "@jest/types": "^25.4.0", + "@jest/types": "^26.0.1", "babel-plugin-istanbul": "^6.0.0", - "chalk": "^3.0.0", + "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.3", - "jest-haste-map": "^25.4.0", - "jest-regex-util": "^25.2.6", - "jest-util": "^25.4.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-util": "^26.0.1", "micromatch": "^4.0.2", "pirates": "^4.0.1", - "realpath-native": "^2.0.0", "slash": "^3.0.0", "source-map": "^0.6.1", "write-file-atomic": "^3.0.0" @@ -45,7 +37,7 @@ "jest-snapshot-serializer-raw": "^1.1.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-transform/src/ScriptTransformer.ts b/packages/jest-transform/src/ScriptTransformer.ts index 46ae3afb049f..fc4373c5fc48 100644 --- a/packages/jest-transform/src/ScriptTransformer.ts +++ b/packages/jest-transform/src/ScriptTransformer.ts @@ -8,17 +8,21 @@ import {createHash} from 'crypto'; import * as path from 'path'; import type {Config} from '@jest/types'; -import {createDirectory, interopRequireDefault, isPromise} from 'jest-util'; +import { + createDirectory, + interopRequireDefault, + isPromise, + tryRealpath, +} from 'jest-util'; import * as fs from 'graceful-fs'; import {transformSync as babelTransform} from '@babel/core'; -// @ts-ignore: should just be `require.resolve`, but the tests mess that up +// @ts-expect-error: should just be `require.resolve`, but the tests mess that up import babelPluginIstanbul from 'babel-plugin-istanbul'; import {fromSource as sourcemapFromSource} from 'convert-source-map'; import HasteMap = require('jest-haste-map'); import stableStringify = require('fast-json-stable-stringify'); import slash = require('slash'); import {sync as writeFileAtomic} from 'write-file-atomic'; -import {sync as realpath} from 'realpath-native'; import {addHook} from 'pirates'; import type { Options, @@ -172,34 +176,37 @@ export default class ScriptTransformer { } private _getTransformer(filename: Config.Path) { - let transform: Transformer | null = null; if (!this._config.transform || !this._config.transform.length) { return null; } const transformPath = this._getTransformPath(filename); - if (transformPath) { - const transformer = this._transformCache.get(transformPath); - if (transformer != null) { - return transformer; - } - transform = require(transformPath); + if (!transformPath) { + return null; + } - if (!transform) { - throw new TypeError('Jest: a transform must export something.'); - } - const transformerConfig = this._transformConfigCache.get(transformPath); - if (typeof transform.createTransformer === 'function') { - transform = transform.createTransformer(transformerConfig); - } - if (typeof transform.process !== 'function') { - throw new TypeError( - 'Jest: a transform must export a `process` function.', - ); - } - this._transformCache.set(transformPath, transform); + const transformer = this._transformCache.get(transformPath); + if (transformer) { + return transformer; } + + let transform: Transformer = require(transformPath); + + if (!transform) { + throw new TypeError('Jest: a transform must export something.'); + } + const transformerConfig = this._transformConfigCache.get(transformPath); + if (typeof transform.createTransformer === 'function') { + transform = transform.createTransformer(transformerConfig); + } + if (typeof transform.process !== 'function') { + throw new TypeError( + 'Jest: a transform must export a `process` function.', + ); + } + this._transformCache.set(transformPath, transform); + return transform; } @@ -247,14 +254,6 @@ export default class ScriptTransformer { return input; } - private _getRealPath(filepath: Config.Path): Config.Path { - try { - return realpath(filepath) || filepath; - } catch (err) { - return filepath; - } - } - // We don't want to expose transformers to the outside - this function is just // to warm up `this._transformCache` preloadTransformer(filepath: Config.Path): void { @@ -269,7 +268,7 @@ export default class ScriptTransformer { supportsDynamicImport = false, supportsStaticESM = false, ): TransformResult { - const filename = this._getRealPath(filepath); + const filename = tryRealpath(filepath); const transform = this._getTransformer(filename); const cacheFilePath = this._getFileCachePath( filename, @@ -567,7 +566,7 @@ export default class ScriptTransformer { /** * @deprecated use `this.shouldTransform` instead */ - // @ts-ignore: Unused and private - remove in Jest 25 + // @ts-expect-error: Unused and private - remove in Jest 25 private _shouldTransform(filename: Config.Path): boolean { return this.shouldTransform(filename); } diff --git a/packages/jest-transform/src/__tests__/__snapshots__/script_transformer.test.js.snap b/packages/jest-transform/src/__tests__/__snapshots__/script_transformer.test.js.snap index 13584d3f6693..6114987506eb 100644 --- a/packages/jest-transform/src/__tests__/__snapshots__/script_transformer.test.js.snap +++ b/packages/jest-transform/src/__tests__/__snapshots__/script_transformer.test.js.snap @@ -4,7 +4,6 @@ exports[`ScriptTransformer passes expected transform options to getCacheKey 1`] Object { "config": Object { "automock": false, - "browser": false, "cache": true, "cacheDirectory": "/cache/", "clearMocks": false, @@ -15,14 +14,12 @@ Object { "displayName": undefined, "errorOnDeprecated": false, "extraGlobals": Array [], - "filter": null, + "filter": undefined, "forceCoverageMatch": Array [], - "globalSetup": null, - "globalTeardown": null, + "globalSetup": undefined, + "globalTeardown": undefined, "globals": Object {}, - "haste": Object { - "providesModuleNodeModules": Array [], - }, + "haste": Object {}, "moduleDirectories": Array [], "moduleFileExtensions": Array [ "js", @@ -35,7 +32,7 @@ Object { "prettierPath": "prettier", "resetMocks": false, "resetModules": false, - "resolver": null, + "resolver": undefined, "restoreMocks": false, "rootDir": "/", "roots": Array [], @@ -44,7 +41,7 @@ Object { "setupFilesAfterEnv": Array [], "skipFilter": false, "skipNodeResolution": false, - "snapshotResolver": null, + "snapshotResolver": undefined, "snapshotSerializers": Array [], "testEnvironment": "node", "testEnvironmentOptions": Object {}, @@ -66,7 +63,7 @@ Object { "transformIgnorePatterns": Array [ "/node_modules/", ], - "unmockedModulePathPatterns": null, + "unmockedModulePathPatterns": undefined, "watchPathIgnorePatterns": Array [], }, "instrument": true, @@ -115,18 +112,19 @@ function cov_25u22311x4() { } var actualCoverage = coverage[path]; - - cov_25u22311x4 = function () { - return actualCoverage; - }; - + { + // @ts-ignore + cov_25u22311x4 = function () { + return actualCoverage; + }; + } return actualCoverage; } cov_25u22311x4(); cov_25u22311x4().s[0]++; module.exports = "banana"; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhbmFuYS5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQUEsTUFBTSxDQUFDQyxPQUFQLEdBQWlCLFFBQWpCIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBcImJhbmFuYVwiOyJdfQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhbmFuYS5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlWTs7Ozs7Ozs7OztBQWZaQSxNQUFNLENBQUNDLE9BQVAsR0FBaUIsUUFBakIiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IFwiYmFuYW5hXCI7Il19 `; exports[`ScriptTransformer transforms a file properly 2`] = ` @@ -206,11 +204,12 @@ function cov_23yvu8etmu() { } var actualCoverage = coverage[path]; - - cov_23yvu8etmu = function () { - return actualCoverage; - }; - + { + // @ts-ignore + cov_23yvu8etmu = function () { + return actualCoverage; + }; + } return actualCoverage; } @@ -223,14 +222,14 @@ module.exports = () => { cov_23yvu8etmu().s[1]++; return "kiwi"; }; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImtpd2kuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUFBLE1BQU0sQ0FBQ0MsT0FBUCxHQUFpQixNQUFNO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBTSxDQUE3QiIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKCkgPT4gXCJraXdpXCI7Il19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImtpd2kuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlWTs7Ozs7Ozs7Ozs7QUFmWkEsTUFBTSxDQUFDQyxPQUFQLEdBQWlCLE1BQU07QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFNLENBQTdCIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAoKSA9PiBcImtpd2lcIjsiXX0= `; exports[`ScriptTransformer uses multiple preprocessors 1`] = ` const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{"providesModuleNodeModules":[]},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotResolver":null,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"],["^.+\\\\.css$","css-preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"unmockedModulePathPatterns":null,"watchPathIgnorePatterns":[]}', + config: '{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"],["^.+\\\\.css$","css-preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]}', }; `; @@ -247,7 +246,7 @@ exports[`ScriptTransformer uses the supplied preprocessor 1`] = ` const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{"providesModuleNodeModules":[]},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotResolver":null,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"unmockedModulePathPatterns":null,"watchPathIgnorePatterns":[]}', + config: '{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]}', }; `; diff --git a/packages/jest-transform/src/__tests__/script_transformer.test.js b/packages/jest-transform/src/__tests__/script_transformer.test.js index b6570ee1c404..fd8c31d2b007 100644 --- a/packages/jest-transform/src/__tests__/script_transformer.test.js +++ b/packages/jest-transform/src/__tests__/script_transformer.test.js @@ -10,10 +10,10 @@ import {wrap} from 'jest-snapshot-serializer-raw'; import {makeGlobalConfig, makeProjectConfig} from '../../../../TestUtils'; jest - .mock('fs', () => + .mock('graceful-fs', () => // Node 10.5.x compatibility ({ - ...jest.genMockFromModule('fs'), + ...jest.createMockFromModule('fs'), ReadStream: jest.requireActual('fs').ReadStream, WriteStream: jest.requireActual('fs').WriteStream, readFileSync: jest.fn((path, options) => { @@ -29,7 +29,12 @@ jest }), }), ) - .mock('graceful-fs') + .mock('graceful-fs', () => ({ + ...jest.requireActual('graceful-fs'), + realPathSync: { + native: dirInput => dirInput, + }, + })) .mock('jest-haste-map', () => ({ getCacheFilePath: (cacheDir, baseDir, version) => cacheDir + baseDir, })) @@ -553,7 +558,8 @@ describe('ScriptTransformer', () => { version: 3, sources: ['banana.js'], names: ['content'], - mappings: ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAO', + mappings: + ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeY;;;;;;;;;;AAfZA,OAAO', sourcesContent: ['content'], }; /* eslint-enable */ @@ -591,7 +597,7 @@ describe('ScriptTransformer', () => { sources: ['banana.js'], names: ['module', 'exports'], mappings: - ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,MAAM,CAACC,OAAP,GAAiB,QAAjB', + ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeY;;;;;;;;;;AAfZA,MAAM,CAACC,OAAP,GAAiB,QAAjB', sourcesContent: ['module.exports = "banana";'], }; /* eslint-enable */ diff --git a/packages/jest-transform/src/types.ts b/packages/jest-transform/src/types.ts index b984980e1112..483c8e6cc9a4 100644 --- a/packages/jest-transform/src/types.ts +++ b/packages/jest-transform/src/types.ts @@ -27,11 +27,8 @@ export type Options = ShouldInstrumentOptions & supportsStaticESM: boolean; }>; -// extends directly after https://github.com/sandersn/downlevel-dts/issues/33 is fixed -type SourceMapWithVersion = Omit; - // This is fixed in source-map@0.7.x, but we can't upgrade yet since it's async -interface FixedRawSourceMap extends SourceMapWithVersion { +interface FixedRawSourceMap extends Omit { version: number; } diff --git a/packages/jest-types/package.json b/packages/jest-types/package.json index d4f560e9b74c..37ac76583ff3 100644 --- a/packages/jest-types/package.json +++ b/packages/jest-types/package.json @@ -1,29 +1,22 @@ { "name": "@jest/types", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", "directory": "packages/jest-types" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^1.1.1", "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" + "chalk": "^4.0.0" }, "devDependencies": { "@types/node": "*" diff --git a/packages/jest-types/src/Circus.ts b/packages/jest-types/src/Circus.ts index 1ffc9cf4673c..c1ef85c79892 100644 --- a/packages/jest-types/src/Circus.ts +++ b/packages/jest-types/src/Circus.ts @@ -187,6 +187,7 @@ export type State = { currentlyRunningTest?: TestEntry | null; // including when hooks are being executed expand?: boolean; // expand error messages hasFocusedTests: boolean; // that are defined using test.only + hasStarted: boolean; // whether the rootDescribeBlock has started running // Store process error handlers. During the run we inject our own // handlers (so we could fail tests on unhandled errors) and later restore // the original ones. @@ -200,19 +201,22 @@ export type State = { }; export type DescribeBlock = { - children: Array; + type: 'describeBlock'; + children: Array; hooks: Array; mode: BlockMode; name: BlockName; parent?: DescribeBlock; + /** @deprecated Please get from `children` array instead */ tests: Array; }; -export type TestError = Exception | Array<[Exception | undefined, Exception]>; // the error from the test, as well as a backup error for async +export type TestError = Exception | [Exception | undefined, Exception]; // the error from the test, as well as a backup error for async export type TestEntry = { + type: 'test'; asyncError: Exception; // Used if the test failure contains no usable stack trace - errors: TestError; + errors: Array; fn?: TestFn; invocations: number; mode: TestMode; diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index 6c5ab99f1a26..76a7b33a8f77 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -20,7 +20,6 @@ export type HasteConfig = { defaultPlatform?: string | null; hasteImplModulePath?: string; platforms?: Array; - providesModuleNodeModules: Array; throwOnModuleCollision?: boolean; }; @@ -34,7 +33,6 @@ export interface ConfigGlobals { export type DefaultOptions = { automock: boolean; bail: number; - browser: boolean; cache: boolean; cacheDirectory: Path; changedFilesWithAncestor: boolean; @@ -86,12 +84,10 @@ export type DefaultOptions = { watchman: boolean; }; -export type DisplayName = - | string - | { - name: string; - color: typeof chalk.Color; - }; +export type DisplayName = { + name: string; + color: typeof chalk.Color; +}; export type InitialOptionsWithRootDir = InitialOptions & Required>; @@ -99,7 +95,6 @@ export type InitialOptionsWithRootDir = InitialOptions & export type InitialOptions = Partial<{ automock: boolean; bail: boolean | number; - browser: boolean; cache: boolean; cacheDirectory: Path; clearMocks: boolean; @@ -122,7 +117,7 @@ export type InitialOptions = Partial<{ dependencyExtractor: string; detectLeaks: boolean; detectOpenHandles: boolean; - displayName: DisplayName; + displayName: string | DisplayName; expand: boolean; extraGlobals: Array; filter: Path; @@ -301,7 +296,6 @@ export type GlobalConfig = { export type ProjectConfig = { automock: boolean; - browser: boolean; cache: boolean; cacheDirectory: Path; clearMocks: boolean; @@ -348,7 +342,7 @@ export type ProjectConfig = { testRegex: Array; testRunner: string; testURL: string; - timers: 'real' | 'fake'; + timers: 'real' | 'fake' | 'modern' | 'legacy'; transform: Array<[string, Path, Record]>; transformIgnorePatterns: Array; watchPathIgnorePatterns: Array; @@ -360,7 +354,6 @@ export type Argv = Arguments< all: boolean; automock: boolean; bail: boolean | number; - browser: boolean; cache: boolean; cacheDirectory: string; changedFilesWithAncestor: boolean; @@ -413,6 +406,7 @@ export type Argv = Arguments< rootDir: string; roots: Array; runInBand: boolean; + selectProjects: Array; setupFiles: Array; setupFilesAfterEnv: Array; showConfig: boolean; diff --git a/packages/jest-types/src/Global.ts b/packages/jest-types/src/Global.ts index f4c0c327ead4..df96271c126a 100644 --- a/packages/jest-types/src/Global.ts +++ b/packages/jest-types/src/Global.ts @@ -93,10 +93,9 @@ export interface GlobalAdditions extends TestFrameworkGlobals { spyOnProperty: () => void; } -// TODO: Maybe add `| Window` in the future? -// extends directly after https://github.com/sandersn/downlevel-dts/issues/33 is fixed -type NodeGlobalWithoutAdditions = Omit; - -export interface Global extends GlobalAdditions, NodeGlobalWithoutAdditions { +export interface Global + extends GlobalAdditions, + // TODO: Maybe add `| Window` in the future? + Omit { [extras: string]: any; } diff --git a/packages/jest-util/package.json b/packages/jest-util/package.json index 0123d0e4d56d..10cfaa9030df 100644 --- a/packages/jest-util/package.json +++ b/packages/jest-util/package.json @@ -1,6 +1,6 @@ { "name": "jest-util", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,16 +9,10 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "chalk": "^3.0.0", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", "is-ci": "^2.0.0", "make-dir": "^3.0.0" }, @@ -28,7 +22,7 @@ "@types/node": "*" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-util/src/__tests__/createProcessObject.test.ts b/packages/jest-util/src/__tests__/createProcessObject.test.ts index c1658f793983..670e4f66b386 100644 --- a/packages/jest-util/src/__tests__/createProcessObject.test.ts +++ b/packages/jest-util/src/__tests__/createProcessObject.test.ts @@ -26,9 +26,9 @@ it('creates a process object that looks like the original one', () => { // "_events" property is checked to ensure event emitter properties are // properly copied. ['argv', 'env', '_events'].forEach(key => { - // @ts-ignore + // @ts-expect-error expect(fakeProcess[key]).toEqual(process[key]); - // @ts-ignore + // @ts-expect-error expect(fakeProcess[key]).not.toBe(process[key]); }); @@ -47,7 +47,7 @@ it('checks that process.env works as expected on Linux platforms', () => { // Existing properties inside process.env are copied to the fake environment. process.env.PROP_STRING = 'foo'; - // @ts-ignore + // @ts-expect-error process.env.PROP_NUMBER = 3; process.env.PROP_UNDEFINED = undefined; diff --git a/packages/jest-util/src/__tests__/deepCyclicCopy.test.ts b/packages/jest-util/src/__tests__/deepCyclicCopy.test.ts index 926bbd540da3..71ac408dec55 100644 --- a/packages/jest-util/src/__tests__/deepCyclicCopy.test.ts +++ b/packages/jest-util/src/__tests__/deepCyclicCopy.test.ts @@ -23,7 +23,7 @@ it('returns the same value for primitive or function values', () => { it('does not execute getters/setters, but copies them', () => { const fn = jest.fn(); const obj = { - // @ts-ignore + // @ts-expect-error get foo() { fn(); }, @@ -84,13 +84,13 @@ it('uses the blacklist to avoid copying properties on the first level', () => { }); it('does not keep the prototype by default when top level is object', () => { - // @ts-ignore + // @ts-expect-error const sourceObject = new (function () {})(); - // @ts-ignore + // @ts-expect-error sourceObject.nestedObject = new (function () {})(); - // @ts-ignore + // @ts-expect-error sourceObject.nestedArray = new (function () { - // @ts-ignore + // @ts-expect-error this.length = 0; })(); @@ -124,9 +124,9 @@ it('does not keep the prototype by default when top level is object', () => { it('does not keep the prototype by default when top level is array', () => { const spy = jest.spyOn(Array, 'isArray').mockImplementation(() => true); - // @ts-ignore + // @ts-expect-error const sourceArray = new (function () { - // @ts-ignore + // @ts-expect-error this.length = 0; })(); @@ -142,9 +142,9 @@ it('does not keep the prototype by default when top level is array', () => { it('does not keep the prototype of arrays when keepPrototype = false', () => { const spy = jest.spyOn(Array, 'isArray').mockImplementation(() => true); - // @ts-ignore + // @ts-expect-error const sourceArray = new (function () { - // @ts-ignore + // @ts-expect-error this.length = 0; })(); @@ -160,9 +160,9 @@ it('does not keep the prototype of arrays when keepPrototype = false', () => { it('keeps the prototype of arrays when keepPrototype = true', () => { const spy = jest.spyOn(Array, 'isArray').mockImplementation(() => true); - // @ts-ignore + // @ts-expect-error const sourceArray = new (function () { - // @ts-ignore + // @ts-expect-error this.length = 0; })(); @@ -173,13 +173,13 @@ it('keeps the prototype of arrays when keepPrototype = true', () => { }); it('does not keep the prototype for objects when keepPrototype = false', () => { - // @ts-ignore + // @ts-expect-error const sourceobject = new (function () {})(); - // @ts-ignore + // @ts-expect-error sourceobject.nestedObject = new (function () {})(); - // @ts-ignore + // @ts-expect-error sourceobject.nestedArray = new (function () { - // @ts-ignore + // @ts-expect-error this.length = 0; })(); @@ -210,13 +210,13 @@ it('does not keep the prototype for objects when keepPrototype = false', () => { }); it('keeps the prototype for objects when keepPrototype = true', () => { - // @ts-ignore + // @ts-expect-error const sourceObject = new (function () {})(); - // @ts-ignore + // @ts-expect-error sourceObject.nestedObject = new (function () {})(); - // @ts-ignore + // @ts-expect-error sourceObject.nestedArray = new (function () { - // @ts-ignore + // @ts-expect-error this.length = 0; })(); diff --git a/packages/jest-util/src/__tests__/formatTime.test.ts b/packages/jest-util/src/__tests__/formatTime.test.ts new file mode 100644 index 000000000000..a4506d11b21f --- /dev/null +++ b/packages/jest-util/src/__tests__/formatTime.test.ts @@ -0,0 +1,52 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import formatTime from '../formatTime'; + +it('defaults to milliseconds', () => { + expect(formatTime(42)).toBe('42 ms'); +}); + +it('formats seconds properly', () => { + expect(formatTime(42, 0)).toBe('42 s'); +}); + +it('formats milliseconds properly', () => { + expect(formatTime(42, -3)).toBe('42 ms'); +}); + +it('formats microseconds properly', () => { + expect(formatTime(42, -6)).toBe('42 μs'); +}); + +it('formats nanoseconds properly', () => { + expect(formatTime(42, -9)).toBe('42 ns'); +}); + +it('interprets lower than lowest powers as nanoseconds', () => { + expect(formatTime(42, -12)).toBe('42 ns'); +}); + +it('interprets higher than highest powers as seconds', () => { + expect(formatTime(42, 3)).toBe('42 s'); +}); + +it('interprets non-multiple-of-3 powers as next higher prefix', () => { + expect(formatTime(42, -4)).toBe('42 ms'); +}); + +it('formats the quantity properly when pad length is lower', () => { + expect(formatTime(42, -3, 1)).toBe('42 ms'); +}); + +it('formats the quantity properly when pad length is equal', () => { + expect(formatTime(42, -3, 2)).toBe('42 ms'); +}); + +it('left pads the quantity properly when pad length is higher', () => { + expect(formatTime(42, -3, 5)).toBe(' 42 ms'); +}); diff --git a/packages/jest-util/src/__tests__/installCommonGlobals.test.ts b/packages/jest-util/src/__tests__/installCommonGlobals.test.ts index d61cd59389f8..d3f57912a483 100644 --- a/packages/jest-util/src/__tests__/installCommonGlobals.test.ts +++ b/packages/jest-util/src/__tests__/installCommonGlobals.test.ts @@ -16,7 +16,7 @@ function getGlobal(): NodeJS.Global { beforeEach(() => { fake = jest.fn(); - // @ts-ignore + // @ts-expect-error global.DTRACE_NET_SERVER_CONNECTION = fake; installCommonGlobals = require('../installCommonGlobals').default; diff --git a/packages/jest-util/src/convertDescriptorToString.ts b/packages/jest-util/src/convertDescriptorToString.ts index 50324d218204..c10ea8bf7f83 100644 --- a/packages/jest-util/src/convertDescriptorToString.ts +++ b/packages/jest-util/src/convertDescriptorToString.ts @@ -29,7 +29,7 @@ export default function convertDescriptorToString< const stringified = descriptor.toString(); const typeDescriptorMatch = stringified.match(/class|function/); const indexOfNameSpace = - // @ts-ignore: typeDescriptorMatch exists + // @ts-expect-error: typeDescriptorMatch exists typeDescriptorMatch.index + typeDescriptorMatch[0].length; const indexOfNameAfterSpace = stringified.search(/\(|\{/); const name = stringified.substring(indexOfNameSpace, indexOfNameAfterSpace); diff --git a/packages/jest-util/src/formatTime.ts b/packages/jest-util/src/formatTime.ts new file mode 100644 index 000000000000..e29214d7838b --- /dev/null +++ b/packages/jest-util/src/formatTime.ts @@ -0,0 +1,22 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export default function formatTime( + time: number, + prefixPower: number = -3, + padLeftLength: number = 0, +): string { + const prefixes = ['n', 'μ', 'm', '']; + const prefixIndex = Math.max( + 0, + Math.min( + Math.trunc(prefixPower / 3) + prefixes.length - 1, + prefixes.length - 1, + ), + ); + return `${String(time).padStart(padLeftLength)} ${prefixes[prefixIndex]}s`; +} diff --git a/packages/jest-util/src/index.ts b/packages/jest-util/src/index.ts index e7b81c46931c..cfd00f7fd55d 100644 --- a/packages/jest-util/src/index.ts +++ b/packages/jest-util/src/index.ts @@ -20,5 +20,7 @@ export {default as replacePathSepForGlob} from './replacePathSepForGlob'; export {default as testPathPatternToRegExp} from './testPathPatternToRegExp'; import * as preRunMessage from './preRunMessage'; export {default as pluralize} from './pluralize'; +export {default as formatTime} from './formatTime'; +export {default as tryRealpath} from './tryRealpath'; export {preRunMessage, specialChars}; diff --git a/packages/jest-util/src/installCommonGlobals.ts b/packages/jest-util/src/installCommonGlobals.ts index bd8d3bce4077..ece4a40649d0 100644 --- a/packages/jest-util/src/installCommonGlobals.ts +++ b/packages/jest-util/src/installCommonGlobals.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import createProcessObject from './createProcessObject'; import deepCyclicCopy from './deepCyclicCopy'; @@ -55,9 +55,9 @@ export default function ( // Forward some APIs. DTRACE.forEach(dtrace => { - // @ts-ignore: no index + // @ts-expect-error: no index globalObject[dtrace] = function (...args: Array) { - // @ts-ignore: no index + // @ts-expect-error: no index return global[dtrace].apply(this, args); }; }); diff --git a/packages/jest-util/src/setGlobal.ts b/packages/jest-util/src/setGlobal.ts index 012b3bd721ae..f840a7f4bae4 100644 --- a/packages/jest-util/src/setGlobal.ts +++ b/packages/jest-util/src/setGlobal.ts @@ -10,6 +10,6 @@ export default ( key: string, value: unknown, ): void => { - // @ts-ignore: no index + // @ts-expect-error: no index globalToMutate[key] = value; }; diff --git a/packages/jest-util/src/tryRealpath.ts b/packages/jest-util/src/tryRealpath.ts new file mode 100644 index 000000000000..ff14e377a963 --- /dev/null +++ b/packages/jest-util/src/tryRealpath.ts @@ -0,0 +1,21 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {realpathSync} from 'graceful-fs'; +import type {Config} from '@jest/types'; + +export default function tryRealpath(path: Config.Path): Config.Path { + try { + path = realpathSync.native(path); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } + + return path; +} diff --git a/packages/jest-validate/package.json b/packages/jest-validate/package.json index 6c6b82dcab82..10b4657088da 100644 --- a/packages/jest-validate/package.json +++ b/packages/jest-validate/package.json @@ -1,6 +1,6 @@ { "name": "jest-validate", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,26 +9,19 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/types": "^25.4.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "jest-get-type": "^25.2.6", + "@jest/types": "^26.0.1", + "camelcase": "^6.0.0", + "chalk": "^4.0.0", + "jest-get-type": "^26.0.0", "leven": "^3.1.0", - "pretty-format": "^25.4.0" + "pretty-format": "^26.0.1" }, "devDependencies": { "@types/yargs": "^15.0.3" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.ts.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.ts.snap index eeaf59c1a094..c7b918a31bca 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.ts.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.ts.snap @@ -109,12 +109,7 @@ exports[`pretty prints valid config for Object 1`] = ` Example: { - \\"haste\\": { - \\"providesModuleNodeModules\\": [ - \\"react\\", - \\"react-native\\" - ] - } + \\"haste\\": {} } " `; diff --git a/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts b/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts index ec4acfd6b59b..8e1438a5e810 100644 --- a/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts +++ b/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts @@ -29,9 +29,7 @@ const defaultConfig = { coverageReporters: ['json', 'text', 'lcov', 'clover'], expand: false, globals: {}, - haste: { - providesModuleNodeModules: [], - }, + haste: {}, moduleDirectories: ['node_modules'], moduleFileExtensions: ['js', 'json', 'jsx', 'node'], moduleNameMapper: {}, @@ -82,9 +80,7 @@ const validConfig = { expand: false, forceExit: false, globals: {}, - haste: { - providesModuleNodeModules: ['react', 'react-native'], - }, + haste: {}, logHeapUsage: true, moduleDirectories: ['node_modules'], moduleFileExtensions: ['js', 'json', 'jsx', 'node'], diff --git a/packages/jest-validate/src/__tests__/validate.test.ts b/packages/jest-validate/src/__tests__/validate.test.ts index aaf5e2bf172c..eb5af529bb2b 100644 --- a/packages/jest-validate/src/__tests__/validate.test.ts +++ b/packages/jest-validate/src/__tests__/validate.test.ts @@ -75,8 +75,8 @@ test('omits null and undefined config values', () => { test('recursively omits null and undefined config values', () => { const config = { - haste: { - providesModuleNodeModules: null, + coverageThreshold: { + global: null, }, }; expect( diff --git a/packages/jest-validate/src/condition.ts b/packages/jest-validate/src/condition.ts index b8bb69c763b6..9ae9be24416c 100644 --- a/packages/jest-validate/src/condition.ts +++ b/packages/jest-validate/src/condition.ts @@ -24,7 +24,7 @@ function validationConditionSingle( export function getValues(validOption: T): Array { if ( Array.isArray(validOption) && - // @ts-ignore + // @ts-expect-error validOption[MULTIPLE_VALID_OPTIONS_SYMBOL] ) { return validOption; @@ -43,7 +43,7 @@ export function multipleValidOptions>( ...args: T ): T[number] { const options = [...args]; - // @ts-ignore + // @ts-expect-error options[MULTIPLE_VALID_OPTIONS_SYMBOL] = true; return options; diff --git a/packages/jest-validate/src/validate.ts b/packages/jest-validate/src/validate.ts index 11713a4360ed..4e63da9eaed9 100644 --- a/packages/jest-validate/src/validate.ts +++ b/packages/jest-validate/src/validate.ts @@ -95,7 +95,10 @@ const allowsMultipleTypes = (key: string): boolean => key === 'maxWorkers'; const isOfTypeStringOrNumber = (value: any): boolean => typeof value === 'number' || typeof value === 'string'; -const validate = (config: Record, options: ValidationOptions) => { +const validate = ( + config: Record, + options: ValidationOptions, +): {hasDeprecationWarnings: boolean; isValid: boolean} => { hasDeprecationWarnings = false; // Preserve default blacklist entries even with user-supplied blacklist diff --git a/packages/jest-validate/src/validateCLIOptions.ts b/packages/jest-validate/src/validateCLIOptions.ts index d24c5debf80d..e3f34dfacc63 100644 --- a/packages/jest-validate/src/validateCLIOptions.ts +++ b/packages/jest-validate/src/validateCLIOptions.ts @@ -7,7 +7,7 @@ import type {Config} from '@jest/types'; import chalk = require('chalk'); -import camelcase from 'camelcase'; +import camelcase = require('camelcase'); import type {Options} from 'yargs'; import {ValidationError, createDidYouMeanMessage, format} from './utils'; import {deprecationWarning} from './deprecated'; diff --git a/packages/jest-watcher/package.json b/packages/jest-watcher/package.json index c95a55f5eb91..d07444b635d1 100644 --- a/packages/jest-watcher/package.json +++ b/packages/jest-watcher/package.json @@ -1,23 +1,16 @@ { "name": "jest-watcher", "description": "Delightful JavaScript Testing.", - "version": "25.4.0", + "version": "26.0.1", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/test-result": "^25.4.0", - "@jest/types": "^25.4.0", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", "ansi-escapes": "^4.2.1", - "chalk": "^3.0.0", - "jest-util": "^25.4.0", - "string-length": "^3.1.0" + "chalk": "^4.0.0", + "jest-util": "^26.0.1", + "string-length": "^4.0.1" }, "devDependencies": { "@types/node": "*" @@ -31,7 +24,7 @@ "url": "https://github.com/facebook/jest/issues" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "homepage": "https://jestjs.io/", "license": "MIT", diff --git a/packages/jest-watcher/src/BaseWatchPlugin.ts b/packages/jest-watcher/src/BaseWatchPlugin.ts index 17ed0d7c21e8..5f59a98a249e 100644 --- a/packages/jest-watcher/src/BaseWatchPlugin.ts +++ b/packages/jest-watcher/src/BaseWatchPlugin.ts @@ -28,13 +28,13 @@ class BaseWatchPlugin implements WatchPlugin { this._stdout = stdout; } - apply(_hooks: JestHookSubscriber) {} + apply(_hooks: JestHookSubscriber): void {} getUsageInfo(_globalConfig: Config.GlobalConfig): UsageData | null { return null; } - onKey(_key: string) {} + onKey(_key: string): void {} run( _globalConfig: Config.GlobalConfig, diff --git a/packages/jest-watcher/src/JestHooks.ts b/packages/jest-watcher/src/JestHooks.ts index 6f7f5fc4d03e..0e49c7681ca7 100644 --- a/packages/jest-watcher/src/JestHooks.ts +++ b/packages/jest-watcher/src/JestHooks.ts @@ -66,8 +66,8 @@ class JestHooks { }; } - isUsed(hook: AvailableHooks) { - return this._listeners[hook] && this._listeners[hook].length; + isUsed(hook: AvailableHooks): boolean { + return this._listeners[hook]?.length > 0; } getSubscriber(): Readonly { diff --git a/packages/jest-worker/package.json b/packages/jest-worker/package.json index ca26e4393389..3ae7e37c53ef 100644 --- a/packages/jest-worker/package.json +++ b/packages/jest-worker/package.json @@ -1,6 +1,6 @@ { "name": "jest-worker", - "version": "25.4.0", + "version": "26.0.0", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "merge-stream": "^2.0.0", "supports-color": "^7.0.0" @@ -28,7 +21,7 @@ "worker-farm": "^1.6.0" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/jest-worker/src/index.ts b/packages/jest-worker/src/index.ts index 4107f6c4657a..5858f6c7f90e 100644 --- a/packages/jest-worker/src/index.ts +++ b/packages/jest-worker/src/index.ts @@ -26,7 +26,7 @@ function getExposedMethods( const module: Function | Record = require(workerPath); exposedMethods = Object.keys(module).filter( - // @ts-ignore: no index + // @ts-expect-error: no index name => typeof module[name] === 'function', ); @@ -82,7 +82,7 @@ export default class JestWorker { }; if (this._options.WorkerPool) { - // @ts-ignore: constructor target any? + // @ts-expect-error: constructor target any? this._workerPool = new this._options.WorkerPool( workerPath, workerPoolOptions, @@ -113,7 +113,7 @@ export default class JestWorker { throw new TypeError('Cannot define a method called ' + name); } - // @ts-ignore: dynamic extension of the class instance is expected. + // @ts-expect-error: dynamic extension of the class instance is expected. this[name] = this._callFunctionWithArgs.bind(this, name); }); } diff --git a/packages/jest-worker/src/workers/ChildProcessWorker.ts b/packages/jest-worker/src/workers/ChildProcessWorker.ts index 8410fdbf0cf7..375b2788b3e8 100644 --- a/packages/jest-worker/src/workers/ChildProcessWorker.ts +++ b/packages/jest-worker/src/workers/ChildProcessWorker.ts @@ -167,7 +167,7 @@ export default class ChildProcessWorker implements WorkerInterface { if (error != null && typeof error === 'object') { const extra = error; - // @ts-ignore: no index + // @ts-expect-error: no index const NativeCtor = global[response[1]]; const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; @@ -176,7 +176,7 @@ export default class ChildProcessWorker implements WorkerInterface { error.stack = response[3]; for (const key in extra) { - // @ts-ignore: adding custom properties to errors. + // @ts-expect-error: adding custom properties to errors. error[key] = extra[key]; } } @@ -187,7 +187,7 @@ export default class ChildProcessWorker implements WorkerInterface { case PARENT_MESSAGE_SETUP_ERROR: error = new Error('Error when calling setup: ' + response[2]); - // @ts-ignore: adding custom properties to errors. + // @ts-expect-error: adding custom properties to errors. error.type = response[1]; error.stack = response[3]; diff --git a/packages/jest-worker/src/workers/NodeThreadsWorker.ts b/packages/jest-worker/src/workers/NodeThreadsWorker.ts index 64837106eda2..49f98be9d696 100644 --- a/packages/jest-worker/src/workers/NodeThreadsWorker.ts +++ b/packages/jest-worker/src/workers/NodeThreadsWorker.ts @@ -145,7 +145,7 @@ export default class ExperimentalWorker implements WorkerInterface { if (error != null && typeof error === 'object') { const extra = error; - // @ts-ignore: no index + // @ts-expect-error: no index const NativeCtor = global[response[1]]; const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; @@ -154,7 +154,7 @@ export default class ExperimentalWorker implements WorkerInterface { error.stack = response[3]; for (const key in extra) { - // @ts-ignore: no index + // @ts-expect-error: no index error[key] = extra[key]; } } @@ -164,7 +164,7 @@ export default class ExperimentalWorker implements WorkerInterface { case PARENT_MESSAGE_SETUP_ERROR: error = new Error('Error when calling setup: ' + response[2]); - // @ts-ignore: adding custom properties to errors. + // @ts-expect-error: adding custom properties to errors. error.type = response[1]; error.stack = response[3]; diff --git a/packages/jest/package.json b/packages/jest/package.json index cafa26011e5d..2fa45c69e1be 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -1,24 +1,17 @@ { "name": "jest", "description": "Delightful JavaScript Testing.", - "version": "25.4.0", + "version": "26.0.1", "main": "build/jest.js", "types": "build/jest.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { - "@jest/core": "^25.4.0", + "@jest/core": "^26.0.1", "import-local": "^3.0.2", - "jest-cli": "^25.4.0" + "jest-cli": "^26.0.1" }, "bin": "./bin/jest.js", "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "repository": { "type": "git", diff --git a/packages/pretty-format/package.json b/packages/pretty-format/package.json index 30f154979fdf..15419caa53da 100644 --- a/packages/pretty-format/package.json +++ b/packages/pretty-format/package.json @@ -1,6 +1,6 @@ { "name": "pretty-format", - "version": "25.4.0", + "version": "26.0.1", "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", @@ -10,17 +10,9 @@ "description": "Stringify any JavaScript value.", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, - "browser": "build-es5/index.js", "author": "James Kyle ", "dependencies": { - "@jest/types": "^25.4.0", + "@jest/types": "^26.0.1", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^16.12.0" @@ -30,12 +22,13 @@ "@types/react-is": "^16.7.1", "@types/react-test-renderer": "*", "immutable": "4.0.0-rc.9", + "jest-util": "^25.2.6", "react": "*", "react-dom": "*", "react-test-renderer": "*" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" }, "publishConfig": { "access": "public" diff --git a/packages/pretty-format/perf/test.js b/packages/pretty-format/perf/test.js index e155834f704c..9159d76f3e5f 100644 --- a/packages/pretty-format/perf/test.js +++ b/packages/pretty-format/perf/test.js @@ -8,6 +8,7 @@ const util = require('util'); const chalk = require('chalk'); const React = require('react'); +const {formatTime} = require('jest-util'); const ReactTestRenderer = require('react-test-renderer'); const prettyFormat = require('../build'); const ReactTestComponent = require('../build/plugins/ReactTestComponent'); @@ -78,13 +79,13 @@ function test(name, value, ignoreResult, prettyFormatOpts) { let message = current.name; if (current.time) { - message += ' - ' + String(current.time).padStart(6) + 'ns'; + message += ' - ' + formatTime(current.time, -9, 6); } if (current.total) { message += ' - ' + - current.total / NANOSECONDS + - 's total (' + + formatTime(current.total / NANOSECONDS, 0) + + ' total (' + TIMES_TO_RUN + ' runs)'; } diff --git a/packages/pretty-format/src/__tests__/prettyFormat.test.ts b/packages/pretty-format/src/__tests__/prettyFormat.test.ts index ddd99fc0ec7b..b217830a1c5f 100644 --- a/packages/pretty-format/src/__tests__/prettyFormat.test.ts +++ b/packages/pretty-format/src/__tests__/prettyFormat.test.ts @@ -14,7 +14,7 @@ function returnArguments(..._args: Array) { class MyArray extends Array {} function MyObject(value: unknown) { - // @ts-ignore + // @ts-expect-error this.name = value; } @@ -508,7 +508,7 @@ describe('prettyFormat()', () => { 'map non-empty': new Map([['name', 'value']]), 'object literal empty': {}, 'object literal non-empty': {name: 'value'}, - // @ts-ignore + // @ts-expect-error 'object with constructor': new MyObject('value'), 'object without constructor': Object.create(null), 'set empty': new Set(), @@ -540,7 +540,7 @@ describe('prettyFormat()', () => { it('throws on invalid options', () => { expect(() => { - // @ts-ignore + // @ts-expect-error prettyFormat({}, {invalidOption: true}); }).toThrow(); }); @@ -811,7 +811,7 @@ describe('prettyFormat()', () => { 'map non-empty': new Map([['name', 'value']]), 'object literal empty': {}, 'object literal non-empty': {name: 'value'}, - // @ts-ignore + // @ts-expect-error 'object with constructor': new MyObject('value'), 'object without constructor': Object.create(null), 'set empty': new Set(), diff --git a/packages/pretty-format/src/__tests__/react.test.tsx b/packages/pretty-format/src/__tests__/react.test.tsx index 88a64c3f3eee..e2cdad9c9a10 100644 --- a/packages/pretty-format/src/__tests__/react.test.tsx +++ b/packages/pretty-format/src/__tests__/react.test.tsx @@ -634,7 +634,7 @@ test('throws if theme option is null', () => { 'Hello, Mouse!', ); expect(() => { - // @ts-ignore + // @ts-expect-error formatElement(jsx, { highlight: true, theme: null, @@ -649,7 +649,7 @@ test('throws if theme option is not of type "object"', () => { {style: 'color:red'}, 'Hello, Mouse!', ); - // @ts-ignore + // @ts-expect-error formatElement(jsx, { highlight: true, theme: 'beautiful', diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 763858ae640b..441a8f813e2e 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,26 +1,19 @@ { "name": "@jest/test-utils", - "version": "25.3.0", + "version": "26.0.0", "private": true, "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@types/jest": "*", "@types/node": "*", - "@types/semver": "^6.2.1", + "@types/semver": "^7.1.0", "ansi-regex": "^5.0.0", "ansi-styles": "^4.1.0", - "semver": "^6.3.0" + "semver": "^7.3.2" }, "engines": { - "node": ">= 8.3" + "node": ">= 10.14.2" } } diff --git a/scripts/browserBuild.js b/scripts/browserBuild.js deleted file mode 100644 index 4c3257380c71..000000000000 --- a/scripts/browserBuild.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict'; - -const path = require('path'); -const webpack = require('webpack'); -const camelCase = require('camelcase'); -const rimraf = require('rimraf'); - -const transformOptions = require('../babel.config.js'); - -const babelEs5Options = { - // Dont load other config files - babelrc: false, - configFile: false, - overrides: transformOptions.overrides, - plugins: ['@babel/plugin-transform-strict-mode'], - presets: [ - [ - '@babel/preset-env', - { - // Required for Webpack - modules: 'cjs', - shippedProposals: true, - // Target ES5 - targets: 'IE 11', - }, - ], - ], -}; - -function browserBuild(pkgName, entryPath, destination) { - rimraf.sync(destination); - - return new Promise((resolve, reject) => { - webpack( - /* eslint-disable sort-keys */ - { - mode: 'development', - devtool: 'source-map', - entry: entryPath, - output: { - path: path.dirname(destination), - library: camelCase(pkgName), - libraryTarget: 'umd', - filename: path.basename(destination), - }, - module: { - rules: [ - { - test: /\.[jt]sx?$/, - loader: require.resolve('babel-loader'), - options: babelEs5Options, - }, - ], - }, - resolve: { - alias: { - chalk: path.resolve( - __dirname, - '../packages/expect/build/fakeChalk.js', - ), - }, - extensions: ['.js', '.json', '.ts'], - }, - node: { - fs: 'empty', - }, - }, - /* eslint-enable */ - (err, stats) => { - if (err || stats.hasErrors()) { - reject(err || stats.toString()); - return; - } - resolve(stats); - }, - ); - }); -} - -module.exports = browserBuild; diff --git a/scripts/build.js b/scripts/build.js index 7c5e0f5c3ba7..d6d718cbe322 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -30,11 +30,9 @@ const chalk = require('chalk'); const micromatch = require('micromatch'); const prettier = require('prettier'); const {getPackages, adjustToTerminalWidth, OK} = require('./buildUtils'); -const browserBuild = require('./browserBuild'); const SRC_DIR = 'src'; const BUILD_DIR = 'build'; -const BUILD_ES5_DIR = 'build-es5'; const JS_FILES_PATTERN = '**/*.js'; const TS_FILES_PATTERN = '**/*.ts'; const IGNORE_PATTERN = '**/__{tests,mocks}__/**'; @@ -72,39 +70,6 @@ function buildNodePackage(p) { process.stdout.write(`${OK}\n`); } -function buildBrowserPackage(p) { - const srcDir = path.resolve(p, SRC_DIR); - const pkgJsonPath = path.resolve(p, 'package.json'); - - if (!fs.existsSync(pkgJsonPath)) { - return; - } - - const browser = require(pkgJsonPath).browser; - if (browser) { - if (browser.indexOf(BUILD_ES5_DIR) !== 0) { - throw new Error( - `browser field for ${pkgJsonPath} should start with "${BUILD_ES5_DIR}"`, - ); - } - let indexFile = path.resolve(srcDir, 'index.js'); - - if (!fs.existsSync(indexFile)) { - indexFile = indexFile.replace(/\.js$/, '.ts'); - } - - browserBuild(p.split('/').pop(), indexFile, path.resolve(p, browser)) - .then(() => { - process.stdout.write(adjustToTerminalWidth(`${path.basename(p)}\n`)); - process.stdout.write(`${OK}\n`); - }) - .catch(e => { - console.error(e); - process.exit(1); - }); - } -} - function buildFile(file, silent) { const destPath = getBuildPath(file, BUILD_DIR); @@ -187,8 +152,4 @@ if (files.length) { const packages = getPackages(); process.stdout.write(chalk.inverse(' Building packages \n')); packages.forEach(buildNodePackage); - process.stdout.write('\n'); - - process.stdout.write(chalk.inverse(' Building browser packages \n')); - packages.forEach(buildBrowserPackage); } diff --git a/scripts/buildTs.js b/scripts/buildTs.js index 9f8ed9c3c7cb..d7112f964800 100644 --- a/scripts/buildTs.js +++ b/scripts/buildTs.js @@ -16,7 +16,6 @@ const util = require('util'); const chalk = require('chalk'); const execa = require('execa'); const globby = require('globby'); -const rimraf = require('rimraf'); const throat = require('throat'); const {getPackages} = require('./buildUtils'); @@ -32,10 +31,6 @@ packagesWithTs.forEach(pkgDir => { const pkg = require(pkgDir + '/package.json'); assert.ok(pkg.types, `Package ${pkg.name} is missing \`types\` field`); - assert.ok( - pkg.typesVersions, - `Package ${pkg.name} is missing \`typesVersions\` field`, - ); assert.equal( pkg.types, @@ -111,34 +106,10 @@ Promise.all( } }), ), -) - .then(() => { - const downlevelArgs = ['--silent', 'downlevel-dts', 'build', 'build/ts3.4']; - - console.log(chalk.inverse(' Downleveling TypeScript definition files ')); - - return Promise.all( - packagesWithTs.map( - throat(cpus, pkgDir => { - // otherwise we get nested `ts3.4` directories - rimraf.sync(path.resolve(pkgDir, 'build/ts3.4')); - - return execa('yarn', downlevelArgs, {cwd: pkgDir, stdio: 'inherit'}); - }), - ), - ); - }) - .then(() => { - console.log( - chalk.inverse.green( - ' Successfully downleveled TypeScript definition files ', - ), - ); - }) - .catch(e => { - console.error( - chalk.inverse.red(' Unable to downlevel TypeScript definition files '), - ); - console.error(e.stack); - process.exitCode = 1; - }); +).catch(e => { + console.error( + chalk.inverse.red(' Unable to validate TypeScript definition files '), + ); + console.error(e.stack); + process.exitCode = 1; +}); diff --git a/scripts/verifyOldTs.js b/scripts/verifyOldTs.js index e1d864cd77ca..cfa8b8c3ddd8 100644 --- a/scripts/verifyOldTs.js +++ b/scripts/verifyOldTs.js @@ -30,9 +30,14 @@ const tsConfig = { }; const cwd = tempy.directory(); +const tsVersion = '3.8'; + try { execa.sync('yarn', ['init', '--yes'], {cwd, stdio: 'inherit'}); - execa.sync('yarn', ['add', 'typescript@~3.4'], {cwd, stdio: 'inherit'}); + execa.sync('yarn', ['add', `typescript@~${tsVersion}`], { + cwd, + stdio: 'inherit', + }); fs.writeFileSync( path.join(cwd, 'tsconfig.json'), JSON.stringify(tsConfig, null, 2), @@ -44,7 +49,9 @@ try { execa.sync('yarn', ['tsc', '--project', '.'], {cwd, stdio: 'inherit'}); console.log( - chalk.inverse.green(' Successfully compiled Jest with TypeScript 3.4 '), + chalk.inverse.green( + ` Successfully compiled Jest with TypeScript ${tsVersion} `, + ), ); } finally { rimraf.sync(cwd); diff --git a/tsconfig.json b/tsconfig.json index 2301b5e98b8b..d5e967ef95d0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,12 +2,12 @@ "compilerOptions": { "target": "es2017", "module": "commonjs", - "lib": ["dom", "es2017"], + // Object.fromEntries + "lib": ["dom", "es2017", "es2019.object"], "declaration": true, "composite": true, "emitDeclarationOnly": true, - // blocked by https://github.com/chalk/chalk/pull/390 - // "isolatedModules": true, + "isolatedModules": true, "importsNotUsedAsValues": "error", "strict": true, @@ -28,7 +28,6 @@ ".yarn/releases/*", "**/__tests__/**/*", "**/__mocks__/**/*", - "**/build/**/*", - "**/build-es5/**/*" + "**/build/**/*" ] } diff --git a/website/blog/2016-03-11-javascript-unit-testing-performance.md b/website/blog/2016-03-11-javascript-unit-testing-performance.md index 4daeb517fd72..26872bc3e5d7 100644 --- a/website/blog/2016-03-11-javascript-unit-testing-performance.md +++ b/website/blog/2016-03-11-javascript-unit-testing-performance.md @@ -1,6 +1,6 @@ --- title: JavaScript Unit Testing Performance -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2016-04-12-jest-11.md b/website/blog/2016-04-12-jest-11.md index c2d2e7bc0652..298f4449a23d 100644 --- a/website/blog/2016-04-12-jest-11.md +++ b/website/blog/2016-04-12-jest-11.md @@ -1,6 +1,6 @@ --- title: Jest 11.0 -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2016-06-22-jest-13.md b/website/blog/2016-06-22-jest-13.md index e0ea31c97caf..593cb8d3a142 100644 --- a/website/blog/2016-06-22-jest-13.md +++ b/website/blog/2016-06-22-jest-13.md @@ -1,6 +1,6 @@ --- title: Jest 13.0: Flow & REPL -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2016-07-27-jest-14.md b/website/blog/2016-07-27-jest-14.md index 2700c14e6b4e..228f0ad9e77a 100644 --- a/website/blog/2016-07-27-jest-14.md +++ b/website/blog/2016-07-27-jest-14.md @@ -1,6 +1,6 @@ --- title: Jest 14.0: React Tree Snapshot Testing -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2016-09-01-jest-15.md b/website/blog/2016-09-01-jest-15.md index c64ed4da6b9f..a24b7e93db21 100644 --- a/website/blog/2016-09-01-jest-15.md +++ b/website/blog/2016-09-01-jest-15.md @@ -1,6 +1,6 @@ --- title: Jest 15.0: New Defaults for Jest -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2016-10-03-jest-16.md b/website/blog/2016-10-03-jest-16.md index aeb81980879e..56c18685ea9c 100644 --- a/website/blog/2016-10-03-jest-16.md +++ b/website/blog/2016-10-03-jest-16.md @@ -1,6 +1,6 @@ --- title: Jest 16.0: Turbocharged CLI & Community Update -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2016-12-15-2016-in-jest.md b/website/blog/2016-12-15-2016-in-jest.md index 619e2ada75d8..d765b9916405 100644 --- a/website/blog/2016-12-15-2016-in-jest.md +++ b/website/blog/2016-12-15-2016-in-jest.md @@ -1,6 +1,6 @@ --- title: 2016 in Jest -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2017-05-06-jest-20-delightful-testing-multi-project-runner.md b/website/blog/2017-05-06-jest-20-delightful-testing-multi-project-runner.md index b518e4363c9d..515cd405871f 100644 --- a/website/blog/2017-05-06-jest-20-delightful-testing-multi-project-runner.md +++ b/website/blog/2017-05-06-jest-20-delightful-testing-multi-project-runner.md @@ -1,6 +1,6 @@ --- title: Jest 20: 💖 Delightful Testing & 🏃🏽 Multi-Project-Runner -author: Christoph Pojer +author: Christoph Nakazawa authorURL: http://twitter.com/cpojer authorFBID: 100000023028168 --- diff --git a/website/blog/2020-05-05-jest-26.md b/website/blog/2020-05-05-jest-26.md new file mode 100644 index 000000000000..7a4b7e268d0a --- /dev/null +++ b/website/blog/2020-05-05-jest-26.md @@ -0,0 +1,91 @@ +--- +title: Jest 26: Tick Tock +author: Christoph Nakazawa +authorURL: http://twitter.com/cpojer +authorFBID: 100000023028168 +--- + +When we started rebuilding Jest five years ago our goal was to provide a batteries-included zero-configuration test runner that is approachable for beginners, extensible for almost all testing use cases and scalable to large projects. One of the instrumental releases was [Jest 15](https://jestjs.io/blog/2016/09/01/jest-15) which tied everything together and provided good defaults that allowed people to run Jest often without any setup. However, this approach has a big downside as Jest installs a lot of dependencies into your projects that you may not need. + +We are now beginning to address this shortcoming and are working on reducing Jest’s install size while keeping it approachable and extensible. We have made the following **breaking changes** in Jest 26: + + + +- `[expect, jest-mock, pretty-format]` Remove `ES5` build files with a new minimum of support of ES2015 (Node 8) which were only used for browser builds ([#9945](https://github.com/facebook/jest/pull/9945)) + + > **Migration**: With this change, we are pushing the responsibility to bundle the affected packages to the users, rather than Jest providing them out of the box, since they know their target environments best. If you want it back, we're open to shipping these as separate packages. PRs welcome! + +- `[jest-config, jest-resolve]` Remove support for `browser` field ([#9943](https://github.com/facebook/jest/pull/9943)) + + > **Migration**: Install `browser-resolve` module and use the following configuration: + + ```json + { + "jest": { + "resolver": "browser-resolve" + } + } + ``` + +- TypeScript definitions requires a minimum of TypeScript v3.8 ([#9823](https://github.com/facebook/jest/pull/9823)) + +With the above changes Jest 26 is now 4 MiB smaller than Jest 25.5.4 (53 → 49 MiB). Please keep in mind that many dependencies like Babel are likely already part of your project. Jest's own size was reduced by 1.2 MiB (4.3 -> 3.1 MiB). + +While this is a good start, it isn’t enough to make Jest meaningfully leaner. We are planning on gradually reducing Jest's and its dependency tree size by up to 70%. Most of the changes to reduce Jest’s default setup will be small breaking changes and we want to bring the community with us as much as possible. Therefore we will make the following changes in Jest 27 and Jest 28 using a [“Tick-Tock" release process](https://en.wikipedia.org/wiki/Tick%E2%80%93tock_model): + +- Jest 27 will ship with a new test runner "`jest-circus`" and the Node.js environment by default. `jest-jasmine2` and `jest-environment-jsdom` will still be bundled so users can keep using them by changing one-line each in the configuration. +- Jest 28 will remove `jest-jasmine2` and `jest-environment-jsdom` from the default distribution of Jest. The packages will still be actively maintained as part of the Jest project and be published separately. Users will need to install these packages to use them. + +Upon upgrading to these major releases, Jest will guide you through the necessary changes. If you’d like to get ahead and migrate to the new defaults now, and your project does not require a DOM environment, you can upgrade to Jest 26 and add the following configuration options: + +```json +{ + "jest": { + "testEnvironment": "node", + "testRunner": "jest-circus/runner" + } +} +``` + +Jest will continue to ship with `babel-jest` enabled by default. It currently powers a few Jest features beyond compiling modern JavaScript syntax to something understood by current versions of Node.js and browsers: It also powers Jest's code coverage and mocking of ES modules. Jest currently ships with experimental support for [V8 coverage](/blog/2020/01/21/jest-25#v8-code-coverage) and native support for ES Modules (more on that below!). It is not possible to mock static ES Modules per the specification without transforming the code first, so we will be encouraging patterns that work without the transformation we use Babel for today. Once V8 coverage and native ESM support stabilizes in Jest, we will also be able remove `babel-jest` as a default but we will keep maintaining it. + +## New fake timers + +With Jest 26 we are shipping a new implementation of fake timers based on `@sinonjs/fake-timers`. We've wanted to do this for years and are happy this has finally progressed far enough to support all of Jest's existing fake timer use cases. + +The new implementation comes with extra features such as mocking `Date`, `queueMicrotask` and more, see [this README](https://github.com/sinonjs/fake-timers/blob/master/README.md). It works transparently using the existing timer APIs like `jest.runAllTimers()` – check out the documentation [on our website](/docs/en/timer-mocks). + +We are confident this implementation is ready for prime time, however we don't want to force people to rewrite their tests if they depend on subtle differences between the old and new implementation. In Jest 26, this new implementation will remain _opt-in_ and can be activated by calling `jest.useFakeTimers('modern')` or by passing `modern` to the `timers` option in your config if you opted all tests into fake timers previously. + +In Jest 27 we will swap the default to the new "modern" implementation but we will keep supporting and maintaining the legacy implementation which can be used by calling `jest.useFakeTimers('legacy')`. If you are unsure whether you'll be able to upgrade all your tests by the time Jest 27 rolls out, you can add this to your tests now to keep the old behavior. + +We'd like to thank [Carl-Erik Kopseng](https://github.com/fatso83), [Benjamin Gruenbaum](https://github.com/benjamingr) and other maintainers of `@sinonjs/fake-timers` for their help and patience when working with us to make this happen! _Exciting_. + +## A new way to consume Jest - `@jest/globals` + +Jest has relied on globals popularized by the Jasmine testing framework and others such as `describe`, `it`, `test` and `expect`. While this is a widely used pattern, many people have expressed their preference for importing testing related functions instead. To support this use case, we added a new package `@jest/globals` that can be used to import testing functions: `import {expect, jest, test} from '@jest/globals';`. + +Caveats: + +- Currently the globals still exist in the environment but we will introduce a mode to disable globals in the future. Similarly, you cannot use `const jest = require('@jest/globals')` as you'll get declaration errors because the `jest` variable is still a global for now. +- There is currently no way to add custom matchers to the TypeScript definitions when using globals like this. +- While this allows running tests without globals, it does not allow running tests without Jest's test runner at this time. + +## Native ESM support + +As mentioned in the [Jest 25 blog post](/blog/2020/01/21/jest-25#ecmascript-modules-support) we have been working on native support for ECMAScript Modules. It is not stable yet but it is ready to be tested. We'd love to hear your feedback and bug reports! For an overview of the current state you can check out [this issue](https://github.com/facebook/jest/issues/9430), or browse all issues with that label [ES Modules](https://github.com/facebook/jest/labels/ES%20Modules). + +## Other Breaking Changes in Jest 26 + +- Dropped support for Node 8 ([#9423](https://github.com/facebook/jest/pull/9423)) +- `[jest-environment-jsdom]` Upgrade `jsdom` to v16 ([#9606](https://github.com/facebook/jest/pull/9606)) +- `[jest-runtime]` Remove long-deprecated `require.requireActual` and `require.requireMock` methods ([#9854](https://github.com/facebook/jest/pull/9854)) +- `[jest-haste-map]` Removed `providesModuleNodeModules` ([#8535](https://github.com/facebook/jest/pull/8535)) +- `[jest-circus]` Fail tests if a test takes a done callback and have return values ([#9129](https://github.com/facebook/jest/pull/9129)) +- `[jest-circus]` Throw a proper error if a test / hooks is defined asynchronously ([#8096](https://github.com/facebook/jest/pull/8096)) + +## Stay Safe + +We are all currently experiencing an unprecedented time of uncertainty. If you are struggling financially, we would like to use [Jest’s Open Collective fund](https://opencollective.com/jest) to help new and existing contributors. We place [bounties on some issues](https://github.com/facebook/jest/issues?q=is%3Aissue+is%3Aopen+bounty+label%3A%22Has+Bounty%22) and are open to offering a bounty on any of our current open issues - you can mention that an issue should have a bounty in the issue or contact [@cpojer via private message on Twitter](https://twitter.com/cpojer). + +Please stay safe. diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 22a46f95a144..cbb880a7e3b9 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -45,6 +45,7 @@ const Sponsor = ({ className="sponsor-item" title={`$${totalDonations.value} by ${name || slug}`} target="_blank" + rel="nofollow noopener" href={website || `https://opencollective.com/${slug}`} > { @@ -399,7 +400,7 @@ class Index extends React.Component { { content: ( - Jest uses a custom resolver for imports in your tests + Jest uses a custom resolver for imports in your tests, making it simple to mock any object outside of your test’s scope. You can use mocked imports with the rich [Mock Functions](https://jestjs.io/docs/en/mock-functions.html) diff --git a/website/versioned_docs/version-22.x/Configuration.md b/website/versioned_docs/version-22.x/Configuration.md index f1be8eb98924..041f4ac17f77 100644 --- a/website/versioned_docs/version-22.x/Configuration.md +++ b/website/versioned_docs/version-22.x/Configuration.md @@ -835,7 +835,7 @@ Setting this value to `fake` allows the use of fake timers for functions such as ### `transform` [object\] -Default: `undefined` +Default: `{"^.+\\.[jt]sx?$": "babel-jest"}` A map from regular expressions to paths to transformers. A transformer is a module that provides a synchronous function for transforming source files. For example, if you wanted to be able to use a new language feature in your modules or tests that isn't yet supported by node, you might plug in one of many compilers that compile a future version of JavaScript to a current one. Example: see the [examples/typescript](https://github.com/facebook/jest/blob/master/examples/typescript/package.json#L16) example or the [webpack tutorial](Webpack.md). @@ -848,7 +848,7 @@ Examples of such compilers include: _Note: a transformer is only run once per file unless the file has changed. During development of a transformer it can be useful to run Jest with `--no-cache` to frequently [delete Jest's cache](Troubleshooting.md#caching-issues)._ -_Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ +_Note: when adding additional code transformers, this will overwrite the default config and `babel-jest` is no longer automatically loaded. If you want to use it to compile JavaScript or Typescript, it has to be explicitly defined by adding `{"^.+\\.[jt]sx?$": "babel-jest"}` to the transform property. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ ### `transformIgnorePatterns` [array\] diff --git a/website/versioned_docs/version-22.x/TutorialReactNative.md b/website/versioned_docs/version-22.x/TutorialReactNative.md index 83c6ebbd34ea..df5dd5253034 100644 --- a/website/versioned_docs/version-22.x/TutorialReactNative.md +++ b/website/versioned_docs/version-22.x/TutorialReactNative.md @@ -201,22 +201,3 @@ jest.mock('Text', () => { In other cases you may want to mock a native module that isn't a React component. The same technique can be applied. We recommend inspecting the native module's source code and logging the module when running a react native app on a real device and then modeling a manual mock after the real module. If you end up mocking the same modules over and over it is recommended to define these mocks in a separate file and add it to the list of `setupFiles`. - -### `@providesModule` - -If you'd like to use Facebook's `@providesModule` module system through an npm package, the default haste config option must be overwritten and npm modules must be added to `providesModuleNodeModules`: - -```json -"haste": { - "defaultPlatform": "ios", - "platforms": ["android", "ios"], - "providesModuleNodeModules": [ - "react", - "react-native", - "my-awesome-module", - "my-text-component" - ] -}, -``` - -If you'd like to test a different default platform or if you are building for other platforms, the `defaultPlatform` and `platforms` configuration option can be updated. diff --git a/website/versioned_docs/version-23.x/Configuration.md b/website/versioned_docs/version-23.x/Configuration.md index 178809f2b84b..9f139dbe56a1 100644 --- a/website/versioned_docs/version-23.x/Configuration.md +++ b/website/versioned_docs/version-23.x/Configuration.md @@ -904,7 +904,7 @@ Setting this value to `fake` allows the use of fake timers for functions such as ### `transform` [object\] -Default: `undefined` +Default: `{"^.+\\.[jt]sx?$": "babel-jest"}` A map from regular expressions to paths to transformers. A transformer is a module that provides a synchronous function for transforming source files. For example, if you wanted to be able to use a new language feature in your modules or tests that isn't yet supported by node, you might plug in one of many compilers that compile a future version of JavaScript to a current one. Example: see the [examples/typescript](https://github.com/facebook/jest/blob/master/examples/typescript/package.json#L16) example or the [webpack tutorial](Webpack.md). @@ -917,7 +917,7 @@ Examples of such compilers include: _Note: a transformer is only run once per file unless the file has changed. During development of a transformer it can be useful to run Jest with `--no-cache` to frequently [delete Jest's cache](Troubleshooting.md#caching-issues)._ -_Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ +_Note: when adding additional code transformers, this will overwrite the default config and `babel-jest` is no longer automatically loaded. If you want to use it to compile JavaScript or Typescript, it has to be explicitly defined by adding `{"^.+\\.[jt]sx?$": "babel-jest"}` to the transform property. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ ### `transformIgnorePatterns` [array\] diff --git a/website/versioned_docs/version-24.x/Configuration.md b/website/versioned_docs/version-24.x/Configuration.md index ffc940ea66bb..eeb92a5d36aa 100644 --- a/website/versioned_docs/version-24.x/Configuration.md +++ b/website/versioned_docs/version-24.x/Configuration.md @@ -1064,6 +1064,7 @@ Example: Sort test path alphabetically. ```js +// testSequencer.js const Sequencer = require('@jest/test-sequencer').default; class CustomSequencer extends Sequencer { @@ -1078,6 +1079,14 @@ class CustomSequencer extends Sequencer { module.exports = CustomSequencer; ``` +Use it in your Jest config file like this: + +```json +{ + "testSequencer": "path/to/testSequencer.js" +} +``` + ### `testURL` [string] Default: `http://localhost` @@ -1092,7 +1101,7 @@ Setting this value to `fake` allows the use of fake timers for functions such as ### `transform` [object\] -Default: `undefined` +Default: `{"^.+\\.[jt]sx?$": "babel-jest"}` A map from regular expressions to paths to transformers. A transformer is a module that provides a synchronous function for transforming source files. For example, if you wanted to be able to use a new language feature in your modules or tests that isn't yet supported by node, you might plug in one of many compilers that compile a future version of JavaScript to a current one. Example: see the [examples/typescript](https://github.com/facebook/jest/blob/master/examples/typescript/package.json#L16) example or the [webpack tutorial](Webpack.md). @@ -1107,7 +1116,7 @@ You can pass configuration to a transformer like `{filePattern: ['path-to-transf _Note: a transformer is only run once per file unless the file has changed. During development of a transformer it can be useful to run Jest with `--no-cache` to frequently [delete Jest's cache](Troubleshooting.md#caching-issues)._ -_Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ +_Note: when adding additional code transformers, this will overwrite the default config and `babel-jest` is no longer automatically loaded. If you want to use it to compile JavaScript or Typescript, it has to be explicitly defined by adding `{"^.+\\.[jt]sx?$": "babel-jest"}` to the transform property. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ ### `transformIgnorePatterns` [array\] diff --git a/website/versioned_docs/version-25.1/TutorialReact.md b/website/versioned_docs/version-25.1/TutorialReact.md deleted file mode 100644 index 6caa36a09575..000000000000 --- a/website/versioned_docs/version-25.1/TutorialReact.md +++ /dev/null @@ -1,341 +0,0 @@ ---- -id: version-25.1-tutorial-react -title: Testing React Apps -original_id: tutorial-react ---- - -At Facebook, we use Jest to test [React](http://facebook.github.io/react/) applications. - -## Setup - -### Setup with Create React App - -If you are new to React, we recommend using [Create React App](https://github.com/facebookincubator/create-react-app). It is ready to use and [ships with Jest](https://facebook.github.io/create-react-app/docs/running-tests#docsNav)! You will only need to add `react-test-renderer` for rendering snapshots. - -Run - -```bash -yarn add --dev react-test-renderer -``` - -### Setup without Create React App - -If you have an existing application you'll need to install a few packages to make everything work well together. We are using the `babel-jest` package and the `react` babel preset to transform our code inside of the test environment. Also see [using babel](GettingStarted.md#using-babel). - -Run - -```bash -yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react react-test-renderer -``` - -Your `package.json` should look something like this (where `` is the actual latest version number for the package). Please add the scripts and jest configuration entries: - -```json -// package.json - "dependencies": { - "react": "", - "react-dom": "" - }, - "devDependencies": { - "@babel/preset-env": "", - "@babel/preset-react": "", - "babel-jest": "", - "jest": "", - "react-test-renderer": "" - }, - "scripts": { - "test": "jest" - } -``` - -```js -// babel.config.js -module.exports = { - presets: ['@babel/preset-env', '@babel/preset-react'], -}; -``` - -**And you're good to go!** - -### Snapshot Testing - -Let's create a [snapshot test](SnapshotTesting.md) for a Link component that renders hyperlinks: - -```javascript -// Link.react.js -import React from 'react'; - -const STATUS = { - HOVERED: 'hovered', - NORMAL: 'normal', -}; - -export default class Link extends React.Component { - constructor(props) { - super(props); - - this._onMouseEnter = this._onMouseEnter.bind(this); - this._onMouseLeave = this._onMouseLeave.bind(this); - - this.state = { - class: STATUS.NORMAL, - }; - } - - _onMouseEnter() { - this.setState({class: STATUS.HOVERED}); - } - - _onMouseLeave() { - this.setState({class: STATUS.NORMAL}); - } - - render() { - return ( - - {this.props.children} - - ); - } -} -``` - -Now let's use React's test renderer and Jest's snapshot feature to interact with the component and capture the rendered output and create a snapshot file: - -```javascript -// Link.react.test.js -import React from 'react'; -import Link from '../Link.react'; -import renderer from 'react-test-renderer'; - -test('Link changes the class when hovered', () => { - const component = renderer.create( - Facebook, - ); - let tree = component.toJSON(); - expect(tree).toMatchSnapshot(); - - // manually trigger the callback - tree.props.onMouseEnter(); - // re-rendering - tree = component.toJSON(); - expect(tree).toMatchSnapshot(); - - // manually trigger the callback - tree.props.onMouseLeave(); - // re-rendering - tree = component.toJSON(); - expect(tree).toMatchSnapshot(); -}); -``` - -When you run `yarn test` or `jest`, this will produce an output file like this: - -```javascript -// __tests__/__snapshots__/Link.react.test.js.snap -exports[`Link changes the class when hovered 1`] = ` - - Facebook - -`; - -exports[`Link changes the class when hovered 2`] = ` - - Facebook - -`; - -exports[`Link changes the class when hovered 3`] = ` - - Facebook - -`; -``` - -The next time you run the tests, the rendered output will be compared to the previously created snapshot. The snapshot should be committed along code changes. When a snapshot test fails, you need to inspect whether it is an intended or unintended change. If the change is expected you can invoke Jest with `jest -u` to overwrite the existing snapshot. - -The code for this example is available at [examples/snapshot](https://github.com/facebook/jest/tree/master/examples/snapshot). - -#### Snapshot Testing with Mocks, Enzyme and React 16 - -There's a caveat around snapshot testing when using Enzyme and React 16+. If you mock out a module using the following style: - -```js -jest.mock('../SomeDirectory/SomeComponent', () => 'SomeComponent'); -``` - -Then you will see warnings in the console: - -```bash -Warning: is using uppercase HTML. Always use lowercase HTML tags in React. - -# Or: -Warning: The tag is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter. -``` - -React 16 triggers these warnings due to how it checks element types, and the mocked module fails these checks. Your options are: - -1. Render as text. This way you won't see the props passed to the mock component in the snapshot, but it's straightforward: - ```js - jest.mock('./SomeComponent', () => () => 'SomeComponent'); - ``` -2. Render as a custom element. DOM "custom elements" aren't checked for anything and shouldn't fire warnings. They are lowercase and have a dash in the name. - ```js - jest.mock('./Widget', () => () => ); - ``` -3. Use `react-test-renderer`. The test renderer doesn't care about element types and will happily accept e.g. `SomeComponent`. You could check snapshots using the test renderer, and check component behavior separately using Enzyme. -4. Disable warnings all together (should be done in your jest setup file): - ```js - jest.mock('fbjs/lib/warning', () => require('fbjs/lib/emptyFunction')); - ``` - This shouldn't normally be your option of choice as useful warnings could be lost. However, in some cases, for example when testing react-native's components we are rendering react-native tags into the DOM and many warnings are irrelevant. Another option is to swizzle the console.warn and suppress specific warnings. - -### DOM Testing - -If you'd like to assert, and manipulate your rendered components you can use [react-testing-library](https://github.com/kentcdodds/react-testing-library), [Enzyme](http://airbnb.io/enzyme/), or React's [TestUtils](http://facebook.github.io/react/docs/test-utils.html). The following two examples use react-testing-library and Enzyme. - -#### react-testing-library - -You have to run `yarn add --dev @testing-library/react` to use react-testing-library. - -Let's implement a checkbox which swaps between two labels: - -```javascript -// CheckboxWithLabel.js - -import React from 'react'; - -export default class CheckboxWithLabel extends React.Component { - constructor(props) { - super(props); - this.state = {isChecked: false}; - - // bind manually because React class components don't auto-bind - // http://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding - this.onChange = this.onChange.bind(this); - } - - onChange() { - this.setState({isChecked: !this.state.isChecked}); - } - - render() { - return ( - - ); - } -} -``` - -```javascript -// __tests__/CheckboxWithLabel-test.js -import React from 'react'; -import {cleanup, fireEvent, render} from '@testing-library/react'; -import CheckboxWithLabel from '../CheckboxWithLabel'; - -// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher -// unmount and cleanup DOM after the test is finished. -afterEach(cleanup); - -it('CheckboxWithLabel changes the text after click', () => { - const {queryByLabelText, getByLabelText} = render( - , - ); - - expect(queryByLabelText(/off/i)).toBeTruthy(); - - fireEvent.click(getByLabelText(/off/i)); - - expect(queryByLabelText(/on/i)).toBeTruthy(); -}); -``` - -The code for this example is available at [examples/react-testing-library](https://github.com/facebook/jest/tree/master/examples/react-testing-library). - -#### Enzyme - -You have to run `yarn add --dev enzyme` to use Enzyme. If you are using a React version below 15.5.0, you will also need to install `react-addons-test-utils`. - -Let's rewrite the test from above using Enzyme instead of react-testing-library. We use Enzyme's [shallow renderer](http://airbnb.io/enzyme/docs/api/shallow.html) in this example. - -```javascript -// __tests__/CheckboxWithLabel-test.js - -import React from 'react'; -import {shallow} from 'enzyme'; -import CheckboxWithLabel from '../CheckboxWithLabel'; - -test('CheckboxWithLabel changes the text after click', () => { - // Render a checkbox with label in the document - const checkbox = shallow(); - - expect(checkbox.text()).toEqual('Off'); - - checkbox.find('input').simulate('change'); - - expect(checkbox.text()).toEqual('On'); -}); -``` - -The code for this example is available at [examples/enzyme](https://github.com/facebook/jest/tree/master/examples/enzyme). - -### Custom transformers - -If you need more advanced functionality, you can also build your own transformer. Instead of using babel-jest, here is an example of using babel: - -```javascript -// custom-transformer.js -'use strict'; - -const {transform} = require('@babel/core'); -const jestPreset = require('babel-preset-jest'); - -module.exports = { - process(src, filename) { - const result = transform(src, { - filename, - presets: [jestPreset], - }); - - return result ? result.code : src; - }, -}; -``` - -Don't forget to install the `@babel/core` and `babel-preset-jest` packages for this example to work. - -To make this work with Jest you need to update your Jest configuration with this: `"transform": {"\\.js$": "path/to/custom-transformer.js"}`. - -If you'd like to build a transformer with babel support, you can also use babel-jest to compose one and pass in your custom configuration options: - -```javascript -const babelJest = require('babel-jest'); - -module.exports = babelJest.createTransformer({ - presets: ['my-custom-preset'], -}); -``` diff --git a/website/versioned_docs/version-25.3/CLI.md b/website/versioned_docs/version-25.x/CLI.md similarity index 99% rename from website/versioned_docs/version-25.3/CLI.md rename to website/versioned_docs/version-25.x/CLI.md index a28fafb6d30f..3194db9e7236 100644 --- a/website/versioned_docs/version-25.3/CLI.md +++ b/website/versioned_docs/version-25.x/CLI.md @@ -1,5 +1,5 @@ --- -id: version-25.3-cli +id: version-25.x-cli title: Jest CLI Options original_id: cli --- diff --git a/website/versioned_docs/version-25.3/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md similarity index 98% rename from website/versioned_docs/version-25.3/Configuration.md rename to website/versioned_docs/version-25.x/Configuration.md index aebb2597a7c8..f1282e6fa45f 100644 --- a/website/versioned_docs/version-25.3/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -1,5 +1,5 @@ --- -id: version-25.3-configuration +id: version-25.x-configuration title: Configuring Jest original_id: configuration --- @@ -880,7 +880,7 @@ Pretty foo: Object { To make a dependency explicit instead of implicit, you can call [`expect.addSnapshotSerializer`](ExpectAPI.md#expectaddsnapshotserializerserializer) to add a module for an individual test file instead of adding its path to `snapshotSerializers` in Jest configuration. -More about serializers API can be found [here](https://github.com/facebook/jest/tree/master/packages/pretty-format#serialize). +More about serializers API can be found [here](https://github.com/facebook/jest/tree/master/packages/pretty-format/README.md#serialize). ### `testEnvironment` [string] @@ -1086,6 +1086,7 @@ Example: Sort test path alphabetically. ```js +// testSequencer.js const Sequencer = require('@jest/test-sequencer').default; class CustomSequencer extends Sequencer { @@ -1100,6 +1101,14 @@ class CustomSequencer extends Sequencer { module.exports = CustomSequencer; ``` +Use it in your Jest config file like this: + +```json +{ + "testSequencer": "path/to/testSequencer.js" +} +``` + ### `testTimeout` [number] Default: `5000` @@ -1120,7 +1129,7 @@ Setting this value to `fake` allows the use of fake timers for functions such as ### `transform` [object\] -Default: `undefined` +Default: `{"^.+\\.[jt]sx?$": "babel-jest"}` A map from regular expressions to paths to transformers. A transformer is a module that provides a synchronous function for transforming source files. For example, if you wanted to be able to use a new language feature in your modules or tests that isn't yet supported by node, you might plug in one of many compilers that compile a future version of JavaScript to a current one. Example: see the [examples/typescript](https://github.com/facebook/jest/blob/master/examples/typescript/package.json#L16) example or the [webpack tutorial](Webpack.md). @@ -1135,7 +1144,7 @@ You can pass configuration to a transformer like `{filePattern: ['path-to-transf _Note: a transformer is only run once per file unless the file has changed. During development of a transformer it can be useful to run Jest with `--no-cache` to frequently [delete Jest's cache](Troubleshooting.md#caching-issues)._ -_Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ +_Note: when adding additional code transformers, this will overwrite the default config and `babel-jest` is no longer automatically loaded. If you want to use it to compile JavaScript or Typescript, it has to be explicitly defined by adding `{"^.+\\.[jt]sx?$": "babel-jest"}` to the transform property. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ ### `transformIgnorePatterns` [array\] diff --git a/website/versioned_docs/version-25.x/Es6ClassMocks.md b/website/versioned_docs/version-25.x/Es6ClassMocks.md new file mode 100644 index 000000000000..a6bf0a09f9b2 --- /dev/null +++ b/website/versioned_docs/version-25.x/Es6ClassMocks.md @@ -0,0 +1,364 @@ +--- +id: version-25.x-es6-class-mocks +title: ES6 Class Mocks +original_id: es6-class-mocks +--- + +Jest can be used to mock ES6 classes that are imported into files you want to test. + +ES6 classes are constructor functions with some syntactic sugar. Therefore, any mock for an ES6 class must be a function or an actual ES6 class (which is, again, another function). So you can mock them using [mock functions](MockFunctions.md). + +## An ES6 Class Example + +We'll use a contrived example of a class that plays sound files, `SoundPlayer`, and a consumer class which uses that class, `SoundPlayerConsumer`. We'll mock `SoundPlayer` in our tests for `SoundPlayerConsumer`. + +```javascript +// sound-player.js +export default class SoundPlayer { + constructor() { + this.foo = 'bar'; + } + + playSoundFile(fileName) { + console.log('Playing sound file ' + fileName); + } +} +``` + +```javascript +// sound-player-consumer.js +import SoundPlayer from './sound-player'; + +export default class SoundPlayerConsumer { + constructor() { + this.soundPlayer = new SoundPlayer(); + } + + playSomethingCool() { + const coolSoundFileName = 'song.mp3'; + this.soundPlayer.playSoundFile(coolSoundFileName); + } +} +``` + +## The 4 ways to create an ES6 class mock + +### Automatic mock + +Calling `jest.mock('./sound-player')` returns a useful "automatic mock" you can use to spy on calls to the class constructor and all of its methods. It replaces the ES6 class with a mock constructor, and replaces all of its methods with [mock functions](MockFunctions.md) that always return `undefined`. Method calls are saved in `theAutomaticMock.mock.instances[index].methodName.mock.calls`. + +Please note that if you use arrow functions in your classes, they will _not_ be part of the mock. The reason for that is that arrow functions are not present on the object's prototype, they are merely properties holding a reference to a function. + +If you don't need to replace the implementation of the class, this is the easiest option to set up. For example: + +```javascript +import SoundPlayer from './sound-player'; +import SoundPlayerConsumer from './sound-player-consumer'; +jest.mock('./sound-player'); // SoundPlayer is now a mock constructor + +beforeEach(() => { + // Clear all instances and calls to constructor and all methods: + SoundPlayer.mockClear(); +}); + +it('We can check if the consumer called the class constructor', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + expect(SoundPlayer).toHaveBeenCalledTimes(1); +}); + +it('We can check if the consumer called a method on the class instance', () => { + // Show that mockClear() is working: + expect(SoundPlayer).not.toHaveBeenCalled(); + + const soundPlayerConsumer = new SoundPlayerConsumer(); + // Constructor should have been called again: + expect(SoundPlayer).toHaveBeenCalledTimes(1); + + const coolSoundFileName = 'song.mp3'; + soundPlayerConsumer.playSomethingCool(); + + // mock.instances is available with automatic mocks: + const mockSoundPlayerInstance = SoundPlayer.mock.instances[0]; + const mockPlaySoundFile = mockSoundPlayerInstance.playSoundFile; + expect(mockPlaySoundFile.mock.calls[0][0]).toEqual(coolSoundFileName); + // Equivalent to above check: + expect(mockPlaySoundFile).toHaveBeenCalledWith(coolSoundFileName); + expect(mockPlaySoundFile).toHaveBeenCalledTimes(1); +}); +``` + +### Manual mock + +Create a [manual mock](ManualMocks.md) by saving a mock implementation in the `__mocks__` folder. This allows you to specify the implementation, and it can be used across test files. + +```javascript +// __mocks__/sound-player.js + +// Import this named export into your test file: +export const mockPlaySoundFile = jest.fn(); +const mock = jest.fn().mockImplementation(() => { + return {playSoundFile: mockPlaySoundFile}; +}); + +export default mock; +``` + +Import the mock and the mock method shared by all instances: + +```javascript +// sound-player-consumer.test.js +import SoundPlayer, {mockPlaySoundFile} from './sound-player'; +import SoundPlayerConsumer from './sound-player-consumer'; +jest.mock('./sound-player'); // SoundPlayer is now a mock constructor + +beforeEach(() => { + // Clear all instances and calls to constructor and all methods: + SoundPlayer.mockClear(); + mockPlaySoundFile.mockClear(); +}); + +it('We can check if the consumer called the class constructor', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + expect(SoundPlayer).toHaveBeenCalledTimes(1); +}); + +it('We can check if the consumer called a method on the class instance', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + const coolSoundFileName = 'song.mp3'; + soundPlayerConsumer.playSomethingCool(); + expect(mockPlaySoundFile).toHaveBeenCalledWith(coolSoundFileName); +}); +``` + +### Calling [`jest.mock()`](JestObjectAPI.md#jestmockmodulename-factory-options) with the module factory parameter + +`jest.mock(path, moduleFactory)` takes a **module factory** argument. A module factory is a function that returns the mock. + +In order to mock a constructor function, the module factory must return a constructor function. In other words, the module factory must be a function that returns a function - a higher-order function (HOF). + +```javascript +import SoundPlayer from './sound-player'; +const mockPlaySoundFile = jest.fn(); +jest.mock('./sound-player', () => { + return jest.fn().mockImplementation(() => { + return {playSoundFile: mockPlaySoundFile}; + }); +}); +``` + +A limitation with the factory parameter is that, since calls to `jest.mock()` are hoisted to the top of the file, it's not possible to first define a variable and then use it in the factory. An exception is made for variables that start with the word 'mock'. It's up to you to guarantee that they will be initialized on time! For example, the following will throw an out-of-scope error due to the use of 'fake' instead of 'mock' in the variable declaration: + +```javascript +// Note: this will fail +import SoundPlayer from './sound-player'; +const fakePlaySoundFile = jest.fn(); +jest.mock('./sound-player', () => { + return jest.fn().mockImplementation(() => { + return {playSoundFile: fakePlaySoundFile}; + }); +}); +``` + +### Replacing the mock using [`mockImplementation()`](MockFunctionAPI.md#mockfnmockimplementationfn) or [`mockImplementationOnce()`](MockFunctionAPI.md#mockfnmockimplementationoncefn) + +You can replace all of the above mocks in order to change the implementation, for a single test or all tests, by calling `mockImplementation()` on the existing mock. + +Calls to jest.mock are hoisted to the top of the code. You can specify a mock later, e.g. in `beforeAll()`, by calling `mockImplementation()` (or `mockImplementationOnce()`) on the existing mock instead of using the factory parameter. This also allows you to change the mock between tests, if needed: + +```javascript +import SoundPlayer from './sound-player'; +import SoundPlayerConsumer from './sound-player-consumer'; + +jest.mock('./sound-player'); + +describe('When SoundPlayer throws an error', () => { + beforeAll(() => { + SoundPlayer.mockImplementation(() => { + return { + playSoundFile: () => { + throw new Error('Test error'); + }, + }; + }); + }); + + it('Should throw an error when calling playSomethingCool', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + expect(() => soundPlayerConsumer.playSomethingCool()).toThrow(); + }); +}); +``` + +## In depth: Understanding mock constructor functions + +Building your constructor function mock using `jest.fn().mockImplementation()` makes mocks appear more complicated than they really are. This section shows how you can create your own mocks to illustrate how mocking works. + +### Manual mock that is another ES6 class + +If you define an ES6 class using the same filename as the mocked class in the `__mocks__` folder, it will serve as the mock. This class will be used in place of the real class. This allows you to inject a test implementation for the class, but does not provide a way to spy on calls. + +For the contrived example, the mock might look like this: + +```javascript +// __mocks__/sound-player.js +export default class SoundPlayer { + constructor() { + console.log('Mock SoundPlayer: constructor was called'); + } + + playSoundFile() { + console.log('Mock SoundPlayer: playSoundFile was called'); + } +} +``` + +### Mock using module factory parameter + +The module factory function passed to `jest.mock(path, moduleFactory)` can be a HOF that returns a function\*. This will allow calling `new` on the mock. Again, this allows you to inject different behavior for testing, but does not provide a way to spy on calls. + +#### \* Module factory function must return a function + +In order to mock a constructor function, the module factory must return a constructor function. In other words, the module factory must be a function that returns a function - a higher-order function (HOF). + +```javascript +jest.mock('./sound-player', () => { + return function () { + return {playSoundFile: () => {}}; + }; +}); +``` + +**_Note: Arrow functions won't work_** + +Note that the mock can't be an arrow function because calling `new` on an arrow function is not allowed in JavaScript. So this won't work: + +```javascript +jest.mock('./sound-player', () => { + return () => { + // Does not work; arrow functions can't be called with new + return {playSoundFile: () => {}}; + }; +}); +``` + +This will throw **_TypeError: \_soundPlayer2.default is not a constructor_**, unless the code is transpiled to ES5, e.g. by `@babel/preset-env`. (ES5 doesn't have arrow functions nor classes, so both will be transpiled to plain functions.) + +## Keeping track of usage (spying on the mock) + +Injecting a test implementation is helpful, but you will probably also want to test whether the class constructor and methods are called with the correct parameters. + +### Spying on the constructor + +In order to track calls to the constructor, replace the function returned by the HOF with a Jest mock function. Create it with [`jest.fn()`](JestObjectAPI.md#jestfnimplementation), and then specify its implementation with `mockImplementation()`. + +```javascript +import SoundPlayer from './sound-player'; +jest.mock('./sound-player', () => { + // Works and lets you check for constructor calls: + return jest.fn().mockImplementation(() => { + return {playSoundFile: () => {}}; + }); +}); +``` + +This will let us inspect usage of our mocked class, using `SoundPlayer.mock.calls`: `expect(SoundPlayer).toHaveBeenCalled();` or near-equivalent: `expect(SoundPlayer.mock.calls.length).toEqual(1);` + +### Mocking non default class exports + +If the class is **not** the default export from the module then you need to return an object with the key that is the same as the class export name. + +```javascript +import {SoundPlayer} from './sound-player'; +jest.mock('./sound-player', () => { + // Works and lets you check for constructor calls: + return { + SoundPlayer: jest.fn().mockImplementation(() => { + return {playSoundFile: () => {}}; + }), + }; +}); +``` + +### Spying on methods of our class + +Our mocked class will need to provide any member functions (`playSoundFile` in the example) that will be called during our tests, or else we'll get an error for calling a function that doesn't exist. But we'll probably want to also spy on calls to those methods, to ensure that they were called with the expected parameters. + +A new object will be created each time the mock constructor function is called during tests. To spy on method calls in all of these objects, we populate `playSoundFile` with another mock function, and store a reference to that same mock function in our test file, so it's available during tests. + +```javascript +import SoundPlayer from './sound-player'; +const mockPlaySoundFile = jest.fn(); +jest.mock('./sound-player', () => { + return jest.fn().mockImplementation(() => { + return {playSoundFile: mockPlaySoundFile}; + // Now we can track calls to playSoundFile + }); +}); +``` + +The manual mock equivalent of this would be: + +```javascript +// __mocks__/sound-player.js + +// Import this named export into your test file +export const mockPlaySoundFile = jest.fn(); +const mock = jest.fn().mockImplementation(() => { + return {playSoundFile: mockPlaySoundFile}; +}); + +export default mock; +``` + +Usage is similar to the module factory function, except that you can omit the second argument from `jest.mock()`, and you must import the mocked method into your test file, since it is no longer defined there. Use the original module path for this; don't include `__mocks__`. + +### Cleaning up between tests + +To clear the record of calls to the mock constructor function and its methods, we call [`mockClear()`](MockFunctionAPI.md#mockfnmockclear) in the `beforeEach()` function: + +```javascript +beforeEach(() => { + SoundPlayer.mockClear(); + mockPlaySoundFile.mockClear(); +}); +``` + +## Complete example + +Here's a complete test file which uses the module factory parameter to `jest.mock`: + +```javascript +// sound-player-consumer.test.js +import SoundPlayerConsumer from './sound-player-consumer'; +import SoundPlayer from './sound-player'; + +const mockPlaySoundFile = jest.fn(); +jest.mock('./sound-player', () => { + return jest.fn().mockImplementation(() => { + return {playSoundFile: mockPlaySoundFile}; + }); +}); + +beforeEach(() => { + SoundPlayer.mockClear(); + mockPlaySoundFile.mockClear(); +}); + +it('The consumer should be able to call new() on SoundPlayer', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + // Ensure constructor created the object: + expect(soundPlayerConsumer).toBeTruthy(); +}); + +it('We can check if the consumer called the class constructor', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + expect(SoundPlayer).toHaveBeenCalledTimes(1); +}); + +it('We can check if the consumer called a method on the class instance', () => { + const soundPlayerConsumer = new SoundPlayerConsumer(); + const coolSoundFileName = 'song.mp3'; + soundPlayerConsumer.playSomethingCool(); + expect(mockPlaySoundFile.mock.calls[0][0]).toEqual(coolSoundFileName); +}); +``` diff --git a/website/versioned_docs/version-25.1/ExpectAPI.md b/website/versioned_docs/version-25.x/ExpectAPI.md similarity index 99% rename from website/versioned_docs/version-25.1/ExpectAPI.md rename to website/versioned_docs/version-25.x/ExpectAPI.md index 4c30f69ac38b..f3163da25bc0 100644 --- a/website/versioned_docs/version-25.1/ExpectAPI.md +++ b/website/versioned_docs/version-25.x/ExpectAPI.md @@ -1,5 +1,5 @@ --- -id: version-25.1-expect +id: version-25.x-expect title: Expect original_id: expect --- diff --git a/website/versioned_docs/version-25.x/GlobalAPI.md b/website/versioned_docs/version-25.x/GlobalAPI.md new file mode 100644 index 000000000000..a19799f80898 --- /dev/null +++ b/website/versioned_docs/version-25.x/GlobalAPI.md @@ -0,0 +1,676 @@ +--- +id: version-25.x-api +title: Globals +original_id: api +--- + +In your test files, Jest puts each of these methods and objects into the global environment. You don't have to require or import anything to use them. However, if you prefer explicit imports, you can do `import {describe, expect, it} from '@jest/globals'`. + +## Methods + + + +--- + +## Reference + +### `afterAll(fn, timeout)` + +Runs a function after all the tests in this file have completed. If the function returns a promise or is a generator, Jest waits for that promise to resolve before continuing. + +Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ + +This is often useful if you want to clean up some global setup state that is shared across tests. + +For example: + +```js +const globalDatabase = makeGlobalDatabase(); + +function cleanUpDatabase(db) { + db.cleanUp(); +} + +afterAll(() => { + cleanUpDatabase(globalDatabase); +}); + +test('can find things', () => { + return globalDatabase.find('thing', {}, results => { + expect(results.length).toBeGreaterThan(0); + }); +}); + +test('can insert a thing', () => { + return globalDatabase.insert('thing', makeThing(), response => { + expect(response.success).toBeTruthy(); + }); +}); +``` + +Here the `afterAll` ensures that `cleanUpDatabase` is called after all tests run. + +If `afterAll` is inside a `describe` block, it runs at the end of the describe block. + +If you want to run some cleanup after every test instead of after all tests, use `afterEach` instead. + +### `afterEach(fn, timeout)` + +Runs a function after each one of the tests in this file completes. If the function returns a promise or is a generator, Jest waits for that promise to resolve before continuing. + +Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ + +This is often useful if you want to clean up some temporary state that is created by each test. + +For example: + +```js +const globalDatabase = makeGlobalDatabase(); + +function cleanUpDatabase(db) { + db.cleanUp(); +} + +afterEach(() => { + cleanUpDatabase(globalDatabase); +}); + +test('can find things', () => { + return globalDatabase.find('thing', {}, results => { + expect(results.length).toBeGreaterThan(0); + }); +}); + +test('can insert a thing', () => { + return globalDatabase.insert('thing', makeThing(), response => { + expect(response.success).toBeTruthy(); + }); +}); +``` + +Here the `afterEach` ensures that `cleanUpDatabase` is called after each test runs. + +If `afterEach` is inside a `describe` block, it only runs after the tests that are inside this describe block. + +If you want to run some cleanup just once, after all of the tests run, use `afterAll` instead. + +### `beforeAll(fn, timeout)` + +Runs a function before any of the tests in this file run. If the function returns a promise or is a generator, Jest waits for that promise to resolve before running tests. + +Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ + +This is often useful if you want to set up some global state that will be used by many tests. + +For example: + +```js +const globalDatabase = makeGlobalDatabase(); + +beforeAll(() => { + // Clears the database and adds some testing data. + // Jest will wait for this promise to resolve before running tests. + return globalDatabase.clear().then(() => { + return globalDatabase.insert({testData: 'foo'}); + }); +}); + +// Since we only set up the database once in this example, it's important +// that our tests don't modify it. +test('can find things', () => { + return globalDatabase.find('thing', {}, results => { + expect(results.length).toBeGreaterThan(0); + }); +}); +``` + +Here the `beforeAll` ensures that the database is set up before tests run. If setup was synchronous, you could do this without `beforeAll`. The key is that Jest will wait for a promise to resolve, so you can have asynchronous setup as well. + +If `beforeAll` is inside a `describe` block, it runs at the beginning of the describe block. + +If you want to run something before every test instead of before any test runs, use `beforeEach` instead. + +### `beforeEach(fn, timeout)` + +Runs a function before each of the tests in this file runs. If the function returns a promise or is a generator, Jest waits for that promise to resolve before running the test. + +Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ + +This is often useful if you want to reset some global state that will be used by many tests. + +For example: + +```js +const globalDatabase = makeGlobalDatabase(); + +beforeEach(() => { + // Clears the database and adds some testing data. + // Jest will wait for this promise to resolve before running tests. + return globalDatabase.clear().then(() => { + return globalDatabase.insert({testData: 'foo'}); + }); +}); + +test('can find things', () => { + return globalDatabase.find('thing', {}, results => { + expect(results.length).toBeGreaterThan(0); + }); +}); + +test('can insert a thing', () => { + return globalDatabase.insert('thing', makeThing(), response => { + expect(response.success).toBeTruthy(); + }); +}); +``` + +Here the `beforeEach` ensures that the database is reset for each test. + +If `beforeEach` is inside a `describe` block, it runs for each test in the describe block. + +If you only need to run some setup code once, before any tests run, use `beforeAll` instead. + +### `describe(name, fn)` + +`describe(name, fn)` creates a block that groups together several related tests. For example, if you have a `myBeverage` object that is supposed to be delicious but not sour, you could test it with: + +```js +const myBeverage = { + delicious: true, + sour: false, +}; + +describe('my beverage', () => { + test('is delicious', () => { + expect(myBeverage.delicious).toBeTruthy(); + }); + + test('is not sour', () => { + expect(myBeverage.sour).toBeFalsy(); + }); +}); +``` + +This isn't required - you can write the `test` blocks directly at the top level. But this can be handy if you prefer your tests to be organized into groups. + +You can also nest `describe` blocks if you have a hierarchy of tests: + +```js +const binaryStringToNumber = binString => { + if (!/^[01]+$/.test(binString)) { + throw new CustomError('Not a binary number.'); + } + + return parseInt(binString, 2); +}; + +describe('binaryStringToNumber', () => { + describe('given an invalid binary string', () => { + test('composed of non-numbers throws CustomError', () => { + expect(() => binaryStringToNumber('abc')).toThrowError(CustomError); + }); + + test('with extra whitespace throws CustomError', () => { + expect(() => binaryStringToNumber(' 100')).toThrowError(CustomError); + }); + }); + + describe('given a valid binary string', () => { + test('returns the correct number', () => { + expect(binaryStringToNumber('100')).toBe(4); + }); + }); +}); +``` + +### `describe.each(table)(name, fn, timeout)` + +Use `describe.each` if you keep duplicating the same test suites with different data. `describe.each` allows you to write the test suite once and pass data in. + +`describe.each` is available with two APIs: + +#### 1. `describe.each(table)(name, fn, timeout)` + +- `table`: `Array` of Arrays with the arguments that are passed into the `fn` for each row. + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` +- `name`: `String` the title of the test suite. + - Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): + - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). + - `%s`- String. + - `%d`- Number. + - `%i` - Integer. + - `%f` - Floating point value. + - `%j` - JSON. + - `%o` - Object. + - `%#` - Index of the test case. + - `%%` - single percent sign ('%'). This does not consume an argument. +- `fn`: `Function` the suite of tests to be ran, this is the function that will receive the parameters in each row as function arguments. +- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. _Note: The default timeout is 5 seconds._ + +Example: + +```js +describe.each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +])('.add(%i, %i)', (a, b, expected) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); + + test(`returned value not be greater than ${expected}`, () => { + expect(a + b).not.toBeGreaterThan(expected); + }); + + test(`returned value not be less than ${expected}`, () => { + expect(a + b).not.toBeLessThan(expected); + }); +}); +``` + +#### 2. `` describe.each`table`(name, fn, timeout) `` + +- `table`: `Tagged Template Literal` + - First row of variable name column headings separated with `|` + - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. +- `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions. + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` +- `fn`: `Function` the suite of tests to be ran, this is the function that will receive the test data object. +- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. _Note: The default timeout is 5 seconds._ + +Example: + +```js +describe.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`('$a + $b', ({a, b, expected}) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); + + test(`returned value not be greater than ${expected}`, () => { + expect(a + b).not.toBeGreaterThan(expected); + }); + + test(`returned value not be less than ${expected}`, () => { + expect(a + b).not.toBeLessThan(expected); + }); +}); +``` + +### `describe.only(name, fn)` + +Also under the alias: `fdescribe(name, fn)` + +You can use `describe.only` if you want to run only one describe block: + +```js +describe.only('my beverage', () => { + test('is delicious', () => { + expect(myBeverage.delicious).toBeTruthy(); + }); + + test('is not sour', () => { + expect(myBeverage.sour).toBeFalsy(); + }); +}); + +describe('my other beverage', () => { + // ... will be skipped +}); +``` + +### `describe.only.each(table)(name, fn)` + +Also under the aliases: `fdescribe.each(table)(name, fn)` and `` fdescribe.each`table`(name, fn) `` + +Use `describe.only.each` if you want to only run specific tests suites of data driven tests. + +`describe.only.each` is available with two APIs: + +#### `describe.only.each(table)(name, fn)` + +```js +describe.only.each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +])('.add(%i, %i)', (a, b, expected) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); +}); + +test('will not be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +#### `` describe.only.each`table`(name, fn) `` + +```js +describe.only.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`('returns $expected when $a is added $b', ({a, b, expected}) => { + test('passes', () => { + expect(a + b).toBe(expected); + }); +}); + +test('will not be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +### `describe.skip(name, fn)` + +Also under the alias: `xdescribe(name, fn)` + +You can use `describe.skip` if you do not want to run a particular describe block: + +```js +describe('my beverage', () => { + test('is delicious', () => { + expect(myBeverage.delicious).toBeTruthy(); + }); + + test('is not sour', () => { + expect(myBeverage.sour).toBeFalsy(); + }); +}); + +describe.skip('my other beverage', () => { + // ... will be skipped +}); +``` + +Using `describe.skip` is often a cleaner alternative to temporarily commenting out a chunk of tests. + +### `describe.skip.each(table)(name, fn)` + +Also under the aliases: `xdescribe.each(table)(name, fn)` and `` xdescribe.each`table`(name, fn) `` + +Use `describe.skip.each` if you want to stop running a suite of data driven tests. + +`describe.skip.each` is available with two APIs: + +#### `describe.skip.each(table)(name, fn)` + +```js +describe.skip.each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +])('.add(%i, %i)', (a, b, expected) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); // will not be ran + }); +}); + +test('will be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +#### `` describe.skip.each`table`(name, fn) `` + +```js +describe.skip.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`('returns $expected when $a is added $b', ({a, b, expected}) => { + test('will not be ran', () => { + expect(a + b).toBe(expected); // will not be ran + }); +}); + +test('will be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +### `test(name, fn, timeout)` + +Also under the alias: `it(name, fn, timeout)` + +All you need in a test file is the `test` method which runs a test. For example, let's say there's a function `inchesOfRain()` that should be zero. Your whole test could be: + +```js +test('did not rain', () => { + expect(inchesOfRain()).toBe(0); +}); +``` + +The first argument is the test name; the second argument is a function that contains the expectations to test. The third argument (optional) is `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ + +> Note: If a **promise is returned** from `test`, Jest will wait for the promise to resolve before letting the test complete. Jest will also wait if you **provide an argument to the test function**, usually called `done`. This could be handy when you want to test callbacks. See how to test async code [here](TestingAsyncCode.md#callbacks). + +For example, let's say `fetchBeverageList()` returns a promise that is supposed to resolve to a list that has `lemon` in it. You can test this with: + +```js +test('has lemon in it', () => { + return fetchBeverageList().then(list => { + expect(list).toContain('lemon'); + }); +}); +``` + +Even though the call to `test` will return right away, the test doesn't complete until the promise resolves as well. + +### `test.each(table)(name, fn, timeout)` + +Also under the alias: `it.each(table)(name, fn)` and `` it.each`table`(name, fn) `` + +Use `test.each` if you keep duplicating the same test with different data. `test.each` allows you to write the test once and pass data in. + +`test.each` is available with two APIs: + +#### 1. `test.each(table)(name, fn, timeout)` + +- `table`: `Array` of Arrays with the arguments that are passed into the test `fn` for each row. + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` +- `name`: `String` the title of the test block. + - Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): + - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). + - `%s`- String. + - `%d`- Number. + - `%i` - Integer. + - `%f` - Floating point value. + - `%j` - JSON. + - `%o` - Object. + - `%#` - Index of the test case. + - `%%` - single percent sign ('%'). This does not consume an argument. +- `fn`: `Function` the test to be ran, this is the function that will receive the parameters in each row as function arguments. +- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. _Note: The default timeout is 5 seconds._ + +Example: + +```js +test.each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +])('.add(%i, %i)', (a, b, expected) => { + expect(a + b).toBe(expected); +}); +``` + +#### 2. `` test.each`table`(name, fn, timeout) `` + +- `table`: `Tagged Template Literal` + - First row of variable name column headings separated with `|` + - One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. +- `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions. + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` +- `fn`: `Function` the test to be ran, this is the function that will receive the test data object. +- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. _Note: The default timeout is 5 seconds._ + +Example: + +```js +test.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`('returns $expected when $a is added $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); +``` + +### `test.only(name, fn, timeout)` + +Also under the aliases: `ftest(name, fn, timeout)`, `it.only(name, fn, timeout)`, and `fit(name, fn, timeout)` + +When you are debugging a large test file, you will often only want to run a subset of tests. You can use `.only` to specify which tests are the only ones you want to run in that test file. + +Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ + +For example, let's say you had these tests: + +```js +test.only('it is raining', () => { + expect(inchesOfRain()).toBeGreaterThan(0); +}); + +test('it is not snowing', () => { + expect(inchesOfSnow()).toBe(0); +}); +``` + +Only the "it is raining" test will run in that test file, since it is run with `test.only`. + +Usually you wouldn't check code using `test.only` into source control - you would use it for debugging, and remove it once you have fixed the broken tests. + +### `test.only.each(table)(name, fn)` + +Also under the aliases: `ftest.each(table)(name, fn)`, `it.only.each(table)(name, fn)`, `fit.each(table)(name, fn)`, `` ftest.each`table`(name, fn) ``, `` it.only.each`table`(name, fn) `` and `` fit.each`table`(name, fn) `` + +Use `test.only.each` if you want to only run specific tests with different test data. + +`test.only.each` is available with two APIs: + +#### `test.only.each(table)(name, fn)` + +```js +test.only.each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +])('.add(%i, %i)', (a, b, expected) => { + expect(a + b).toBe(expected); +}); + +test('will not be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +#### `` test.only.each`table`(name, fn) `` + +```js +test.only.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`('returns $expected when $a is added $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); + +test('will not be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +### `test.skip(name, fn)` + +Also under the aliases: `it.skip(name, fn)`, `xit(name, fn)`, and `xtest(name, fn)` + +When you are maintaining a large codebase, you may sometimes find a test that is temporarily broken for some reason. If you want to skip running this test, but you don't want to delete this code, you can use `test.skip` to specify some tests to skip. + +For example, let's say you had these tests: + +```js +test('it is raining', () => { + expect(inchesOfRain()).toBeGreaterThan(0); +}); + +test.skip('it is not snowing', () => { + expect(inchesOfSnow()).toBe(0); +}); +``` + +Only the "it is raining" test will run, since the other test is run with `test.skip`. + +You could comment the test out, but it's often a bit nicer to use `test.skip` because it will maintain indentation and syntax highlighting. + +### `test.skip.each(table)(name, fn)` + +Also under the aliases: `it.skip.each(table)(name, fn)`, `xit.each(table)(name, fn)`, `xtest.each(table)(name, fn)`, `` it.skip.each`table`(name, fn) ``, `` xit.each`table`(name, fn) `` and `` xtest.each`table`(name, fn) `` + +Use `test.skip.each` if you want to stop running a collection of data driven tests. + +`test.skip.each` is available with two APIs: + +#### `test.skip.each(table)(name, fn)` + +```js +test.skip.each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +])('.add(%i, %i)', (a, b, expected) => { + expect(a + b).toBe(expected); // will not be ran +}); + +test('will be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +#### `` test.skip.each`table`(name, fn) `` + +```js +test.skip.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`('returns $expected when $a is added $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); // will not be ran +}); + +test('will be ran', () => { + expect(1 / 0).toBe(Infinity); +}); +``` + +### `test.todo(name)` + +Also under the alias: `it.todo(name)` + +Use `test.todo` when you are planning on writing tests. These tests will be highlighted in the summary output at the end so you know how many tests you still need todo. + +_Note_: If you supply a test callback function then the `test.todo` will throw an error. If you have already implemented the test and it is broken and you do not want it to run, then use `test.skip` instead. + +#### API + +- `name`: `String` the title of the test plan. + +Example: + +```js +const add = (a, b) => a + b; + +test.todo('add should be associative'); +``` diff --git a/website/versioned_docs/version-25.3/JestObjectAPI.md b/website/versioned_docs/version-25.x/JestObjectAPI.md similarity index 99% rename from website/versioned_docs/version-25.3/JestObjectAPI.md rename to website/versioned_docs/version-25.x/JestObjectAPI.md index 849304a96b75..a4a19efdc61a 100644 --- a/website/versioned_docs/version-25.3/JestObjectAPI.md +++ b/website/versioned_docs/version-25.x/JestObjectAPI.md @@ -1,10 +1,10 @@ --- -id: version-25.3-jest-object +id: version-25.x-jest-object title: The Jest Object original_id: jest-object --- -The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. +The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`. ## Mock Modules diff --git a/website/versioned_docs/version-25.1/JestPlatform.md b/website/versioned_docs/version-25.x/JestPlatform.md similarity index 93% rename from website/versioned_docs/version-25.1/JestPlatform.md rename to website/versioned_docs/version-25.x/JestPlatform.md index 4c71970c982f..178945aeffeb 100644 --- a/website/versioned_docs/version-25.1/JestPlatform.md +++ b/website/versioned_docs/version-25.x/JestPlatform.md @@ -1,5 +1,5 @@ --- -id: version-25.1-jest-platform +id: version-25.x-jest-platform title: Jest Platform original_id: jest-platform --- @@ -59,7 +59,7 @@ const code = ` * * @flow */ - + console.log('Hello World!'); `; @@ -120,7 +120,7 @@ You can read more about `jest-validate` in the [readme file](https://github.com/ ## jest-worker -Module used for parallelization of tasks. Exports a class `Worker` that takes the path of Node.js module and lets you call the module's exported methods as if they were class methods, returning a promise that resolves when the specified method finishes its execution in a forked process. +Module used for parallelization of tasks. Exports a class `JestWorker` that takes the path of Node.js module and lets you call the module's exported methods as if they were class methods, returning a promise that resolves when the specified method finishes its execution in a forked process. ### Example diff --git a/website/versioned_docs/version-25.1/MockFunctions.md b/website/versioned_docs/version-25.x/MockFunctions.md similarity index 99% rename from website/versioned_docs/version-25.1/MockFunctions.md rename to website/versioned_docs/version-25.x/MockFunctions.md index f9ada1561dba..39d2282142e1 100644 --- a/website/versioned_docs/version-25.1/MockFunctions.md +++ b/website/versioned_docs/version-25.x/MockFunctions.md @@ -1,5 +1,5 @@ --- -id: version-25.1-mock-functions +id: version-25.x-mock-functions title: Mock Functions original_id: mock-functions --- diff --git a/website/versioned_docs/version-25.3/TestingAsyncCode.md b/website/versioned_docs/version-25.x/TestingAsyncCode.md similarity index 99% rename from website/versioned_docs/version-25.3/TestingAsyncCode.md rename to website/versioned_docs/version-25.x/TestingAsyncCode.md index 5d1048c83ccd..3d8487c805d4 100644 --- a/website/versioned_docs/version-25.3/TestingAsyncCode.md +++ b/website/versioned_docs/version-25.x/TestingAsyncCode.md @@ -1,5 +1,5 @@ --- -id: version-25.3-asynchronous +id: version-25.x-asynchronous title: Testing Asynchronous Code original_id: asynchronous --- diff --git a/website/versioned_docs/version-25.1/TestingFrameworks.md b/website/versioned_docs/version-25.x/TestingFrameworks.md similarity index 82% rename from website/versioned_docs/version-25.1/TestingFrameworks.md rename to website/versioned_docs/version-25.x/TestingFrameworks.md index 3595fa090d8e..65a0b6c20be0 100644 --- a/website/versioned_docs/version-25.1/TestingFrameworks.md +++ b/website/versioned_docs/version-25.x/TestingFrameworks.md @@ -1,10 +1,14 @@ --- -id: version-25.1-testing-frameworks +id: version-25.x-testing-frameworks title: Testing Web Frameworks original_id: testing-frameworks --- -Although Jest may be considered a React-specific test runner, in fact it is a universal testing platform, with the ability to adapt to any JavaScript library or framework. In this section we'd like to link to community posts and articles about integrating Jest into other popular JS libraries. +Jest is a universal testing platform, with the ability to adapt to any JavaScript library or framework. In this section we'd like to link to community posts and articles about integrating Jest into popular JS libraries. + +## React + +- [Testing ReactJS components with Jest](https://testing-library.com/docs/react-testing-library/example-intro) by Kent C. Dodds ([@kentcdodds](https://twitter.com/kentcdodds)) ## Vue.js diff --git a/website/versioned_docs/version-25.1/Troubleshooting.md b/website/versioned_docs/version-25.x/Troubleshooting.md similarity index 99% rename from website/versioned_docs/version-25.1/Troubleshooting.md rename to website/versioned_docs/version-25.x/Troubleshooting.md index 1e9aa2cdf87c..1fe2499394b4 100644 --- a/website/versioned_docs/version-25.1/Troubleshooting.md +++ b/website/versioned_docs/version-25.x/Troubleshooting.md @@ -1,5 +1,5 @@ --- -id: version-25.1-troubleshooting +id: version-25.x-troubleshooting title: Troubleshooting original_id: troubleshooting --- diff --git a/website/versioned_docs/version-25.1/TutorialAsync.md b/website/versioned_docs/version-25.x/TutorialAsync.md similarity index 99% rename from website/versioned_docs/version-25.1/TutorialAsync.md rename to website/versioned_docs/version-25.x/TutorialAsync.md index 07937b7b5281..887e8423e118 100644 --- a/website/versioned_docs/version-25.1/TutorialAsync.md +++ b/website/versioned_docs/version-25.x/TutorialAsync.md @@ -1,5 +1,5 @@ --- -id: version-25.1-tutorial-async +id: version-25.x-tutorial-async title: An Async Example original_id: tutorial-async --- diff --git a/website/versioned_docs/version-25.3/TutorialReact.md b/website/versioned_docs/version-25.x/TutorialReact.md similarity index 99% rename from website/versioned_docs/version-25.3/TutorialReact.md rename to website/versioned_docs/version-25.x/TutorialReact.md index 3534b51d5a03..e671f8e21bb3 100644 --- a/website/versioned_docs/version-25.3/TutorialReact.md +++ b/website/versioned_docs/version-25.x/TutorialReact.md @@ -1,5 +1,5 @@ --- -id: version-25.3-tutorial-react +id: version-25.x-tutorial-react title: Testing React Apps original_id: tutorial-react --- diff --git a/website/versioned_docs/version-25.3/TutorialReactNative.md b/website/versioned_docs/version-25.x/TutorialReactNative.md similarity index 99% rename from website/versioned_docs/version-25.3/TutorialReactNative.md rename to website/versioned_docs/version-25.x/TutorialReactNative.md index 0d2597d8c35a..4641502e339e 100644 --- a/website/versioned_docs/version-25.3/TutorialReactNative.md +++ b/website/versioned_docs/version-25.x/TutorialReactNative.md @@ -1,5 +1,5 @@ --- -id: version-25.3-tutorial-react-native +id: version-25.x-tutorial-react-native title: Testing React Native Apps original_id: tutorial-react-native --- diff --git a/website/versioned_docs/version-25.1/CLI.md b/website/versioned_docs/version-26.0/CLI.md similarity index 93% rename from website/versioned_docs/version-25.1/CLI.md rename to website/versioned_docs/version-26.0/CLI.md index 731f4b81b1f2..ce5c4fcaac88 100644 --- a/website/versioned_docs/version-25.1/CLI.md +++ b/website/versioned_docs/version-26.0/CLI.md @@ -1,5 +1,5 @@ --- -id: version-25.1-cli +id: version-26.0-cli title: Jest CLI Options original_id: cli --- @@ -157,11 +157,7 @@ Alias: `--collectCoverage`. Indicates that test coverage information should be c Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`. -Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel and comes with a few caveats - -1. Your node version must include `vm.compileFunction`, which was introduced in [node 10.10](https://nodejs.org/dist/latest-v12.x/docs/api/vm.html#vm_vm_compilefunction_code_params_options) -1. Tests needs to run in Node test environment (support for `jsdom` requires [`jest-environment-jsdom-sixteen`](https://www.npmjs.com/package/jest-environment-jsdom-sixteen)) -1. V8 has way better data in the later versions, so using the latest versions of node (v13 at the time of this writing) will yield better results +Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results. ### `--debug` @@ -237,8 +233,6 @@ Disables stack trace in test results output. Activates notifications for test results. Good for when you don't want your consciousness to be able to focus on anything except JavaScript testing. -**Beware:** Jest uses [node-notifier](https://github.com/mikaelbr/node-notifier) to display desktop notifications. On Windows, it creates a new start menu entry on the first use and not display the notification. Notifications will be properly displayed on subsequent runs - ### `--onlyChanged` Alias: `-o`. Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a git/hg repository at the moment and requires a static dependency graph (ie. no dynamic requires). diff --git a/website/versioned_docs/version-25.1/Configuration.md b/website/versioned_docs/version-26.0/Configuration.md similarity index 92% rename from website/versioned_docs/version-25.1/Configuration.md rename to website/versioned_docs/version-26.0/Configuration.md index ea8a7682c213..b131bb69c112 100644 --- a/website/versioned_docs/version-25.1/Configuration.md +++ b/website/versioned_docs/version-26.0/Configuration.md @@ -1,5 +1,5 @@ --- -id: version-25.1-configuration +id: version-26.0-configuration title: Configuring Jest original_id: configuration --- @@ -106,12 +106,6 @@ Default: `0` By default, Jest runs all tests and produces all errors into the console upon completion. The bail config option can be used here to have Jest stop running tests after `n` failures. Setting bail to `true` is the same as setting bail to `1`. -### `browser` [boolean] - -Default: `false` - -Respect Browserify's [`"browser"` field](https://github.com/substack/browserify-handbook#browser-field) in `package.json` when resolving modules. Some modules export different versions based on whether they are operating in Node or a browser. - ### `cacheDirectory` [string] Default: `"/tmp/"` @@ -190,13 +184,9 @@ These pattern strings match against the full path. Use the `` string to Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`. -Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel and comes with a few caveats +Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results. -1. Your node version must include `vm.compileFunction`, which was introduced in [node 10.10](https://nodejs.org/dist/latest-v12.x/docs/api/vm.html#vm_vm_compilefunction_code_params_options) -1. Tests needs to run in Node test environment (support for `jsdom` requires [`jest-environment-jsdom-sixteen`](https://www.npmjs.com/package/jest-environment-jsdom-sixteen)) -1. V8 has way better data in the later versions, so using the latest versions of node (v13 at the time of this writing) will yield better results - -### `coverageReporters` [array\] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -204,6 +194,12 @@ A list of reporter names that Jest uses when writing coverage reports. Any [ista _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ +_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ + +```json +["json", ["lcov", {"projectRoot": "../../"}]] +``` + ### `coverageThreshold` [object] Default: `undefined` @@ -459,11 +455,11 @@ An array of file extensions your modules use. If you require modules without spe We recommend placing the extensions most commonly used in your project on the left, so if you are using TypeScript, you may want to consider moving "ts" and/or "tsx" to the beginning of the array. -### `moduleNameMapper` [object\] +### `moduleNameMapper` [object\>] Default: `null` -A map from regular expressions to module names that allow to stub out resources, like images or styles with a single module. +A map from regular expressions to module names or to arrays of module names that allow to stub out resources, like images or styles with a single module. Modules that are mapped to an alias are unmocked by default, regardless of whether automocking is enabled or not. @@ -478,12 +474,17 @@ Example: "moduleNameMapper": { "^image![a-zA-Z0-9$_-]+$": "GlobalImageStub", "^[./a-zA-Z0-9$_-]+\\.png$": "/RelativeImageStub.js", - "module_name_(.*)": "/substituted_module_$1.js" + "module_name_(.*)": "/substituted_module_$1.js", + "assets/(.*)": [ + "/images/$1", + "/photos/$1", + "/recipes/$1" + ] } } ``` -The order in which the mappings are defined matters. Patterns are checked one by one until one fits. The most specific rule should be listed first. +The order in which the mappings are defined matters. Patterns are checked one by one until one fits. The most specific rule should be listed first. This is true for arrays of module names as well. _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ @@ -507,6 +508,8 @@ Default: `false` Activates notifications for test results. +**Beware:** Jest uses [node-notifier](https://github.com/mikaelbr/node-notifier) to display desktop notifications. On Windows, it creates a new start menu entry on the first use and not display the notification. Notifications will be properly displayed on subsequent runs + ### `notifyMode` [string] Default: `failure-change` @@ -677,7 +680,6 @@ This option allows the use of a custom resolver. This resolver must be a node mo ```json { "basedir": string, - "browser": bool, "defaultResolver": "function(request, options)", "extensions": [string], "moduleDirectory": [string], @@ -688,7 +690,18 @@ This option allows the use of a custom resolver. This resolver must be a node mo The function should either return a path to the module that should be resolved or throw an error if the module can't be found. -Note: the defaultResolver passed as options is the jest default resolver which might be useful when you write your custom one. It takes the same arguments as your custom one, e.g. (request, options). +Note: the defaultResolver passed as options is the Jest default resolver which might be useful when you write your custom one. It takes the same arguments as your custom one, e.g. `(request, options)`. + +For example, if you want to respect Browserify's [`"browser"` field](https://github.com/browserify/browserify-handbook/blob/master/readme.markdown#browser-field), you can use the following configuration: + +```json +{ + ... + "jest": { + "resolver": "browser-resolve" + } +} +``` ### `restoreMocks` [boolean] @@ -744,7 +757,7 @@ async runTests( ): Promise ``` -If you need to restrict your test-runner to only run in serial rather then being executed in parallel your class should have the property `isSerial` to be set as `true`. +If you need to restrict your test-runner to only run in serial rather than being executed in parallel your class should have the property `isSerial` to be set as `true`. ### `setupFiles` [array] @@ -867,7 +880,7 @@ Pretty foo: Object { To make a dependency explicit instead of implicit, you can call [`expect.addSnapshotSerializer`](ExpectAPI.md#expectaddsnapshotserializerserializer) to add a module for an individual test file instead of adding its path to `snapshotSerializers` in Jest configuration. -More about serializers API can be found [here](https://github.com/facebook/jest/tree/master/packages/pretty-format#serialize). +More about serializers API can be found [here](https://github.com/facebook/jest/tree/master/packages/pretty-format/README.md#serialize). ### `testEnvironment` [string] @@ -890,7 +903,7 @@ test('use jsdom in this test file', () => { You can create your own module that will be used for setting up the test environment. The module must export a class with `setup`, `teardown` and `runScript` methods. You can also pass variables from this module to your test suites by assigning them to `this.global` object – this will make them available in your test suites as global variables. -The class may optionally expose a `handleTestEvent` method to bind to events fired by [`jest-circus`](https://github.com/facebook/jest/tree/master/packages/jest-circus). +The class may optionally expose an asynchronous `handleTestEvent` method to bind to events fired by [`jest-circus`](https://github.com/facebook/jest/tree/master/packages/jest-circus). Normally, `jest-circus` test runner would pause until a promise returned from `handleTestEvent` gets fulfilled, **except for the next events**: `start_describe_definition`, `finish_describe_definition`, `add_hook`, `add_test` or `error` (for the up-to-date list you can look at [SyncEvent type in the types definitions](https://github.com/facebook/jest/tree/master/packages/jest-types/src/Circus.ts)). That is caused by backward compatibility reasons and `process.on('unhandledRejection', callback)` signature, but that usually should not be a problem for most of the use cases. Any docblock pragmas in test files will be passed to the environment constructor and can be used for per-test configuration. If the pragma does not have a value, it will be present in the object with it's value set to an empty string. If the pragma is not present, it will not be present in the object. @@ -930,7 +943,7 @@ class CustomEnvironment extends NodeEnvironment { return super.runScript(script); } - handleTestEvent(event, state) { + async handleTestEvent(event, state) { if (event.name === 'test_start') { // ... } @@ -1073,6 +1086,7 @@ Example: Sort test path alphabetically. ```js +// testSequencer.js const Sequencer = require('@jest/test-sequencer').default; class CustomSequencer extends Sequencer { @@ -1087,6 +1101,14 @@ class CustomSequencer extends Sequencer { module.exports = CustomSequencer; ``` +Use it in your Jest config file like this: + +```json +{ + "testSequencer": "path/to/testSequencer.js" +} +``` + ### `testTimeout` [number] Default: `5000` @@ -1103,11 +1125,13 @@ This option sets the URL for the jsdom environment. It is reflected in propertie Default: `real` -Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. +Setting this value to `legacy` or `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. + +If the value is `modern`, [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers) will be used as implementation instead of Jest's own legacy implementation. This will be the default fake implementation in Jest 27. ### `transform` [object\] -Default: `undefined` +Default: `{"^.+\\.[jt]sx?$": "babel-jest"}` A map from regular expressions to paths to transformers. A transformer is a module that provides a synchronous function for transforming source files. For example, if you wanted to be able to use a new language feature in your modules or tests that isn't yet supported by node, you might plug in one of many compilers that compile a future version of JavaScript to a current one. Example: see the [examples/typescript](https://github.com/facebook/jest/blob/master/examples/typescript/package.json#L16) example or the [webpack tutorial](Webpack.md). @@ -1122,7 +1146,7 @@ You can pass configuration to a transformer like `{filePattern: ['path-to-transf _Note: a transformer is only run once per file unless the file has changed. During development of a transformer it can be useful to run Jest with `--no-cache` to frequently [delete Jest's cache](Troubleshooting.md#caching-issues)._ -_Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ +_Note: when adding additional code transformers, this will overwrite the default config and `babel-jest` is no longer automatically loaded. If you want to use it to compile JavaScript or Typescript, it has to be explicitly defined by adding `{"^.+\\.[jt]sx?$": "babel-jest"}` to the transform property. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ ### `transformIgnorePatterns` [array\] diff --git a/website/versioned_docs/version-26.0/JestObjectAPI.md b/website/versioned_docs/version-26.0/JestObjectAPI.md new file mode 100644 index 000000000000..eb6c6ebac297 --- /dev/null +++ b/website/versioned_docs/version-26.0/JestObjectAPI.md @@ -0,0 +1,692 @@ +--- +id: version-26.0-jest-object +title: The Jest Object +original_id: jest-object +--- + +The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`. + +## Mock Modules + +### `jest.disableAutomock()` + +Disables automatic mocking in the module loader. + +> See `automock` section of [configuration](Configuration.md#automock-boolean) for more information + +After this method is called, all `require()`s will return the real versions of each module (rather than a mocked version). + +Jest configuration: + +```json +{ + "automock": true +} +``` + +Example: + +```js +// utils.js +export default { + authorize: () => { + return 'token'; + }, +}; +``` + +```js +// __tests__/disableAutomocking.js +import utils from '../utils'; + +jest.disableAutomock(); + +test('original implementation', () => { + // now we have the original implementation, + // even if we set the automocking in a jest configuration + expect(utils.authorize()).toBe('token'); +}); +``` + +This is usually useful when you have a scenario where the number of dependencies you want to mock is far less than the number of dependencies that you don't. For example, if you're writing a test for a module that uses a large number of dependencies that can be reasonably classified as "implementation details" of the module, then you likely do not want to mock them. + +Examples of dependencies that might be considered "implementation details" are things ranging from language built-ins (e.g. Array.prototype methods) to highly common utility methods (e.g. underscore/lo-dash, array utilities etc) and entire libraries like React.js. + +Returns the `jest` object for chaining. + +_Note: this method was previously called `autoMockOff`. When using `babel-jest`, calls to `disableAutomock` will automatically be hoisted to the top of the code block. Use `autoMockOff` if you want to explicitly avoid this behavior._ + +### `jest.enableAutomock()` + +Enables automatic mocking in the module loader. + +Returns the `jest` object for chaining. + +> See `automock` section of [configuration](Configuration.md#automock-boolean) for more information + +Example: + +```js +// utils.js +export default { + authorize: () => { + return 'token'; + }, + isAuthorized: secret => secret === 'wizard', +}; +``` + +```js +// __tests__/enableAutomocking.js +jest.enableAutomock(); + +import utils from '../utils'; + +test('original implementation', () => { + // now we have the mocked implementation, + expect(utils.authorize._isMockFunction).toBeTruthy(); + expect(utils.isAuthorized._isMockFunction).toBeTruthy(); +}); +``` + +_Note: this method was previously called `autoMockOn`. When using `babel-jest`, calls to `enableAutomock` will automatically be hoisted to the top of the code block. Use `autoMockOn` if you want to explicitly avoid this behavior._ + +### `jest.createMockFromModule(moduleName)` + +##### renamed in Jest **26.0.0+** + +Also under the alias: `.genMockFromModule(moduleName)` + +Given the name of a module, use the automatic mocking system to generate a mocked version of the module for you. + +This is useful when you want to create a [manual mock](ManualMocks.md) that extends the automatic mock's behavior. + +Example: + +```js +// utils.js +export default { + authorize: () => { + return 'token'; + }, + isAuthorized: secret => secret === 'wizard', +}; +``` + +```js +// __tests__/createMockFromModule.test.js +const utils = jest.createMockFromModule('../utils').default; +utils.isAuthorized = jest.fn(secret => secret === 'not wizard'); + +test('implementation created by jest.createMockFromModule', () => { + expect(utils.authorize.mock).toBeTruthy(); + expect(utils.isAuthorized('not wizard')).toEqual(true); +}); +``` + +This is how `createMockFromModule` will mock the following data types: + +#### `Function` + +Creates a new [mock function](https://jestjs.io/docs/en/mock-functions.html). The new function has no formal parameters and when called will return `undefined`. This functionality also applies to `async` functions. + +#### `Class` + +Creates new class. The interface of the original class is maintained, all of the class member functions and properties will be mocked. + +#### `Object` + +Creates a new deeply cloned object. The object keys are maintained and their values are mocked. + +#### `Array` + +Creates a new empty array, ignoring the original. + +#### `Primitives` + +Creates a new property with the same primitive value as the original property. + +Example: + +``` +// example.js +module.exports = { + function: function square(a, b) { + return a * b; + }, + asyncFunction: async function asyncSquare(a, b) { + const result = await a * b; + return result; + }, + class: new class Bar { + constructor() { + this.array = [1, 2, 3]; + } + foo() {} + }, + object: { + baz: 'foo', + bar: { + fiz: 1, + buzz: [1, 2, 3], + }, + }, + array: [1, 2, 3], + number: 123, + string: 'baz', + boolean: true, + symbol: Symbol.for('a.b.c'), +}; +``` + +```js +// __tests__/example.test.js +const example = jest.createMockFromModule('./example'); + +test('should run example code', () => { + // creates a new mocked function with no formal arguments. + expect(example.function.name).toEqual('square'); + expect(example.function.length).toEqual(0); + + // async functions get the same treatment as standard synchronous functions. + expect(example.asyncFunction.name).toEqual('asyncSquare'); + expect(example.asyncFunction.length).toEqual(0); + + // creates a new class with the same interface, member functions and properties are mocked. + expect(example.class.constructor.name).toEqual('Bar'); + expect(example.class.foo.name).toEqual('foo'); + expect(example.class.array.length).toEqual(0); + + // creates a deeply cloned version of the original object. + expect(example.object).toEqual({ + baz: 'foo', + bar: { + fiz: 1, + buzz: [], + }, + }); + + // creates a new empty array, ignoring the original array. + expect(example.array.length).toEqual(0); + + // creates a new property with the same primitive value as the original property. + expect(example.number).toEqual(123); + expect(example.string).toEqual('baz'); + expect(example.boolean).toEqual(true); + expect(example.symbol).toEqual(Symbol.for('a.b.c')); +}); +``` + +### `jest.mock(moduleName, factory, options)` + +Mocks a module with an auto-mocked version when it is being required. `factory` and `options` are optional. For example: + +```js +// banana.js +module.exports = () => 'banana'; + +// __tests__/test.js +jest.mock('../banana'); + +const banana = require('../banana'); // banana will be explicitly mocked. + +banana(); // will return 'undefined' because the function is auto-mocked. +``` + +The second argument can be used to specify an explicit module factory that is being run instead of using Jest's automocking feature: + +```js +jest.mock('../moduleName', () => { + return jest.fn(() => 42); +}); + +// This runs the function specified as second argument to `jest.mock`. +const moduleName = require('../moduleName'); +moduleName(); // Will return '42'; +``` + +When using the `factory` parameter for an ES6 module with a default export, the `__esModule: true` property needs to be specified. This property is normally generated by Babel / TypeScript, but here it needs to be set manually. When importing a default export, it's an instruction to import the property named `default` from the export object: + +```js +import moduleName, {foo} from '../moduleName'; + +jest.mock('../moduleName', () => { + return { + __esModule: true, + default: jest.fn(() => 42), + foo: jest.fn(() => 43), + }; +}); + +moduleName(); // Will return 42 +foo(); // Will return 43 +``` + +The third argument can be used to create virtual mocks – mocks of modules that don't exist anywhere in the system: + +```js +jest.mock( + '../moduleName', + () => { + /* + * Custom implementation of a module that doesn't exist in JS, + * like a generated module or a native module in react-native. + */ + }, + {virtual: true}, +); +``` + +> **Warning:** Importing a module in a setup file (as specified by `setupTestFrameworkScriptFile`) will prevent mocking for the module in question, as well as all the modules that it imports. + +Modules that are mocked with `jest.mock` are mocked only for the file that calls `jest.mock`. Another file that imports the module will get the original implementation even if it runs after the test file that mocks the module. + +Returns the `jest` object for chaining. + +### `jest.unmock(moduleName)` + +Indicates that the module system should never return a mocked version of the specified module from `require()` (e.g. that it should always return the real module). + +The most common use of this API is for specifying the module a given test intends to be testing (and thus doesn't want automatically mocked). + +Returns the `jest` object for chaining. + +### `jest.doMock(moduleName, factory, options)` + +When using `babel-jest`, calls to `mock` will automatically be hoisted to the top of the code block. Use this method if you want to explicitly avoid this behavior. + +One example when this is useful is when you want to mock a module differently within the same file: + +```js +beforeEach(() => { + jest.resetModules(); +}); + +test('moduleName 1', () => { + jest.doMock('../moduleName', () => { + return jest.fn(() => 1); + }); + const moduleName = require('../moduleName'); + expect(moduleName()).toEqual(1); +}); + +test('moduleName 2', () => { + jest.doMock('../moduleName', () => { + return jest.fn(() => 2); + }); + const moduleName = require('../moduleName'); + expect(moduleName()).toEqual(2); +}); +``` + +Using `jest.doMock()` with ES6 imports requires additional steps. Follow these if you don't want to use `require` in your tests: + +- We have to specify the `__esModule: true` property (see the [`jest.mock()`](#jestmockmodulename-factory-options) API for more information). +- Static ES6 module imports are hoisted to the top of the file, so instead we have to import them dynamically using `import()`. +- Finally, we need an environment which supports dynamic importing. Please see [Using Babel](GettingStarted.md#using-babel) for the initial setup. Then add the plugin [babel-plugin-dynamic-import-node](https://www.npmjs.com/package/babel-plugin-dynamic-import-node), or an equivalent, to your Babel config to enable dynamic importing in Node. + +```js +beforeEach(() => { + jest.resetModules(); +}); + +test('moduleName 1', () => { + jest.doMock('../moduleName', () => { + return { + __esModule: true, + default: 'default1', + foo: 'foo1', + }; + }); + return import('../moduleName').then(moduleName => { + expect(moduleName.default).toEqual('default1'); + expect(moduleName.foo).toEqual('foo1'); + }); +}); + +test('moduleName 2', () => { + jest.doMock('../moduleName', () => { + return { + __esModule: true, + default: 'default2', + foo: 'foo2', + }; + }); + return import('../moduleName').then(moduleName => { + expect(moduleName.default).toEqual('default2'); + expect(moduleName.foo).toEqual('foo2'); + }); +}); +``` + +Returns the `jest` object for chaining. + +### `jest.dontMock(moduleName)` + +When using `babel-jest`, calls to `unmock` will automatically be hoisted to the top of the code block. Use this method if you want to explicitly avoid this behavior. + +Returns the `jest` object for chaining. + +### `jest.setMock(moduleName, moduleExports)` + +Explicitly supplies the mock object that the module system should return for the specified module. + +On occasion there are times where the automatically generated mock the module system would normally provide you isn't adequate enough for your testing needs. Normally under those circumstances you should write a [manual mock](ManualMocks.md) that is more adequate for the module in question. However, on extremely rare occasions, even a manual mock isn't suitable for your purposes and you need to build the mock yourself inside your test. + +In these rare scenarios you can use this API to manually fill the slot in the module system's mock-module registry. + +Returns the `jest` object for chaining. + +_Note It is recommended to use [`jest.mock()`](#jestmockmodulename-factory-options) instead. The `jest.mock` API's second argument is a module factory instead of the expected exported module object._ + +### `jest.requireActual(moduleName)` + +Returns the actual module instead of a mock, bypassing all checks on whether the module should receive a mock implementation or not. + +Example: + +```js +jest.mock('../myModule', () => { + // Require the original module to not be mocked... + const originalModule = jest.requireActual(moduleName); + + return { + __esModule: true, // Use it when dealing with esModules + ...originalModule, + getRandom: jest.fn().mockReturnValue(10), + }; +}); + +const getRandom = require('../myModule').getRandom; + +getRandom(); // Always returns 10 +``` + +### `jest.requireMock(moduleName)` + +Returns a mock module instead of the actual module, bypassing all checks on whether the module should be required normally or not. + +### `jest.resetModules()` + +Resets the module registry - the cache of all required modules. This is useful to isolate modules where local state might conflict between tests. + +Example: + +```js +const sum1 = require('../sum'); +jest.resetModules(); +const sum2 = require('../sum'); +sum1 === sum2; +// > false (Both sum modules are separate "instances" of the sum module.) +``` + +Example in a test: + +```js +beforeEach(() => { + jest.resetModules(); +}); + +test('works', () => { + const sum = require('../sum'); +}); + +test('works too', () => { + const sum = require('../sum'); + // sum is a different copy of the sum module from the previous test. +}); +``` + +Returns the `jest` object for chaining. + +### `jest.isolateModules(fn)` + +`jest.isolateModules(fn)` goes a step further than `jest.resetModules()` and creates a sandbox registry for the modules that are loaded inside the callback function. This is useful to isolate specific modules for every test so that local module state doesn't conflict between tests. + +```js +let myModule; +jest.isolateModules(() => { + myModule = require('myModule'); +}); + +const otherCopyOfMyModule = require('myModule'); +``` + +## Mock functions + +### `jest.fn(implementation)` + +Returns a new, unused [mock function](MockFunctionAPI.md). Optionally takes a mock implementation. + +```js +const mockFn = jest.fn(); +mockFn(); +expect(mockFn).toHaveBeenCalled(); + +// With a mock implementation: +const returnsTrue = jest.fn(() => true); +console.log(returnsTrue()); // true; +``` + +### `jest.isMockFunction(fn)` + +Determines if the given function is a mocked function. + +### `jest.spyOn(object, methodName)` + +Creates a mock function similar to `jest.fn` but also tracks calls to `object[methodName]`. Returns a Jest [mock function](MockFunctionAPI.md). + +_Note: By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `object[methodName] = jest.fn(() => customImplementation);`_ + +Example: + +```js +const video = { + play() { + return true; + }, +}; + +module.exports = video; +``` + +Example test: + +```js +const video = require('./video'); + +test('plays video', () => { + const spy = jest.spyOn(video, 'play'); + const isPlaying = video.play(); + + expect(spy).toHaveBeenCalled(); + expect(isPlaying).toBe(true); + + spy.mockRestore(); +}); +``` + +### `jest.spyOn(object, methodName, accessType?)` + +Since Jest 22.1.0+, the `jest.spyOn` method takes an optional third argument of `accessType` that can be either `'get'` or `'set'`, which proves to be useful when you want to spy on a getter or a setter, respectively. + +Example: + +```js +const video = { + // it's a getter! + get play() { + return true; + }, +}; + +module.exports = video; + +const audio = { + _volume: false, + // it's a setter! + set volume(value) { + this._volume = value; + }, + get volume() { + return this._volume; + }, +}; + +module.exports = audio; +``` + +Example test: + +```js +const video = require('./video'); + +test('plays video', () => { + const spy = jest.spyOn(video, 'play', 'get'); // we pass 'get' + const isPlaying = video.play; + + expect(spy).toHaveBeenCalled(); + expect(isPlaying).toBe(true); + + spy.mockRestore(); +}); + +const audio = require('./audio'); + +test('plays audio', () => { + const spy = jest.spyOn(audio, 'volume', 'set'); // we pass 'set' + audio.volume = 100; + + expect(spy).toHaveBeenCalled(); + expect(audio.volume).toBe(100); + + spy.mockRestore(); +}); +``` + +### `jest.clearAllMocks()` + +Clears the `mock.calls` and `mock.instances` properties of all mocks. Equivalent to calling [`.mockClear()`](MockFunctionAPI.md#mockfnmockclear) on every mocked function. + +Returns the `jest` object for chaining. + +### `jest.resetAllMocks()` + +Resets the state of all mocks. Equivalent to calling [`.mockReset()`](MockFunctionAPI.md#mockfnmockreset) on every mocked function. + +Returns the `jest` object for chaining. + +### `jest.restoreAllMocks()` + +Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them. + +## Mock timers + +### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')` + +Instructs Jest to use fake versions of the standard timer functions (`setTimeout`, `setInterval`, `clearTimeout`, `clearInterval`, `nextTick`, `setImmediate` and `clearImmediate`). + +If you pass `'modern'` as argument, [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers) will be used as implementation instead of Jest's own fake timers. This also mocks additional timers like `Date`. `'modern'` will be the default behavior in Jest 27. + +Returns the `jest` object for chaining. + +### `jest.useRealTimers()` + +Instructs Jest to use the real versions of the standard timer functions. + +Returns the `jest` object for chaining. + +### `jest.runAllTicks()` + +Exhausts the **micro**-task queue (usually interfaced in node via `process.nextTick`). + +When this API is called, all pending micro-tasks that have been queued via `process.nextTick` will be executed. Additionally, if those micro-tasks themselves schedule new micro-tasks, those will be continually exhausted until there are no more micro-tasks remaining in the queue. + +### `jest.runAllTimers()` + +Exhausts both the **macro**-task queue (i.e., all tasks queued by `setTimeout()`, `setInterval()`, and `setImmediate()`) and the **micro**-task queue (usually interfaced in node via `process.nextTick`). + +When this API is called, all pending macro-tasks and micro-tasks will be executed. If those tasks themselves schedule new tasks, those will be continually exhausted until there are no more tasks remaining in the queue. + +This is often useful for synchronously executing setTimeouts during a test in order to synchronously assert about some behavior that would only happen after the `setTimeout()` or `setInterval()` callbacks executed. See the [Timer mocks](TimerMocks.md) doc for more information. + +### `jest.runAllImmediates()` + +Exhausts all tasks queued by `setImmediate()`. + +> Note: This function is not available when using modern fake timers implementation + +### `jest.advanceTimersByTime(msToRun)` + +##### renamed in Jest **22.0.0+** + +Also under the alias: `.runTimersToTime()` + +Executes only the macro task queue (i.e. all tasks queued by `setTimeout()` or `setInterval()` and `setImmediate()`). + +When this API is called, all timers are advanced by `msToRun` milliseconds. All pending "macro-tasks" that have been queued via `setTimeout()` or `setInterval()`, and would be executed within this time frame will be executed. Additionally if those macro-tasks schedule new macro-tasks that would be executed within the same time frame, those will be executed until there are no more macro-tasks remaining in the queue, that should be run within `msToRun` milliseconds. + +### `jest.runOnlyPendingTimers()` + +Executes only the macro-tasks that are currently pending (i.e., only the tasks that have been queued by `setTimeout()` or `setInterval()` up to this point). If any of the currently pending macro-tasks schedule new macro-tasks, those new tasks will not be executed by this call. + +This is useful for scenarios such as one where the module being tested schedules a `setTimeout()` whose callback schedules another `setTimeout()` recursively (meaning the scheduling never stops). In these scenarios, it's useful to be able to run forward in time by a single step at a time. + +### `jest.advanceTimersToNextTimer(steps)` + +Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run. + +Optionally, you can provide `steps`, so it will run `steps` amount of next timeouts/intervals. + +### `jest.clearAllTimers()` + +Removes any pending timers from the timer system. + +This means, if any timers have been scheduled (but have not yet executed), they will be cleared and will never have the opportunity to execute in the future. + +### `jest.getTimerCount()` + +Returns the number of fake timers still left to run. + +### `.jest.setSystemTime()` + +Set the current system time used by fake timers. Simulates a user changing the system clock while your program is running. It affects the current time but it does not in itself cause e.g. timers to fire; they will fire exactly as they would have done without the call to `jest.setSystemTime()`. + +> Note: This function is only available when using modern fake timers implementation + +### `.jest.getRealSystemTime()` + +When mocking time, `Date.now()` will also be mocked. If you for some reason need access to the real current time, you can invoke this function. + +> Note: This function is only available when using modern fake timers implementation + +## Misc + +### `jest.setTimeout(timeout)` + +Set the default timeout interval for tests and before/after hooks in milliseconds. This only affects the test file from which this function is called. + +_Note: The default timeout interval is 5 seconds if this method is not called._ + +_Note: If you want to set the timeout for all test files, a good place to do this is in `setupFilesAfterEnv`._ + +Example: + +```js +jest.setTimeout(1000); // 1 second +``` + +### `jest.retryTimes()` + +Runs failed tests n-times until they pass or until the max number of retries is exhausted. This only works with [jest-circus](https://github.com/facebook/jest/tree/master/packages/jest-circus)! + +Example in a test: + +```js +jest.retryTimes(3); +test('will fail', () => { + expect(true).toBe(false); +}); +``` + +Returns the `jest` object for chaining. diff --git a/website/versioned_docs/version-26.0/JestPlatform.md b/website/versioned_docs/version-26.0/JestPlatform.md new file mode 100644 index 000000000000..31c04bb38430 --- /dev/null +++ b/website/versioned_docs/version-26.0/JestPlatform.md @@ -0,0 +1,175 @@ +--- +id: version-26.0-jest-platform +title: Jest Platform +original_id: jest-platform +--- + +You can cherry pick specific features of Jest and use them as standalone packages. Here's a list of the available packages: + +## jest-changed-files + +Tool for identifying modified files in a git/hg repository. Exports two functions: + +- `getChangedFilesForRoots` returns a promise that resolves to an object with the changed files and repos. +- `findRepos` returns a promise that resolves to a set of repositories contained in the specified path. + +### Example + +```javascript +const {getChangedFilesForRoots} = require('jest-changed-files'); + +// print the set of modified files since last commit in the current repo +getChangedFilesForRoots(['./'], { + lastCommit: true, +}).then(result => console.log(result.changedFiles)); +``` + +You can read more about `jest-changed-files` in the [readme file](https://github.com/facebook/jest/blob/master/packages/jest-changed-files/README.md). + +## jest-diff + +Tool for visualizing changes in data. Exports a function that compares two values of any type and returns a "pretty-printed" string illustrating the difference between the two arguments. + +### Example + +```javascript +const diff = require('jest-diff'); + +const a = {a: {b: {c: 5}}}; +const b = {a: {b: {c: 6}}}; + +const result = diff(a, b); + +// print diff +console.log(result); +``` + +## jest-docblock + +Tool for extracting and parsing the comments at the top of a JavaScript file. Exports various functions to manipulate the data inside the comment block. + +### Example + +```javascript +const {parseWithComments} = require('jest-docblock'); + +const code = ` +/** + * This is a sample + * + * @flow + */ + + console.log('Hello World!'); +`; + +const parsed = parseWithComments(code); + +// prints an object with two attributes: comments and pragmas. +console.log(parsed); +``` + +You can read more about `jest-docblock` in the [readme file](https://github.com/facebook/jest/blob/master/packages/jest-docblock/README.md). + +## jest-get-type + +Module that identifies the primitive type of any JavaScript value. Exports a function that returns a string with the type of the value passed as argument. + +### Example + +```javascript +const getType = require('jest-get-type'); + +const array = [1, 2, 3]; +const nullValue = null; +const undefinedValue = undefined; + +// prints 'array' +console.log(getType(array)); +// prints 'null' +console.log(getType(nullValue)); +// prints 'undefined' +console.log(getType(undefinedValue)); +``` + +## jest-validate + +Tool for validating configurations submitted by users. Exports a function that takes two arguments: the user's configuration and an object containing an example configuration and other options. The return value is an object with two attributes: + +- `hasDeprecationWarnings`, a boolean indicating whether the submitted configuration has deprecation warnings, +- `isValid`, a boolean indicating whether the configuration is correct or not. + +### Example + +```javascript +const {validate} = require('jest-validate'); + +const configByUser = { + transform: '/node_modules/my-custom-transform', +}; + +const result = validate(configByUser, { + comment: ' Documentation: http://custom-docs.com', + exampleConfig: {transform: '/node_modules/babel-jest'}, +}); + +console.log(result); +``` + +You can read more about `jest-validate` in the [readme file](https://github.com/facebook/jest/blob/master/packages/jest-validate/README.md). + +## jest-worker + +Module used for parallelization of tasks. Exports a class `JestWorker` that takes the path of Node.js module and lets you call the module's exported methods as if they were class methods, returning a promise that resolves when the specified method finishes its execution in a forked process. + +### Example + +```javascript +// heavy-task.js + +module.exports = { + myHeavyTask: args => { + // long running CPU intensive task. + }, +}; +``` + +```javascript +// main.js + +async function main() { + const worker = new Worker(require.resolve('./heavy-task.js')); + + // run 2 tasks in parallel with different arguments + const results = await Promise.all([ + worker.myHeavyTask({foo: 'bar'}), + worker.myHeavyTask({bar: 'foo'}), + ]); + + console.log(results); +} + +main(); +``` + +You can read more about `jest-worker` in the [readme file](https://github.com/facebook/jest/blob/master/packages/jest-worker/README.md). + +## pretty-format + +Exports a function that converts any JavaScript value into a human-readable string. Supports all built-in JavaScript types out of the box and allows extension for application-specific types via user-defined plugins. + +### Example + +```javascript +const prettyFormat = require('pretty-format'); + +const val = {object: {}}; +val.circularReference = val; +val[Symbol('foo')] = 'foo'; +val.map = new Map([['prop', 'value']]); +val.array = [-0, Infinity, NaN]; + +console.log(prettyFormat(val)); +``` + +You can read more about `pretty-format` in the [readme file](https://github.com/facebook/jest/blob/master/packages/pretty-format/README.md). diff --git a/website/versions.json b/website/versions.json index 309b51aa700a..1b6301798894 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,6 +1,6 @@ [ - "25.3", - "25.1", + "26.0", + "25.x", "24.x", "23.x", "22.x" diff --git a/yarn.lock b/yarn.lock index 3f604de1b915..8e3a6ddb5df3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,34 +3,34 @@ "@angular/common@^9.0.0": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-9.1.1.tgz#29828cbb5e1f3f81cd6aa9468e9e1d4f02c1c7e8" - integrity sha512-bS13veMs7//YqYjYJ+JI78ylaCyVcdFKZKikd5SZa6+r6fajcyvLnSKqrKypG3O1BeJ8vOG/Pq54P5gWhbR6eA== + version "9.1.4" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-9.1.4.tgz#23d7b42cd87aba634b78b8d73e12c6ebffe86043" + integrity sha512-JvCoCWVbx0tF7l/0WTi24ui/mc2SElyVSNchR4VK/FViARnkvnSBdI/Ef5QWXrsPyKU4PYBtnWWgyxRspH+FBA== "@angular/compiler@^9.0.0": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-9.1.1.tgz#c2964849cc42d483ef2a5dd06d8e91d69a8ebe12" - integrity sha512-u1IP6IzUgK6lIzrG1cxp96umXgtThyhuFn/KPoyVt7wPxZ6vVR0ZxjM7zycEcrMGzk0nf0nyOKaksJk9sTXTbg== + version "9.1.4" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-9.1.4.tgz#fe833fc3b74768bdd56b1bdd0010870f38ffaedc" + integrity sha512-B+f3lviFNEJtL9V9exSKYPSz2Ddb6dxgPzQR7GSjGikDo+fKMtC1PjNwgJooS9gavhQx30uwkEEMIPYQbM6nNA== "@angular/core@^9.0.0": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-9.1.1.tgz#0a4bb3f81e4103d141556dd5c7272f05bc78cfaa" - integrity sha512-6lDlUlePafr/392hOvvTZZl6xPHT50U6658sHUAVIr0Un4mJ2MHNHKZtO45bpn3hM4gjFcYRQ7Rpd0umW74iTA== + version "9.1.4" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-9.1.4.tgz#85f5322f42cf8add597fc6b02913e8fc3308c361" + integrity sha512-ND240vncmVD2KVe/KSQU3d/DxxoRipFg1+jFOFZGt0n0orCBHk/V1fu9iaG1sRyldL0+rCQ+fTI+1N4DTmMnxA== "@angular/forms@^9.0.0": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-9.1.1.tgz#3090829dd2989207fd9a4dbc5b44b3ff9b2fe948" - integrity sha512-NX+LuK8JFisiq3uHCOK6YoN/yIb2R9Ye5mwiOPkuZA3lZLKCnUXqCHZbM8VHy/WdjIxxeUaFMJc38yV8RVoabg== + version "9.1.4" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-9.1.4.tgz#7cb75b5731bd6cbcf4a45b7b2cc68b3581de8cc1" + integrity sha512-Njt+pMLfPBchL0/ayIjJqXL6ZfM4Ccvf7KO1wS1HMzh3QlmfNa0JSgc4pfrbRJAMN9g7V/FYLyKejs1bJZkenA== "@angular/platform-browser-dynamic@^9.0.0": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-9.1.1.tgz#aaaa31a8ddf6e810755644180703118c792b8ca0" - integrity sha512-kEox5UOwkRLjGKXLh5o5SYopoAylpKgrXtRrKRKTCMmZTpYSe1bLlXMjpwMAMZ9ZFSTvWp9iX94aT5bJDpLrRQ== + version "9.1.4" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-9.1.4.tgz#bf1cde9156bd29eeeef932b683b0c993614f75d5" + integrity sha512-YtVbnxyS6FU7xNpA6A95tmSfrB8+WC7OH3mbP8M9NaGk0OYz8B/JOe1HByP4JRpEGCvBtXdJ2NSW/MpLIT8SiQ== "@angular/platform-browser@^9.0.0": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-9.1.1.tgz#bb5a98a3a33a307436684c4c7e2c448c786ae466" - integrity sha512-tjALKhdAWPErj0euIIdvx/31AHEZ7is7ADsMu+nYn2NY2gcPUuiqq3RCUJVxBYJ2Cclq1nlF0i2rEDKh7TrBKg== + version "9.1.4" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-9.1.4.tgz#c4fe868f12a6593702967a957a6bc8aa50c34f3b" + integrity sha512-mBCHfTl+5tQfaUiGlDujP7mFBzovFc54Zi2kcCE8DSdSSVQ2TPBo6hXa6y2cL3hJPFZzQ7mC4ORFrsGADhHn/w== "@babel/code-frame@7.5.5": version "7.5.5" @@ -46,28 +46,28 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/compat-data@^7.8.6", "@babel/compat-data@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.9.0.tgz#04815556fc90b0c174abd2c0c1bb966faa036a6c" - integrity sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g== +"@babel/compat-data@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.9.6.tgz#3f604c40e420131affe6f2c8052e9a275ae2049b" + integrity sha512-5QPTrNen2bm7RBc7dsOmcA5hbrS4O2Vhmk5XOL4zWW/zD/hV0iinpefDlkm+tBBy8kDtFaaeEvmAqt+nURAV2g== dependencies: - browserslist "^4.9.1" + browserslist "^4.11.1" invariant "^2.2.4" semver "^5.5.0" "@babel/core@*", "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.3.4", "@babel/core@^7.7.4", "@babel/core@^7.7.5": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e" - integrity sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w== + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.6.tgz#d9aa1f580abf3b2286ef40b6904d390904c63376" + integrity sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.9.0" + "@babel/generator" "^7.9.6" "@babel/helper-module-transforms" "^7.9.0" - "@babel/helpers" "^7.9.0" - "@babel/parser" "^7.9.0" + "@babel/helpers" "^7.9.6" + "@babel/parser" "^7.9.6" "@babel/template" "^7.8.6" - "@babel/traverse" "^7.9.0" - "@babel/types" "^7.9.0" + "@babel/traverse" "^7.9.6" + "@babel/types" "^7.9.6" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" @@ -77,12 +77,12 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.5.0", "@babel/generator@^7.9.0", "@babel/generator@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" - integrity sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ== +"@babel/generator@^7.5.0", "@babel/generator@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.6.tgz#5408c82ac5de98cda0d77d8124e99fa1f2170a43" + integrity sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ== dependencies: - "@babel/types" "^7.9.5" + "@babel/types" "^7.9.6" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" @@ -119,27 +119,27 @@ "@babel/helper-annotate-as-pure" "^7.8.3" "@babel/types" "^7.9.0" -"@babel/helper-compilation-targets@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz#dac1eea159c0e4bd46e309b5a1b04a66b53c1dde" - integrity sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw== +"@babel/helper-compilation-targets@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.9.6.tgz#1e05b7ccc9d38d2f8b40b458b380a04dcfadd38a" + integrity sha512-x2Nvu0igO0ejXzx09B/1fGBxY9NXQlBW2kZsSxCJft+KHN8t9XWzIvFxtPHnBOAXpVsdxZKZFbRUC8TsNKajMw== dependencies: - "@babel/compat-data" "^7.8.6" - browserslist "^4.9.1" + "@babel/compat-data" "^7.9.6" + browserslist "^4.11.1" invariant "^2.2.4" levenary "^1.1.1" semver "^5.5.0" -"@babel/helper-create-class-features-plugin@^7.8.3": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.5.tgz#79753d44017806b481017f24b02fd4113c7106ea" - integrity sha512-IipaxGaQmW4TfWoXdqjY0TzoXQ1HRS0kPpEgvjosb3u7Uedcq297xFqDQiCcQtRRwzIMif+N1MLVI8C5a4/PAA== +"@babel/helper-create-class-features-plugin@^7.8.3", "@babel/helper-create-class-features-plugin@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.6.tgz#965c8b0a9f051801fd9d3b372ca0ccf200a90897" + integrity sha512-6N9IeuyHvMBRyjNYOMJHrhwtu4WJMrYf8hVbEHD3pbbbmNOk1kmXSQs7bA4dYDUaIx4ZEzdnvo6NwC3WHd/Qow== dependencies: "@babel/helper-function-name" "^7.9.5" "@babel/helper-member-expression-to-functions" "^7.8.3" "@babel/helper-optimise-call-expression" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-replace-supers" "^7.8.6" + "@babel/helper-replace-supers" "^7.9.6" "@babel/helper-split-export-declaration" "^7.8.3" "@babel/helper-create-regexp-features-plugin@^7.8.3", "@babel/helper-create-regexp-features-plugin@^7.8.8": @@ -248,15 +248,15 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helper-replace-supers@^7.8.3", "@babel/helper-replace-supers@^7.8.6": - version "7.8.6" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz#5ada744fd5ad73203bf1d67459a27dcba67effc8" - integrity sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA== +"@babel/helper-replace-supers@^7.8.3", "@babel/helper-replace-supers@^7.8.6", "@babel/helper-replace-supers@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz#03149d7e6a5586ab6764996cd31d6981a17e1444" + integrity sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA== dependencies: "@babel/helper-member-expression-to-functions" "^7.8.3" "@babel/helper-optimise-call-expression" "^7.8.3" - "@babel/traverse" "^7.8.6" - "@babel/types" "^7.8.6" + "@babel/traverse" "^7.9.6" + "@babel/types" "^7.9.6" "@babel/helper-simple-access@^7.8.3": version "7.8.3" @@ -288,14 +288,14 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helpers@^7.9.0": - version "7.9.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.9.2.tgz#b42a81a811f1e7313b88cba8adc66b3d9ae6c09f" - integrity sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA== +"@babel/helpers@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.9.6.tgz#092c774743471d0bb6c7de3ad465ab3d3486d580" + integrity sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw== dependencies: "@babel/template" "^7.8.3" - "@babel/traverse" "^7.9.0" - "@babel/types" "^7.9.0" + "@babel/traverse" "^7.9.6" + "@babel/types" "^7.9.6" "@babel/highlight@^7.0.0", "@babel/highlight@^7.8.3": version "7.9.0" @@ -306,10 +306,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.7.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": - version "7.9.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" - integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.7.0", "@babel/parser@^7.8.6", "@babel/parser@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.6.tgz#3b1bbb30dabe600cd72db58720998376ff653bc7" + integrity sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q== "@babel/plugin-external-helpers@^7.0.0": version "7.8.3" @@ -384,10 +384,10 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-numeric-separator" "^7.8.3" -"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.7.4", "@babel/plugin-proposal-object-rest-spread@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz#3fd65911306d8746014ec0d0cf78f0e39a149116" - integrity sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg== +"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.7.4", "@babel/plugin-proposal-object-rest-spread@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz#7a093586fcb18b08266eb1a7177da671ac575b63" + integrity sha512-Ga6/fhGqA9Hj+y6whNpPv8psyaK5xzrQwSPsGPloVkvmH+PqW1ixdnfJ9uIO06OjQNYol3PMnfmJ8vfZtkzF+A== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" @@ -655,34 +655,34 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-modules-amd@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz#19755ee721912cf5bb04c07d50280af3484efef4" - integrity sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q== +"@babel/plugin-transform-modules-amd@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.6.tgz#8539ec42c153d12ea3836e0e3ac30d5aae7b258e" + integrity sha512-zoT0kgC3EixAyIAU+9vfaUVKTv9IxBDSabgHoUCBP6FqEJ+iNiN7ip7NBKcYqbfUDfuC2mFCbM7vbu4qJgOnDw== dependencies: "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.1.0", "@babel/plugin-transform-modules-commonjs@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz#e3e72f4cbc9b4a260e30be0ea59bdf5a39748940" - integrity sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g== +"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.1.0", "@babel/plugin-transform-modules-commonjs@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.6.tgz#64b7474a4279ee588cacd1906695ca721687c277" + integrity sha512-7H25fSlLcn+iYimmsNe3uK1at79IE6SKW9q0/QeEHTMC9MdOZ+4bA+T1VFB5fgOqBWoqlifXRzYD0JPdmIrgSQ== dependencies: "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-simple-access" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz#e9fd46a296fc91e009b64e07ddaa86d6f0edeb90" - integrity sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ== +"@babel/plugin-transform-modules-systemjs@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.6.tgz#207f1461c78a231d5337a92140e52422510d81a4" + integrity sha512-NW5XQuW3N2tTHim8e1b7qGy7s0kZ2OH3m5octc49K1SdAKGxYxeIx7hiIz05kS1R2R+hOWcsr1eYwcGhrdHsrg== dependencies: "@babel/helper-hoist-variables" "^7.8.3" "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" + babel-plugin-dynamic-import-node "^2.3.3" "@babel/plugin-transform-modules-umd@^7.9.0": version "7.9.0" @@ -793,9 +793,9 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-runtime@^7.0.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.0.tgz#45468c0ae74cc13204e1d3b1f4ce6ee83258af0b" - integrity sha512-pUu9VSf3kI1OqbWINQ7MaugnitRss1z533436waNXp+0N3ur3zfut37sXiQMxkuCF4VUjwZucen/quskCh7NHw== + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.6.tgz#3ba804438ad0d880a17bca5eaa0cdf1edeedb2fd" + integrity sha512-qcmiECD0mYOjOIt8YHNsAP1SxPooC/rDmfmiSK9BNY72EitdSc7l44WTEklaWuFtbOEBjNhWWyph/kOImbNJ4w== dependencies: "@babel/helper-module-imports" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" @@ -847,11 +847,11 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-typescript@^7.5.0", "@babel/plugin-transform-typescript@^7.9.0": - version "7.9.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.4.tgz#4bb4dde4f10bbf2d787fce9707fb09b483e33359" - integrity sha512-yeWeUkKx2auDbSxRe8MusAG+n4m9BFY/v+lPjmQDgOFX5qnySkUY5oXzkp6FwPdsYqnKay6lorXYdC0n3bZO7w== + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.6.tgz#2248971416a506fc78278fc0c0ea3179224af1e9" + integrity sha512-8OvsRdvpt3Iesf2qsAn+YdlwAJD7zJ+vhFZmDCa4b8dTp7MmHtKk5FF2mCsGxjZwuwsy/yIIay/nLmxST1ctVQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.8.3" + "@babel/helper-create-class-features-plugin" "^7.9.6" "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-typescript" "^7.8.3" @@ -872,12 +872,12 @@ regenerator-runtime "^0.13.4" "@babel/preset-env@*", "@babel/preset-env@^7.1.0", "@babel/preset-env@^7.7.4": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.9.5.tgz#8ddc76039bc45b774b19e2fc548f6807d8a8919f" - integrity sha512-eWGYeADTlPJH+wq1F0wNfPbVS1w1wtmMJiYk55Td5Yu28AsdR9AsC97sZ0Qq8fHqQuslVSIYSGJMcblr345GfQ== + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.9.6.tgz#df063b276c6455ec6fcfc6e53aacc38da9b0aea6" + integrity sha512-0gQJ9RTzO0heXOhzftog+a/WyOuqMrAIugVYxMYf83gh1CQaQDjMtsOpqOwXyDL/5JcWsrCm8l4ju8QC97O7EQ== dependencies: - "@babel/compat-data" "^7.9.0" - "@babel/helper-compilation-targets" "^7.8.7" + "@babel/compat-data" "^7.9.6" + "@babel/helper-compilation-targets" "^7.9.6" "@babel/helper-module-imports" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-proposal-async-generator-functions" "^7.8.3" @@ -885,7 +885,7 @@ "@babel/plugin-proposal-json-strings" "^7.8.3" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-proposal-numeric-separator" "^7.8.3" - "@babel/plugin-proposal-object-rest-spread" "^7.9.5" + "@babel/plugin-proposal-object-rest-spread" "^7.9.6" "@babel/plugin-proposal-optional-catch-binding" "^7.8.3" "@babel/plugin-proposal-optional-chaining" "^7.9.0" "@babel/plugin-proposal-unicode-property-regex" "^7.8.3" @@ -912,9 +912,9 @@ "@babel/plugin-transform-function-name" "^7.8.3" "@babel/plugin-transform-literals" "^7.8.3" "@babel/plugin-transform-member-expression-literals" "^7.8.3" - "@babel/plugin-transform-modules-amd" "^7.9.0" - "@babel/plugin-transform-modules-commonjs" "^7.9.0" - "@babel/plugin-transform-modules-systemjs" "^7.9.0" + "@babel/plugin-transform-modules-amd" "^7.9.6" + "@babel/plugin-transform-modules-commonjs" "^7.9.6" + "@babel/plugin-transform-modules-systemjs" "^7.9.6" "@babel/plugin-transform-modules-umd" "^7.9.0" "@babel/plugin-transform-named-capturing-groups-regex" "^7.8.3" "@babel/plugin-transform-new-target" "^7.8.3" @@ -930,8 +930,8 @@ "@babel/plugin-transform-typeof-symbol" "^7.8.4" "@babel/plugin-transform-unicode-regex" "^7.8.3" "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.9.5" - browserslist "^4.9.1" + "@babel/types" "^7.9.6" + browserslist "^4.11.1" core-js-compat "^3.6.2" invariant "^2.2.2" levenary "^1.1.1" @@ -980,21 +980,21 @@ source-map-support "^0.5.16" "@babel/runtime-corejs3@^7.8.3": - version "7.9.2" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz#26fe4aa77e9f1ecef9b776559bbb8e84d34284b7" - integrity sha512-HHxmgxbIzOfFlZ+tdeRKtaxWOMUoCG5Mu3wKeUmOxjYrwb3AAHgnmtCUbPPK11/raIWLIBK250t8E2BPO0p7jA== + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.9.6.tgz#67aded13fffbbc2cb93247388cf84d77a4be9a71" + integrity sha512-6toWAfaALQjt3KMZQc6fABqZwUDDuWzz+cAfPhqyEnzxvdWOAkjwPNxgF8xlmo7OWLsSjaKjsskpKHRLaMArOA== dependencies: core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" "@babel/runtime@^7.0.0", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4": - version "7.9.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.2.tgz#d90df0583a3a252f09aaa619665367bae518db06" - integrity sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q== + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.6.tgz#a9102eb5cadedf3f31d08a9ecf294af7827ea29f" + integrity sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.0.0", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": +"@babel/template@^7.0.0", "@babel/template@^7.3.3", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== @@ -1003,25 +1003,25 @@ "@babel/parser" "^7.8.6" "@babel/types" "^7.8.6" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.3.4", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.6", "@babel/traverse@^7.9.0": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" - integrity sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.3.4", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.3", "@babel/traverse@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.6.tgz#5540d7577697bf619cc57b92aa0f1c231a94f442" + integrity sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.9.5" + "@babel/generator" "^7.9.6" "@babel/helper-function-name" "^7.9.5" "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.9.0" - "@babel/types" "^7.9.5" + "@babel/parser" "^7.9.6" + "@babel/types" "^7.9.6" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" - integrity sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5", "@babel/types@^7.9.6": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.6.tgz#2c5502b427251e9de1bd2dff95add646d95cc9f7" + integrity sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA== dependencies: "@babel/helper-validator-identifier" "^7.9.5" lodash "^4.17.13" @@ -1170,6 +1170,17 @@ chalk "^2.0.1" slash "^2.0.0" +"@jest/console@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.5.0.tgz#770800799d510f37329c508a9edd0b7b447d9abb" + integrity sha512-T48kZa6MK1Y6k4b89sexwmSF4YLeZS/Udqg3Jj3jG/cHH+N/sLFCEoXEDMOKugJQ9FxPN1osxIknvKkxt6MKyw== + dependencies: + "@jest/types" "^25.5.0" + chalk "^3.0.0" + jest-message-util "^25.5.0" + jest-util "^25.5.0" + slash "^3.0.0" + "@jest/fake-timers@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.9.0.tgz#ba3e6bf0eecd09a636049896434d306636540c93" @@ -1197,6 +1208,16 @@ "@jest/types" "^24.9.0" "@types/istanbul-lib-coverage" "^2.0.0" +"@jest/test-result@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.5.0.tgz#139a043230cdeffe9ba2d8341b27f2efc77ce87c" + integrity sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A== + dependencies: + "@jest/console" "^25.5.0" + "@jest/types" "^25.5.0" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + "@jest/types@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" @@ -1206,6 +1227,16 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" +"@jest/types@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.5.0.tgz#4d6a4793f7b9599fc3680877b856a97dbccf2a9d" + integrity sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^15.0.0" + chalk "^3.0.0" + "@lerna/add@3.20.0": version "3.20.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.20.0.tgz#bea7edf36fc93fb72ec34cb9ba854c48d4abf309" @@ -1932,12 +1963,12 @@ dependencies: "@octokit/types" "^2.0.0" -"@octokit/endpoint@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.0.tgz#4c7acd79ab72df78732a7d63b09be53ec5a2230b" - integrity sha512-3nx+MEYoZeD0uJ+7F/gvELLvQJzLXhep2Az0bBSXagbApDvDW0LWwpnAIY/hb0Jwe17A0fJdz0O12dPh05cj7A== +"@octokit/endpoint@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.1.tgz#16d5c0e7a83e3a644d1ddbe8cded6c3d038d31d7" + integrity sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A== dependencies: - "@octokit/types" "^2.0.0" + "@octokit/types" "^2.11.1" is-plain-object "^3.0.0" universal-user-agent "^5.0.0" @@ -1985,13 +2016,13 @@ once "^1.4.0" "@octokit/request@^5.2.0": - version "5.3.4" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.3.4.tgz#fbc950bf785d59da3b0399fc6d042c8cf52e2905" - integrity sha512-qyj8G8BxQyXjt9Xu6NvfvOr1E0l35lsXtwm3SopsYg/JWXjlsnwqLc8rsD2OLguEL/JjLfBvrXr4az7z8Lch2A== + version "5.4.2" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.2.tgz#74f8e5bbd39dc738a1b127629791f8ad1b3193ee" + integrity sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw== dependencies: - "@octokit/endpoint" "^6.0.0" + "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.0.0" - "@octokit/types" "^2.0.0" + "@octokit/types" "^2.11.1" deprecation "^2.0.0" is-plain-object "^3.0.0" node-fetch "^2.3.0" @@ -2020,26 +2051,26 @@ once "^1.4.0" universal-user-agent "^4.0.0" -"@octokit/types@^2.0.0", "@octokit/types@^2.0.1": - version "2.8.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-2.8.1.tgz#935ba46c3abb745e913b1110b87f1ca75f2a3792" - integrity sha512-1fzZcYTvPkrJsS9MX7oTMun447Q/tJo5XOtXQsKqmbTbwQV1f+R58pDmjDbzeFbQ7KzMJaDN7Sq4bCh/WHmgLg== +"@octokit/types@^2.0.0", "@octokit/types@^2.0.1", "@octokit/types@^2.11.1": + version "2.12.2" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-2.12.2.tgz#e9fbffa294adb54140946d436da9f73bc94b169c" + integrity sha512-1GHLI/Jll3j6F0GbYyZPFTcHZMGjAiRfkTEoRUyaVVk2IWbDdwEiClAJvXzfXCDayuGSNCqAUH8lpjZtqW9GDw== dependencies: "@types/node" ">= 8" -"@react-native-community/cli-debugger-ui@^4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-4.7.0.tgz#4a8689f56b99378b24bbbf0ff6a89869d667f013" - integrity sha512-Z/xJ08Wz3J2fKDPrwxtQ44XSHnWsF6dnT0H2AANw63bWjnrR0E3sh8Nk8/oO+j9R7LH8S0+NHJdlniXYtL/bNg== +"@react-native-community/cli-debugger-ui@^4.8.0": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-4.8.0.tgz#9a6419b29be69422e0056bbb1874775750351d22" + integrity sha512-Eq9lHINDXiBAwmFRCMN8jeKk6FTDnTxAfITkjPUNNTj7q3K+fH/oyOMJjxbIZbryIJY6g+g/ln6vsS2WzISNYQ== dependencies: serve-static "^1.13.1" "@react-native-community/cli-platform-android@^4.2.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-4.7.0.tgz#aace6b8004b8d3aae40d6affaad1c472e0310a25" - integrity sha512-Lb6D0ipmFwYLJeQy5/NI4uJpeSHw85rd84C40wwpoUfsCgZhA93WUJdFkuQEIDkfTqs5Yqgl+/szhIZdnIXPxw== + version "4.8.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-4.8.0.tgz#f495b227e82c75c676dfa53c0dac33bf438b50b8" + integrity sha512-sYa4K0t0VL99j+bloHTL2BwXFJpHCdPN4SRTm9/wfxuWDkiPFvo9TaX0adh7GbUoKalLq2k0z+iEpHMN3HtZiw== dependencies: - "@react-native-community/cli-tools" "^4.7.0" + "@react-native-community/cli-tools" "^4.8.0" chalk "^3.0.0" execa "^1.0.0" fs-extra "^8.1.0" @@ -2051,11 +2082,11 @@ xmldoc "^1.1.2" "@react-native-community/cli-platform-ios@^4.2.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-4.7.0.tgz#471dcdbd2645c5650f16c0eddcca50e47ca78398" - integrity sha512-XqnxP6H6+PG/wn4+Pwas5jaTSr5n7x6v8trkPY8iO37b8sq7tJLNYznaBMROF43i0NqO48JdhquYOqnDN8FdBA== + version "4.8.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-4.8.0.tgz#bfa20f398837256ee943192930d1f94fa92f521d" + integrity sha512-UZyc/bwG23HKsvHVmDrlZulIRMK8Jl7njN9oCO0pohOYxRJIwueRP7A8IPCwVVohmSEuNmhCWpMIIxTAo7zzwg== dependencies: - "@react-native-community/cli-tools" "^4.7.0" + "@react-native-community/cli-tools" "^4.8.0" chalk "^3.0.0" glob "^7.1.3" js-yaml "^3.13.1" @@ -2063,30 +2094,32 @@ plist "^3.0.1" xcode "^2.0.0" -"@react-native-community/cli-tools@^4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-4.7.0.tgz#83d49277e7f56fef87bdfd0ba55d2cfa20190689" - integrity sha512-llNWJEWXhGMsaHLWoieraPeWuva3kRsIEPi8oRVTybyz82JjR71mN0OFs41o1OnAR6+TR9d5cJPN+mIOESugEA== +"@react-native-community/cli-tools@^4.8.0": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-4.8.0.tgz#144a029c741c2cf40a7f9c059819ce9a69e7f1e3" + integrity sha512-voXGruhYyyhCbEYM2uZ54dMZcBgXFFcQxVK3nLwJDG9nSQGObZInj9Zf76ix5qGnvKKGWIGUcbmRhyLpAzTXuQ== dependencies: chalk "^3.0.0" lodash "^4.17.15" mime "^2.4.1" node-fetch "^2.6.0" + open "^6.2.0" + shell-quote "1.6.1" -"@react-native-community/cli-types@^4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-types/-/cli-types-4.7.0.tgz#871905753f8ff83cf10c48e8df3fdd63cd7667a0" - integrity sha512-Pw05Rsh/ENFs/Utv1SVRFfdMAn+W9yy1AOhyIKB36JX0Xw00sIZQDyZVsVfmaLSOpRpJ/qUdKWXB/WYV4XYELw== +"@react-native-community/cli-types@^4.8.0": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-types/-/cli-types-4.8.0.tgz#d929f0d47ecdc69027de02a89d17f0ece9ee3ca2" + integrity sha512-gkjQdmzskQJdddVNRBATa7rWMbamD2j4B7w9shbg20tIBYoh/tgHdkgiLqZQSfBKa8HqrAkeCJTYaT1oV4oReQ== "@react-native-community/cli@^4.2.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.7.0.tgz#be692631356d14fd1ffe23f25b479dca9e8e7c95" - integrity sha512-DbpxcPC7lFCJ112dPXL4DBKh5TfH0QK2OTG7uEGjfsApT4c01Lae6OMTNSssXgXTcNJApqIT5a6GXK2vSE0CEQ== + version "4.8.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.8.0.tgz#b9e3916ceb0fe6bcbc2943fea2caa0ca3739d080" + integrity sha512-z4qHfxtoTxKhQ0V9B02a82IxBkEBH5FfKnaJn9WL5Tf4SmE91ER8ZNVEWNr97S4TCFVYDrpM7iKnrYpNi/ciYQ== dependencies: "@hapi/joi" "^15.0.3" - "@react-native-community/cli-debugger-ui" "^4.7.0" - "@react-native-community/cli-tools" "^4.7.0" - "@react-native-community/cli-types" "^4.7.0" + "@react-native-community/cli-debugger-ui" "^4.8.0" + "@react-native-community/cli-tools" "^4.8.0" + "@react-native-community/cli-types" "^4.8.0" chalk "^3.0.0" command-exists "^1.2.8" commander "^2.19.0" @@ -2139,6 +2172,13 @@ dependencies: type-detect "4.0.8" +"@sinonjs/fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" + integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@testing-library/dom@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-6.0.0.tgz#34e28e69e49bd6347fc64a5dde4c4f9aabbd17d3" @@ -2160,9 +2200,9 @@ "@types/react-dom" "^16.8.5" "@tootallnate/once@1": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.0.0.tgz#9c13c2574c92d4503b005feca8f2e16cc1611506" - integrity sha512-KYyTT/T6ALPkIRd2Ge080X/BsXvy9O0hcWTtMWkPvwAwF99+vn6Dv4GzrFT/Nn1LePr+FFDbRXXlqmsy9lw2zA== + version "1.1.2" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" + integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/anymatch@^1.3.1": version "1.3.1" @@ -2206,9 +2246,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.0.10" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.10.tgz#d9a99f017317d9b3d1abc2ced45d3bca68df0daf" - integrity sha512-74fNdUGrWsgIB/V9kTO5FGHPWYY6Eqn+3Z7L6Hc4e/BxjYV7puvBqp5HwsVYYfLm6iURYBNCx4Ut37OF9yitCw== + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.11.tgz#1ae3010e8bf8851d324878b42acec71986486d18" + integrity sha512-ddHK5icION5U6q11+tV2f9Mo6CZVuT8GJKld2q9LqHSZbvLbH34Kcu2yFGckZut453+eQU6btIA3RihmnRgI+Q== dependencies: "@babel/types" "^7.3.0" @@ -2217,17 +2257,10 @@ resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" integrity sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw== -"@types/browser-resolve@^1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@types/browser-resolve/-/browser-resolve-1.11.0.tgz#28c427182a6e340b3d7082b62da8128c562f04d6" - integrity sha512-fI2q5j/5w2TuO+lIGj7bMcvOQQCo5Eq71OLiWttohpp4xW6xhA9ltN2ielMSvl5ochAIY0Z3E8LtVRMIGLYy2w== - dependencies: - "@types/resolve" "*" - "@types/cheerio@^0.22.8": - version "0.22.17" - resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.17.tgz#e54f71c3135f71ebc16c8dc62edad533872c9e72" - integrity sha512-izlm+hbqWN9csuB9GSMfCnAyd3/57XZi3rfz1B0C4QBGVMp+9xQ7+9KYnep+ySfUrCWql4lGzkLf0XmprXcz9g== + version "0.22.18" + resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.18.tgz#19018dceae691509901e339d63edf1e935978fe6" + integrity sha512-Fq7R3fINAPSdUEhOyjG4iVxgHrOnqDJbY0/BUuiN0pvD/rfmZWekVZnv+vcs8TtpA2XF50uv50LaE4EnpEL/Hw== dependencies: "@types/node" "*" @@ -2263,13 +2296,6 @@ resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== -"@types/decompress@^4.2.3": - version "4.2.3" - resolved "https://registry.yarnpkg.com/@types/decompress/-/decompress-4.2.3.tgz#98eed48af80001038aa05690b2094915f296fe65" - integrity sha512-W24e3Ycz1UZPgr1ZEDHlK4XnvOr+CpJH3qNsFeqXwwlW/9END9gxn3oJSsp7gYdiQxrXUHwUUd3xuzVz37MrZQ== - dependencies: - "@types/node" "*" - "@types/dedent@0.7.0", "@types/dedent@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@types/dedent/-/dedent-0.7.0.tgz#155f339ca404e6dd90b9ce46a3f78fd69ca9b050" @@ -2304,12 +2330,12 @@ dependencies: "@types/events" "*" -"@types/find-cache-dir@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/find-cache-dir/-/find-cache-dir-2.0.1.tgz#7d44d34f6fcde70989517cb4f66042a9bf83f5e3" - integrity sha512-L+8XrNQEa8EL8C9rwWxbC2R+K7tWVg+Ib5zTp0GmFajjUvTBGDqaY0WAdDBGSXdO0eEG3O0FCjdIHNfjyluF1Q== +"@types/find-cache-dir@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@types/find-cache-dir/-/find-cache-dir-3.2.0.tgz#eaaf331699dccf52c47926e4d4f8f3ed8db33f3c" + integrity sha512-+JeT9qb2Jwzw72WdjU+TSvD5O1QRPWCeRpDJV+guiIq+2hwR0DFGw+nZNbTFjMIVe6Bf4GgAKeB/6Ytx6+MbeQ== -"@types/find-package-json@^1.1.0": +"@types/find-package-json@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/find-package-json/-/find-package-json-1.1.1.tgz#c0d296ac74fe3309ed0fe75a9c3edb42a776d30c" integrity sha512-XMCocYkg6VUpkbOQMKa3M5cgc3MvU/LJKQwd3VUJrWZbLr2ARUggupsCAF8DxjEEIuSO6HlnH+vl+XV4bgVeEQ== @@ -2332,7 +2358,7 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/graceful-fs@^4.1.2": +"@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.3": version "4.1.3" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f" integrity sha512-AiHRaEB50LQg0pZmm659vNBb9f4SJ0qrAnteuzhSeAUcJKxoYgEnprg/83kppCnc2zvtCKbdZry1a5pVY3lOTQ== @@ -2368,9 +2394,9 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-source-maps@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#d67b612f453baf7abda33a9baf1cb072189ad909" - integrity sha512-pwtxTGrYUe4T/J990fuUk49oJ/MEa2vyugpCnX4n//Owak1lK2vusySEKtolJevFpDuO761Ja+e6PZbxczfn7A== + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#8acb1f6230bf9d732e9fc30590e5ccaabbefec7b" + integrity sha512-WH6e5naLXI3vB2Px3whNeYxzDgm6S6sk3Ht8e3/BiWwEnzZi72wja3bWzWwcgbFTFp8hBLB7NT2p3lNJgxCxvA== dependencies: "@types/istanbul-lib-coverage" "*" source-map "^0.6.1" @@ -2388,14 +2414,14 @@ resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.2.tgz#a10ad017ee020b2dfa97655323dbf1f38f14f588" integrity sha512-YCGS1XGfAnDLUy8IL7iZf+Tnl0jhnaWUhrx8H/WyaDnjsu9dQBO8jiQqgJi/4BEryY6gvaqf1OvB1B2BvsW4dg== -"@types/jsdom@^12.2.4": - version "12.2.4" - resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-12.2.4.tgz#845cd4d43f95b8406d9b724ec30c03edadcd9528" - integrity sha512-q+De3S/Ri6U9uPx89YA1XuC+QIBgndIfvBaaJG0pRT8Oqa75k4Mr7G9CRZjIvlbLGIukO/31DFGFJYlQBmXf/A== +"@types/jsdom@^16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.1.tgz#9e6eee6a578f74eed5997558ab430dbc11aac753" + integrity sha512-KCEq427OsWfpX7FRyEMb3i2XIuz8Pt3XPls4nmX0iMTDJWsHD4Kzoa3v4Uv9c9IDf11ALeHUtPcyAjTz/HV03Q== dependencies: "@types/node" "*" + "@types/parse5" "*" "@types/tough-cookie" "*" - parse5 "^4.0.0" "@types/json-schema@^7.0.3": version "7.0.4" @@ -2407,12 +2433,7 @@ resolved "https://registry.yarnpkg.com/@types/lockfile/-/lockfile-1.0.1.tgz#434a3455e89843312f01976e010c60f1bcbd56f7" integrity sha512-65WZedEm4AnOsBDdsapJJG42MhROu3n4aSSiu87JXF/pSdlubxZxp3S1yz3kTfkJ2KBPud4CpjoHVAptOm9Zmw== -"@types/lolex@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/lolex/-/lolex-5.1.0.tgz#11b4c4756c007306d0feeaf2f08f88350c635d2b" - integrity sha512-hCQ2dOEQUw1LwofdIpMMGGqENd5p5ANzvcTe1nXTjcQL84r7tcLXFJlBgi0Ggz0f7BLmE2epf0C5Q07iq2gV0g== - -"@types/md5-file@^4.0.0": +"@types/md5-file@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/md5-file/-/md5-file-4.0.1.tgz#5e6cfb7949dc375049b8f6fd8f91adacfc176c63" integrity sha512-uK6vlo/LJp6iNWinpSzZwMe8Auzs0UYxesm7OGfQS3oz6PJciHtrKcqVOGk4wjYKawrl234vwNWvHyXH1ZzRyQ== @@ -2436,10 +2457,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/mkdirp@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" - integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== +"@types/mkdirp@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-1.0.0.tgz#16ce0eabe4a9a3afe64557ad0ee6886ec3d32927" + integrity sha512-ONFY9//bCEr3DWKON3iDv/Q8LXnhaYYaNDeFSN0AtO5o4sLf9F0pstJKKKjQhXE0kJEeHs8eR6SAsROhhc2Csw== dependencies: "@types/node" "*" @@ -2456,24 +2477,29 @@ "@types/node" "*" "@types/node@*", "@types/node@>= 8": - version "13.11.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.11.1.tgz#49a2a83df9d26daacead30d0ccc8762b128d53c7" - integrity sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g== + version "13.13.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.4.tgz#1581d6c16e3d4803eb079c87d4ac893ee7501c2c" + integrity sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA== "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/prettier@^1.19.0": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" - integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== +"@types/parse5@*": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.2.tgz#a877a4658f8238c8266faef300ae41c84d72ec8a" + integrity sha512-BOl+6KDs4ItndUWUFchy3aEqGdHhw0BC4Uu+qoDonN/f0rbUnJbm71Ulj8Tt9jLFRaAxPLKvdS1bBLfx1qXR9g== + +"@types/prettier@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.0.0.tgz#dc85454b953178cc6043df5208b9e949b54a3bc4" + integrity sha512-/rM+sWiuOZ5dvuVzV37sUuklsbg+JPOP8d+nNFlo2ZtfpzPiPvh1/gc8liWOLBqe+sR+ZM7guPaIcTt6UZTo7Q== "@types/prompts@^2.0.1": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@types/prompts/-/prompts-2.0.5.tgz#b3cb5cd2c69a0da11b21ea6618bffdab6091336c" - integrity sha512-07dV9H+uEmGjtudYst7UlRnctQfd/22zJ2/k1ykZR4Kx/n42hC314v1NCxvaesZebvJJ8i5AVMtBaMbSIR3oBw== + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/prompts/-/prompts-2.0.6.tgz#269331ab7236ae811745f6c729b991b24511864e" + integrity sha512-CLphLAE33GBC1dX4+rKr/kcS778zBHjLkagC//Kh4gI9McfyGscUMowltN5LLCRuj28PGLZCdVaZNpIMQYH7og== "@types/prop-types@*": version "15.7.3" @@ -2486,9 +2512,9 @@ integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw== "@types/react-dom@^16.8.5": - version "16.9.6" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.6.tgz#9e7f83d90566521cc2083be2277c6712dcaf754c" - integrity sha512-S6ihtlPMDotrlCJE9ST1fRmYrQNNwfgL61UB4I1W7M6kPulUKx9fXAleW5zpdIjUQ4fTaaog8uERezjsGUj9HQ== + version "16.9.7" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.7.tgz#60844d48ce252d7b2dccf0c7bb937130e27c0cd2" + integrity sha512-GHTYhM8/OwUCf254WO5xqR/aqD3gC9kSTLpopWGpQLpnw23jk44RvMHsyUSEplvRJZdHxhJGMMLF0kCPYHPhQA== dependencies: "@types/react" "*" @@ -2514,10 +2540,10 @@ "@types/prop-types" "*" csstype "^2.2.0" -"@types/resolve@*", "@types/resolve@^1.14.0": - version "1.14.0" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.14.0.tgz#c95d696264f8e53e764a7c0b83e9317b458b76c3" - integrity sha512-bmjNBW6tok+67iOsASeYSJxSgY++BIR35nGyGLORTDirhra9reJ0shgGL3U7KPDUbOBCx8JrlCjd4d/y5uiMRQ== +"@types/resolve@^1.17.0": + version "1.17.0" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.0.tgz#eb25b38e2682f641d33841df162e052d7364eaa8" + integrity sha512-CKOBcXAHvoGEjYsg6Bkc/kLPqTmtnUEGrWnJJC6LNnk+D36uc1GAHcNnwK2g58x/JWjGlqGfIao9rsJk7LePWw== dependencies: "@types/node" "*" @@ -2536,10 +2562,17 @@ dependencies: "@types/node" "*" -"@types/semver@^6.0.1", "@types/semver@^6.2.1": - version "6.2.1" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.2.1.tgz#a236185670a7860f1597cf73bea2e16d001461ba" - integrity sha512-+beqKQOh9PYxuHvijhVl+tIHvT6tuwOrE9m14zd+MT2A38KoKZhh7pYJ0SNleLtwDsiIxHDsIk9bv01oOxvSvA== +"@types/semver@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.1.0.tgz#c8c630d4c18cd326beff77404887596f96408408" + integrity sha512-pOKLaubrAEMUItGNpgwl0HMFPrSAFic8oSVIvfu1UwcgGNmNyK9gyhBHKmBnUTwwVvpZfkzUC0GaMgnL6P86uA== + dependencies: + "@types/node" "*" + +"@types/sinonjs__fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz#681df970358c82836b42f989188d133e218c458e" + integrity sha512-yYezQwGWty8ziyYLdZjwxyMb0CZR49h8JALHGrxjQHWlqGgc8kLdHEgWrgL0uZ29DMvEVBDnHU2Wg36zKSIUtA== "@types/source-map-support@^0.5.0": version "0.5.1" @@ -2568,12 +2601,10 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.0.tgz#fef1904e4668b6e5ecee60c52cc6a078ffa6697d" integrity sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A== -"@types/uuid@3.4.6": - version "3.4.6" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.6.tgz#d2c4c48eb85a757bf2927f75f939942d521e3016" - integrity sha512-cCdlC/1kGEZdEglzOieLDYBxHsvEOIg7kp/2FYyVR9Pxakq+Qf/inL3RKQ+PA8gOlI/NnL+fXmQH12nwcGzsHw== - dependencies: - "@types/node" "*" +"@types/uuid@7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-7.0.0.tgz#9f6993ccc8210efa90bda7e1afabbb06a9f860cd" + integrity sha512-RiX1I0lK9WFLFqy2xOxke396f0wKIzk5sAll0tL4J4XDYJXURI7JOs96XQb3nP+2gEpQ/LutBb66jgiT5oQshQ== "@types/weak-napi@^1.0.0": version "1.0.0" @@ -2613,40 +2644,40 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.19.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.27.0.tgz#e479cdc4c9cf46f96b4c287755733311b0d0ba4b" - integrity sha512-/my+vVHRN7zYgcp0n4z5A6HAK7bvKGBiswaM5zIlOQczsxj/aiD7RcgD+dvVFuwFaGh5+kM7XA6Q6PN0bvb1tw== +"@typescript-eslint/eslint-plugin@^2.30.0": + version "2.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.30.0.tgz#312a37e80542a764d96e8ad88a105316cdcd7b05" + integrity sha512-PGejii0qIZ9Q40RB2jIHyUpRWs1GJuHP1pkoCiaeicfwO9z7Fx03NQzupuyzAmv+q9/gFNHu7lo1ByMXe8PNyg== dependencies: - "@typescript-eslint/experimental-utils" "2.27.0" + "@typescript-eslint/experimental-utils" "2.30.0" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.27.0", "@typescript-eslint/experimental-utils@^2.5.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz#801a952c10b58e486c9a0b36cf21e2aab1e9e01a" - integrity sha512-vOsYzjwJlY6E0NJRXPTeCGqjv5OHgRU1kzxHKWJVPjDYGbPgLudBXjIlc+OD1hDBZ4l1DLbOc5VjofKahsu9Jw== +"@typescript-eslint/experimental-utils@2.30.0", "@typescript-eslint/experimental-utils@^2.5.0": + version "2.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.30.0.tgz#9845e868c01f3aed66472c561d4b6bac44809dd0" + integrity sha512-L3/tS9t+hAHksy8xuorhOzhdefN0ERPDWmR9CclsIGOUqGKy6tqc/P+SoXeJRye5gazkuPO0cK9MQRnolykzkA== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.27.0" + "@typescript-eslint/typescript-estree" "2.30.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^2.19.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.27.0.tgz#d91664335b2c46584294e42eb4ff35838c427287" - integrity sha512-HFUXZY+EdwrJXZo31DW4IS1ujQW3krzlRjBrFRrJcMDh0zCu107/nRfhk/uBasO8m0NVDbBF5WZKcIUMRO7vPg== +"@typescript-eslint/parser@^2.30.0": + version "2.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.30.0.tgz#7681c305a6f4341ae2579f5e3a75846c29eee9ce" + integrity sha512-9kDOxzp0K85UnpmPJqUzdWaCNorYYgk1yZmf4IKzpeTlSAclnFsrLjfwD9mQExctLoLoGAUXq1co+fbr+3HeFw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.27.0" - "@typescript-eslint/typescript-estree" "2.27.0" + "@typescript-eslint/experimental-utils" "2.30.0" + "@typescript-eslint/typescript-estree" "2.30.0" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/typescript-estree@2.27.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.27.0.tgz#a288e54605412da8b81f1660b56c8b2e42966ce8" - integrity sha512-t2miCCJIb/FU8yArjAvxllxbTiyNqaXJag7UOpB5DVoM3+xnjeOngtqlJkLRnMtzaRcJhe3CIR9RmL40omubhg== +"@typescript-eslint/typescript-estree@2.30.0": + version "2.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.30.0.tgz#1b8e848b55144270255ffbfe4c63291f8f766615" + integrity sha512-nI5WOechrA0qAhnr+DzqwmqHsx7Ulr/+0H7bWCcClDhhWkSyZR5BmTvnBEyONwJCTWHfc5PAQExX24VD26IAVw== dependencies: debug "^4.1.1" eslint-visitor-keys "^1.1.0" @@ -2656,161 +2687,6 @@ semver "^6.3.0" tsutils "^3.17.1" -"@webassemblyjs/ast@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" - integrity sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA== - dependencies: - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/wast-parser" "1.9.0" - -"@webassemblyjs/floating-point-hex-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz#3c3d3b271bddfc84deb00f71344438311d52ffb4" - integrity sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA== - -"@webassemblyjs/helper-api-error@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz#203f676e333b96c9da2eeab3ccef33c45928b6a2" - integrity sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw== - -"@webassemblyjs/helper-buffer@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz#a1442d269c5feb23fcbc9ef759dac3547f29de00" - integrity sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA== - -"@webassemblyjs/helper-code-frame@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz#647f8892cd2043a82ac0c8c5e75c36f1d9159f27" - integrity sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA== - dependencies: - "@webassemblyjs/wast-printer" "1.9.0" - -"@webassemblyjs/helper-fsm@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz#c05256b71244214671f4b08ec108ad63b70eddb8" - integrity sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw== - -"@webassemblyjs/helper-module-context@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz#25d8884b76839871a08a6c6f806c3979ef712f07" - integrity sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g== - dependencies: - "@webassemblyjs/ast" "1.9.0" - -"@webassemblyjs/helper-wasm-bytecode@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz#4fed8beac9b8c14f8c58b70d124d549dd1fe5790" - integrity sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw== - -"@webassemblyjs/helper-wasm-section@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz#5a4138d5a6292ba18b04c5ae49717e4167965346" - integrity sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - -"@webassemblyjs/ieee754@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz#15c7a0fbaae83fb26143bbacf6d6df1702ad39e4" - integrity sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg== - dependencies: - "@xtuc/ieee754" "^1.2.0" - -"@webassemblyjs/leb128@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.9.0.tgz#f19ca0b76a6dc55623a09cffa769e838fa1e1c95" - integrity sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw== - dependencies: - "@xtuc/long" "4.2.2" - -"@webassemblyjs/utf8@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.9.0.tgz#04d33b636f78e6a6813227e82402f7637b6229ab" - integrity sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w== - -"@webassemblyjs/wasm-edit@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz#3fe6d79d3f0f922183aa86002c42dd256cfee9cf" - integrity sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/helper-wasm-section" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - "@webassemblyjs/wasm-opt" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - "@webassemblyjs/wast-printer" "1.9.0" - -"@webassemblyjs/wasm-gen@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz#50bc70ec68ded8e2763b01a1418bf43491a7a49c" - integrity sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/ieee754" "1.9.0" - "@webassemblyjs/leb128" "1.9.0" - "@webassemblyjs/utf8" "1.9.0" - -"@webassemblyjs/wasm-opt@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz#2211181e5b31326443cc8112eb9f0b9028721a61" - integrity sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - -"@webassemblyjs/wasm-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz#9d48e44826df4a6598294aa6c87469d642fff65e" - integrity sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-api-error" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/ieee754" "1.9.0" - "@webassemblyjs/leb128" "1.9.0" - "@webassemblyjs/utf8" "1.9.0" - -"@webassemblyjs/wast-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz#3031115d79ac5bd261556cecc3fa90a3ef451914" - integrity sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/floating-point-hex-parser" "1.9.0" - "@webassemblyjs/helper-api-error" "1.9.0" - "@webassemblyjs/helper-code-frame" "1.9.0" - "@webassemblyjs/helper-fsm" "1.9.0" - "@xtuc/long" "4.2.2" - -"@webassemblyjs/wast-printer@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz#4935d54c85fef637b00ce9f52377451d00d47899" - integrity sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/wast-parser" "1.9.0" - "@xtuc/long" "4.2.2" - -"@xtuc/ieee754@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" - integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== - -"@xtuc/long@4.2.2": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" - integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== - "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" @@ -2828,7 +2704,7 @@ JSONStream@^1.0.4, JSONStream@^1.3.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.0: +abab@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== @@ -2850,7 +2726,7 @@ absolute-path@^0.0.0: resolved "https://registry.yarnpkg.com/absolute-path/-/absolute-path-0.0.0.tgz#a78762fbdadfb5297be99b15d35a785b2f095bf7" integrity sha1-p4di+9rftSl76ZsV01p4Wy8JW/c= -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: +accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -2858,30 +2734,25 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" -acorn-globals@^4.3.2: - version "4.3.4" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" - integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== +acorn-globals@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" + integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" + acorn "^7.1.1" + acorn-walk "^7.1.1" acorn-jsx@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== -acorn-walk@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" - integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== - -acorn@^6.0.1, acorn@^6.2.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" - integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== +acorn-walk@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.1.1.tgz#345f0dffad5c735e7373d2fec9a1023e6a44b83e" + integrity sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ== -acorn@^7.1.0, acorn@^7.1.1: +acorn@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== @@ -2891,11 +2762,6 @@ address@1.1.2, address@^1.0.1: resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= - agent-base@4, agent-base@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" @@ -2945,20 +2811,10 @@ airbnb-prop-types@^2.15.0: prop-types-exact "^1.2.0" react-is "^16.9.0" -ajv-errors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" - integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== - -ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" - integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== - -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0, ajv@^6.5.5: - version "6.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" - integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: + version "6.12.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" + integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" @@ -2975,11 +2831,6 @@ anser@^1.4.9: resolved "https://registry.yarnpkg.com/anser/-/anser-1.4.9.tgz#1f85423a5dcf8da4631a341665ff675b96845760" integrity sha512-AI+BjTeGt2+WFk4eWcqbQ7snZpDBt8SaLlj0RT2h5xfdWaiy51OjYvqwMrNzJLGy8iOAL6nKDITWO+rd4MkYEA== -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - ansi-colors@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" @@ -2987,11 +2838,6 @@ ansi-colors@^1.0.1: dependencies: ansi-wrap "^0.1.0" -ansi-colors@^3.0.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" - integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== - ansi-cyan@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-cyan/-/ansi-cyan-0.1.1.tgz#538ae528af8982f28ae30d86f2f17456d2609873" @@ -3188,11 +3034,6 @@ array-differ@^2.0.3: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-2.1.0.tgz#4b9c1c3f14b906757082925769e8ab904f4801b1" integrity sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w== -array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= - array-filter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" @@ -3280,11 +3121,6 @@ array.prototype.flat@^1.2.1, array.prototype.flat@^1.2.3: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== - arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -3295,15 +3131,6 @@ asap@^2.0.0, asap@~2.0.3, asap@~2.0.6: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -asn1.js@^4.0.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -3316,14 +3143,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert@^1.1.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" - integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== - dependencies: - object-assign "^4.1.1" - util "0.10.3" - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -3344,11 +3163,6 @@ async-each@^1.0.1: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - async@^2.4.0, async@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" @@ -3434,21 +3248,10 @@ babel-eslint@^10.0.3: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-loader@^8.0.5: - version "8.1.0" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" - integrity sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw== - dependencies: - find-cache-dir "^2.1.0" - loader-utils "^1.4.0" - mkdirp "^0.5.3" - pify "^4.0.1" - schema-utils "^2.6.5" - -babel-plugin-dynamic-import-node@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" - integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== +babel-plugin-dynamic-import-node@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" + integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== dependencies: object.assign "^4.1.0" @@ -3556,11 +3359,6 @@ babylon@^6.18.0: resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= - bail@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" @@ -3571,21 +3369,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= - base64-js@^1.0.2, base64-js@^1.1.2, base64-js@^1.2.3: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= - base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -3619,13 +3407,6 @@ benchmark@^2.1.4: lodash "^4.17.4" platform "^1.3.3" -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= - dependencies: - callsite "1.0.0" - big-integer@^1.6.44: version "1.6.48" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" @@ -3694,7 +3475,7 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" integrity sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow== -bindings@^1.3.0, bindings@^1.5.0: +bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -3717,22 +3498,21 @@ bl@^2.2.0: readable-stream "^2.3.5" safe-buffer "^5.1.1" -blob@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" - integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== +bl@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.2.tgz#52b71e9088515d0606d9dd9cc7aa48dc1f98e73a" + integrity sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" -bluebird@^3.3.0, bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: +bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== - -body-parser@1.19.0, body-parser@^1.16.1: +body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== @@ -3801,94 +3581,18 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== - dependencies: - pako "~1.0.5" - browserslist@4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" @@ -3898,13 +3602,13 @@ browserslist@4.7.0: electron-to-chromium "^1.3.247" node-releases "^1.1.29" -browserslist@^4.0.0, browserslist@^4.11.1, browserslist@^4.8.5, browserslist@^4.9.1: - version "4.11.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.11.1.tgz#92f855ee88d6e050e7e7311d987992014f1a1f1b" - integrity sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g== +browserslist@^4.0.0, browserslist@^4.11.1, browserslist@^4.8.5: + version "4.12.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.12.0.tgz#06c6d5715a1ede6c51fc39ff67fd647f740b656d" + integrity sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg== dependencies: - caniuse-lite "^1.0.30001038" - electron-to-chromium "^1.3.390" + caniuse-lite "^1.0.30001043" + electron-to-chromium "^1.3.413" node-releases "^1.1.53" pkg-up "^2.0.0" @@ -3915,7 +3619,7 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" -bson@^1.1.1: +bson@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.4.tgz#f76870d799f15b854dffb7ee32f0a874797f7e89" integrity sha512-S/yKGU1syOMzO86+dGpg2qGoDL0zvzcb262G+gqEy6TgP6rt6z6qxSFX/8X6vLC91P7G7C3nLs0+bvDzmvBA3Q== @@ -3953,32 +3657,13 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer@^4.3.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" - integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== +buffer@^5.2.1, buffer@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" + integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" - isarray "^1.0.0" - -buffer@^5.2.1: - version "5.5.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.5.0.tgz#9c3caa3d623c33dd1c7ef584b89b88bf9c9bc1ce" - integrity sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= builtins@^1.0.3: version "1.0.3" @@ -4010,7 +3695,7 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -cacache@^12.0.0, cacache@^12.0.2, cacache@^12.0.3: +cacache@^12.0.0, cacache@^12.0.3: version "12.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ== @@ -4078,11 +3763,6 @@ caller-path@^2.0.0: dependencies: caller-callsite "^2.0.0" -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= - callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -4125,6 +3805,11 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +camelcase@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.0.0.tgz#5259f7c30e35e278f1bdc2a4d91230b37cad981e" + integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w== + caniuse-api@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" @@ -4135,10 +3820,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001038, caniuse-lite@^1.0.30001039: - version "1.0.30001040" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001040.tgz#103fc8e6eb1d7397e95134cd0e996743353d58ea" - integrity sha512-Ep0tEPeI5wCvmJNrXjE3etgfI+lkl1fTDU6Y3ZH1mhrjkPlVI9W4pcKbMo+BQLpEWKVYYp2EmYaRsqpPC3k7lQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001039, caniuse-lite@^1.0.30001043: + version "1.0.30001048" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz#4bb4f1bc2eb304e5e1154da80b93dee3f1cf447e" + integrity sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg== capture-exit@^2.0.0: version "2.0.0" @@ -4190,6 +3875,19 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" + integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + character-entities-legacy@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" @@ -4249,22 +3947,7 @@ cheerio@^1.0.0-rc.3: lodash "^4.15.0" parse5 "^3.0.1" -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" - optionalDependencies: - fsevents "~2.1.1" - -chokidar@^2.0.4, chokidar@^2.1.8: +chokidar@^2.0.4: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== @@ -4283,10 +3966,10 @@ chokidar@^2.0.4, chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.0.0, chokidar@^3.3.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450" - integrity sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg== +chokidar@^3.3.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.0.tgz#b30611423ce376357c765b9b8f904b9fba3c0be8" + integrity sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ== dependencies: anymatch "~3.1.1" braces "~3.0.2" @@ -4294,7 +3977,7 @@ chokidar@^3.0.0, chokidar@^3.3.0: is-binary-path "~2.1.0" is-glob "~4.0.1" normalize-path "~3.0.0" - readdirp "~3.3.0" + readdirp "~3.4.0" optionalDependencies: fsevents "~2.1.2" @@ -4303,26 +3986,11 @@ chownr@^1.1.1, chownr@^1.1.2: resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== -chrome-trace-event@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" - integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== - dependencies: - tslib "^1.9.0" - ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -4358,9 +4026,9 @@ cli-spinners@^2.0.0: integrity sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w== cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== clipboard@^2.0.0: version "2.0.6" @@ -4522,11 +4190,6 @@ colorette@^1.0.7: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.1.0.tgz#1f943e5a357fac10b4e0f5aaef3b14cdc1af6ec7" integrity sha512-6S062WDQUXi6hOfkO/sBPVwE5ASXY4G2+b4atvhJfSsuUUhIaUKlkjLe9692Ipyt5/a+IPF5aVTu3V5gvXq5cg== -colors@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -4547,7 +4210,7 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== -commander@^2.11.0, commander@^2.19.0, commander@^2.20.0, commander@~2.20.3: +commander@^2.11.0, commander@^2.19.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -4558,9 +4221,9 @@ commander@^4.0.1: integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== commander@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.0.0.tgz#dbf1909b49e5044f8fdaf0adc809f0c0722bdfd0" - integrity sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ== + version "5.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== commander@~2.13.0: version "2.13.0" @@ -4587,26 +4250,11 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= - -component-emitter@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= - component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= - compressible@~2.0.16: version "2.0.18" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" @@ -4667,7 +4315,7 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" -connect@^3.6.0, connect@^3.6.5: +connect@^3.6.5: version "3.7.0" resolved "https://registry.yarnpkg.com/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8" integrity sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ== @@ -4677,11 +4325,6 @@ connect@^3.6.0, connect@^3.6.5: parseurl "~1.3.3" utils-merge "1.0.1" -console-browserify@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" - integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== - console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -4692,11 +4335,6 @@ console-stream@^0.1.1: resolved "https://registry.yarnpkg.com/console-stream/-/console-stream-0.1.1.tgz#a095fe07b20465955f2fafd28b5d72bccd949d44" integrity sha1-oJX+B7IEZZVfL6/Si11yvM2UnUQ= -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" @@ -4814,11 +4452,6 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - cookie@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" @@ -4884,37 +4517,6 @@ cosmiconfig@^5.0.0, cosmiconfig@^5.0.5, cosmiconfig@^5.1.0: js-yaml "^3.13.1" parse-json "^4.0.0" -create-ecdh@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" - integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - create-react-class@^15.6.3: version "15.6.3" resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" @@ -4970,27 +4572,10 @@ crowdin-cli@^0.3.0: yamljs "^0.2.1" yargs "^2.3.0" -crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -crypto-random-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" - integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== css-color-names@0.0.4, css-color-names@^0.0.4: version "0.0.4" @@ -5136,7 +4721,7 @@ csso@^4.0.2: dependencies: css-tree "1.0.0-alpha.39" -cssom@^0.4.1: +cssom@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== @@ -5146,10 +4731,10 @@ cssom@~0.3.6: resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.2.0.tgz#e4c44debccd6b7911ed617a4395e5754bba59992" - integrity sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA== +cssstyle@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" @@ -5165,11 +4750,6 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" @@ -5194,19 +4774,14 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== +data-urls@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" + integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" - -date-format@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-2.1.0.tgz#31d5b5ea211cf5fd764cd38baf9d033df7e125cf" - integrity sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA== + abab "^2.0.3" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.0.0" dateformat@^3.0.0: version "3.0.3" @@ -5214,9 +4789,9 @@ dateformat@^3.0.0: integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== dayjs@^1.8.15: - version "1.8.25" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.25.tgz#d09a8696cee7191bc1289e739f96626391b9c73c" - integrity sha512-Pk36juDfQQGDCgr0Lqd1kw15w3OS6xt21JaLPE3lCfsEf8KrERGwDNwvK1tRjrjqFC0uZBJncT4smZQ4F+uV5g== + version "1.8.26" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.26.tgz#c6d62ccdf058ca72a8d14bb93a23501058db9f1e" + integrity sha512-KqtAuIfdNfZR5sJY1Dixr2Is4ZvcCqhb0dZpCOt5dGEFiMzoIbjkTSzUb4QKTCsP+WNpGwUjAFIZrnZvUxxkhw== debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" @@ -5225,20 +4800,13 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6. dependencies: ms "2.0.0" -debug@3.1.0, debug@~3.1.0: +debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" -debug@3.2.6, debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" @@ -5253,6 +4821,13 @@ debug@4.1.0: dependencies: ms "^2.1.1" +debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -5271,6 +4846,11 @@ decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decimal.js@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.0.tgz#39466113a9e036111d02f82489b5fd6b0b5ed231" + integrity sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw== + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -5427,14 +5007,6 @@ deprecation@^2.0.0, deprecation@^2.3.1: resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" @@ -5466,35 +5038,16 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= - diacritics-map@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/diacritics-map/-/diacritics-map-0.1.0.tgz#6dfc0ff9d01000a2edf2865371cac316e94977af" integrity sha1-bfwP+dAQAKLt8oZTccrDFulJd68= -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - dir-glob@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" @@ -5596,16 +5149,6 @@ docusaurus@^1.14.2: tree-node-cli "^1.2.5" truncate-html "^1.0.3" -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - dom-serializer@0: version "0.2.2" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" @@ -5622,11 +5165,6 @@ dom-serializer@~0.1.0, dom-serializer@~0.1.1: domelementtype "^1.3.0" entities "^1.1.1" -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== - domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" @@ -5637,12 +5175,12 @@ domelementtype@^2.0.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d" integrity sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ== -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== +domexception@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" + integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== dependencies: - webidl-conversions "^4.0.2" + webidl-conversions "^5.0.0" domhandler@^2.3.0: version "2.4.2" @@ -5688,14 +5226,6 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -downlevel-dts@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.4.0.tgz#43f9f649c8b137373d76b4ee396d5a0227c10ddb" - integrity sha512-nh5vM3n2pRhPwZqh0iWo5gpItPAYEGEWw9yd0YpI+lO60B7A3A6iJlxDbt7kKVNbqBXKsptL+jwE/Yg5Go66WQ== - dependencies: - shelljs "^0.8.3" - typescript "^3.8.0-dev.20200111" - download@^6.2.2: version "6.2.5" resolved "https://registry.yarnpkg.com/download/-/download-6.2.5.tgz#acd6a542e4cd0bb42ca70cfc98c9e43b07039714" @@ -5764,23 +5294,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.390: - version "1.3.403" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.403.tgz#c8bab4e2e72bf78bc28bad1cc355c061f9cc1918" - integrity sha512-JaoxV4RzdBAZOnsF4dAlZ2ijJW72MbqO5lNfOBHUWiBQl3Rwe+mk2RCUMrRI3rSClLJ8HSNQNqcry12H+0ZjFw== - -elliptic@^6.0.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" - integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" +electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.413: + version "1.3.427" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.427.tgz#ea43d02908a8c71f47ebb46e09de5a3cf8236f04" + integrity sha512-/rG5G7Opcw68/Yrb4qYkz07h3bESVRJjUl4X/FrKLXzoUJleKm6D7K7rTTz8V5LUWnd+BbTOyxJX2XprRqHD8A== "emoji-regex@>=6.0.0 <=6.1.1": version "6.1.1" @@ -5802,11 +5319,6 @@ emojis-list@^2.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= -emojis-list@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" - integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== - encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -5819,67 +5331,13 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -end-of-stream@^1.0.0, end-of-stream@^1.1.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" - integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.5" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" - integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - -enhanced-resolve@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz#2937e2b8066cd0fe7ce0990a98f0d71a35189f66" - integrity sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA== - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.5.0" - tapable "^1.0.0" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - entities@^1.1.1, entities@~1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" @@ -5896,9 +5354,9 @@ env-paths@^2.2.0: integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== envinfo@^7.1.0, envinfo@^7.3.1: - version "7.5.0" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.5.0.tgz#91410bb6db262fb4f1409bd506e9ff57e91023f4" - integrity sha512-jDgnJaF/Btomk+m3PZDTTCb5XIIIX3zYItnCRfF73zVgvinLoRomuhi75Y4su0PtQxWz4v66XnLLckyvyJTOIQ== + version "7.5.1" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.5.1.tgz#93c26897225a00457c75e734d354ea9106a72236" + integrity sha512-hQBkDf2iO4Nv0CNHpCuSBeaSrveU6nThVxFGTrq/eDlV716UQk09zChaJae4mZRsos1x4YLY2TaH3LHUae3ZmQ== enzyme-adapter-react-16@*: version "1.15.2" @@ -5968,7 +5426,7 @@ err-code@^1.0.0: resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= -errno@^0.1.3, errno@~0.1.7: +errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== @@ -6050,7 +5508,7 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escodegen@^1.11.1: +escodegen@^1.14.1: version "1.14.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457" integrity sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ== @@ -6068,9 +5526,9 @@ eslint-config-fbjs@^3.1.1: integrity sha512-Vpyqz+ZcyLyiUGUdUfiQmZnxiQ4Nj/KDRKed/Y5qSm+xHbQJ5zcZUQwLUMWHQicpDHewsdXwlpUAblvy1DtGvg== eslint-config-prettier@^6.1.0: - version "6.10.1" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a" - integrity sha512-svTy6zh1ecQojvpbJSgH3aei/Rt7C6i090l5f2WQ4aB05lYHeZIR1qL4wZyyILTbtmnbHP5Yn8MrsOJMGa8RkQ== + version "6.11.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1" + integrity sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA== dependencies: get-stdin "^6.0.0" @@ -6162,9 +5620,9 @@ eslint-plugin-markdown@^1.0.0: unified "^6.1.2" eslint-plugin-prettier@^3.0.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" - integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== + version "3.1.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.3.tgz#ae116a0fc0e598fdae48743a4430903de5b4e6ca" + integrity sha512-+HG5jmu/dN3ZV3T6eCD7a4BlAySdN7mLIbJYo0z1cFQuI+r2DiTJEFeF68ots93PsnrMxbzIZ2S/ieX+mkrBeQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -6198,14 +5656,6 @@ eslint-rule-composer@^0.3.0: resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== -eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-scope@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" @@ -6291,11 +5741,11 @@ esprima@^4.0.0, esprima@^4.0.1: integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.2.0.tgz#a010a519c0288f2530b3404124bfb5f02e9797fe" - integrity sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q== + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== dependencies: - estraverse "^5.0.0" + estraverse "^5.1.0" esrecurse@^4.1.0: version "4.2.1" @@ -6309,10 +5759,10 @@ estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.0.0.tgz#ac81750b482c11cca26e4b07e83ed8f75fbcdc22" - integrity sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A== +estraverse@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642" + integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== esutils@^2.0.2: version "2.0.3" @@ -6334,16 +5784,6 @@ eventemitter3@^3.0.0, eventemitter3@^3.1.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== -eventemitter3@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb" - integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg== - -events@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59" - integrity sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg== - eventsource@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" @@ -6351,14 +5791,6 @@ eventsource@^1.0.7: dependencies: original "^1.0.0" -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - exec-buffer@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/exec-buffer/-/exec-buffer-3.2.0.tgz#b1686dbd904c7cf982e652c1f5a79b1e5573082b" @@ -6401,10 +5833,10 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^3.2.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" - integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== +execa@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.0.tgz#7f37d6ec17f09e6b8fc53288611695b6d12b9daf" + integrity sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA== dependencies: cross-spawn "^7.0.0" get-stream "^5.0.0" @@ -6413,7 +5845,6 @@ execa@^3.2.0: merge-stream "^2.0.0" npm-run-path "^4.0.0" onetime "^5.1.0" - p-finally "^2.0.0" signal-exit "^3.0.2" strip-final-newline "^2.0.0" @@ -6580,9 +6011,9 @@ fancy-log@^1.3.2: time-stamp "^1.0.0" fast-check@^1.13.0: - version "1.24.1" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-1.24.1.tgz#42a153e664122b1a2defdaea4e9b8311635fa7e7" - integrity sha512-ECF5LDbt4F8sJyTDI62fRLn0BdHDAdBacxlEsxaYbtqwbsdWofoYZUSaUp9tJrLsqCQ8jG28SkNvPZpDfNo3tw== + version "1.24.2" + resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-1.24.2.tgz#1f5e4a3c20530c3a85a861e60f680c32229d4fcb" + integrity sha512-ZL48cyZZLJnVsUj127Zi1mfFLM98yzw0LlSSH8CMeVmpL5RCfSRcZSZZ0kJWrRK4eOgNFnXXKNDbzuRb3Vsdhg== dependencies: pure-rand "^2.0.0" tslib "^1.10.0" @@ -6609,7 +6040,7 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.0.3: +fast-glob@^3.1.1: version "3.2.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.2.tgz#ade1a9d91148965d4bf7c51f72e1ca662d32e63d" integrity sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A== @@ -6850,16 +6281,16 @@ finalhandler@1.1.2, finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-cache-dir@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874" - integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== +find-cache-dir@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== dependencies: commondir "^1.0.1" - make-dir "^3.0.0" + make-dir "^3.0.2" pkg-dir "^4.1.0" -find-cache-dir@^2.0.0, find-cache-dir@^2.1.0: +find-cache-dir@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== @@ -6928,13 +6359,6 @@ flat-cache@^2.0.1: rimraf "2.6.3" write "1.0.3" -flat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== - dependencies: - is-buffer "~2.0.3" - flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" @@ -6948,13 +6372,6 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" -follow-redirects@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.11.0.tgz#afa14f08ba12a52963140fe43212658897bc0ecb" - integrity sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA== - dependencies: - debug "^3.0.0" - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -7027,15 +6444,6 @@ fs-extra@^1.0.0: jsonfile "^2.1.0" klaw "^1.0.0" -fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -7075,10 +6483,10 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.1.2, fsevents@~2.1.1, fsevents@~2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805" - integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA== +fsevents@^2.1.2, fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== function-bind@^1.1.1: version "1.1.1" @@ -7156,18 +6564,11 @@ get-pkg-repo@^1.0.0: parse-github-repo-url "^1.3.0" through2 "^2.0.0" -get-port@*: +get-port@*, get-port@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== -get-port@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.0.0.tgz#aa22b6b86fd926dd7884de3e23332c9f70c031a6" - integrity sha512-imzMU0FjsZqNa6BqOjbbW6w5BivHIuQKopjpPqcnx0AVHJQKCxK1O+Ab3OrVXhrekqfVMjwA9ZYu062R+KcIsQ== - dependencies: - type-fest "^0.3.0" - get-port@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" @@ -7327,18 +6728,6 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.1: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" @@ -7392,18 +6781,16 @@ globby@8.0.2, globby@^8.0.1: pify "^3.0.0" slash "^1.0.0" -globby@^10.0.2: - version "10.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" - integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== +globby@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.0.tgz#56fd0e9f0d4f8fb0c456f1ab0dee96e1380bc154" + integrity sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg== dependencies: - "@types/glob" "^7.1.1" array-union "^2.1.0" dir-glob "^3.0.1" - fast-glob "^3.0.3" - glob "^7.1.3" - ignore "^5.1.1" - merge2 "^1.2.3" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" slash "^3.0.0" globby@^9.2.0: @@ -7479,10 +6866,10 @@ got@^8.3.1: url-parse-lax "^3.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== +graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== "graceful-readlink@>= 1.0.0": version "1.0.1" @@ -7514,11 +6901,6 @@ gray-matter@^2.1.0: js-yaml "^3.8.1" toml "^2.3.2" -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -7573,18 +6955,6 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -7655,27 +7025,6 @@ has@^1.0.0, has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - hermes-engine@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.4.1.tgz#2d02b295596298643c4d24b86687eb554db9e950" @@ -7691,15 +7040,6 @@ highlight.js@^9.16.2: resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.1.tgz#ed21aa001fe6252bb10a3d76d47573c6539fe13c" integrity sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg== -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: version "2.8.8" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" @@ -7727,12 +7067,12 @@ html-element-map@^1.2.0: dependencies: array-filter "^1.0.0" -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== +html-encoding-sniffer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" + integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== dependencies: - whatwg-encoding "^1.0.1" + whatwg-encoding "^1.0.5" html-escaper@^2.0.0: version "2.0.2" @@ -7800,15 +7140,6 @@ http-proxy-agent@^4.0.0: agent-base "6" debug "4" -http-proxy@^1.13.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.0.tgz#dbe55f63e75a347db7f3d99974f2692a314a6a3a" - integrity sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ== - dependencies: - eventemitter3 "^4.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -7818,17 +7149,12 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= - -https-proxy-agent@4.0.0, https-proxy-agent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" - integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== +https-proxy-agent@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== dependencies: - agent-base "5" + agent-base "6" debug "4" https-proxy-agent@^2.2.3: @@ -7839,6 +7165,14 @@ https-proxy-agent@^2.2.3: agent-base "^4.3.0" debug "^3.1.0" +https-proxy-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" + integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== + dependencies: + agent-base "5" + debug "4" + human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" @@ -7885,7 +7219,7 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5, ignore@^5.1.1: +ignore@^5.0.5, ignore@^5.1.4: version "5.1.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== @@ -8016,11 +7350,6 @@ indexes-of@^1.0.1: resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= - infer-owner@^1.0.3, infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" @@ -8034,16 +7363,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= - inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -8279,11 +7603,6 @@ is-buffer@^1.1.4, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623" - integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== - is-callable@^1.1.4, is-callable@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" @@ -8503,10 +7822,10 @@ is-png@^1.0.0: resolved "https://registry.yarnpkg.com/is-png/-/is-png-1.1.0.tgz#d574b12bf275c0350455570b0e5b57ab062077ce" integrity sha1-1XSxK/J1wDUEVVcLDltXqwYgd84= -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= +is-potential-custom-element-name@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" + integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= is-regex@^1.0.4, is-regex@^1.0.5: version "1.0.5" @@ -8639,18 +7958,6 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= - -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== - dependencies: - buffer-alloc "^1.2.0" - isbinaryfile@^4.0.0: version "4.0.6" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.6.tgz#edcb62b224e2b4710830b67498c8e4e5a4d2610b" @@ -8696,15 +8003,12 @@ istanbul-lib-coverage@^3.0.0: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== -istanbul-lib-instrument@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz#61f13ac2c96cfefb076fe7131156cc05907874e6" - integrity sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg== +istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== dependencies: "@babel/core" "^7.7.5" - "@babel/parser" "^7.7.5" - "@babel/template" "^7.7.4" - "@babel/traverse" "^7.7.4" "@istanbuljs/schema" "^0.1.2" istanbul-lib-coverage "^3.0.0" semver "^6.3.0" @@ -8797,6 +8101,20 @@ jest-message-util@^24.9.0: slash "^2.0.0" stack-utils "^1.0.1" +jest-message-util@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.5.0.tgz#ea11d93204cc7ae97456e1d8716251185b8880ea" + integrity sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/types" "^25.5.0" + "@types/stack-utils" "^1.0.1" + chalk "^3.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.2" + slash "^3.0.0" + stack-utils "^1.0.1" + jest-mock@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" @@ -8809,6 +8127,11 @@ jest-pnp-resolver@^1.2.1: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== +jest-regex-util@^25.2.1: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.6.tgz#d847d38ba15d2118d3b06390056028d0f2fd3964" + integrity sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw== + jest-serializer@^24.4.0, jest-serializer@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" @@ -8845,6 +8168,17 @@ jest-util@^24.0.0, jest-util@^24.9.0: slash "^2.0.0" source-map "^0.6.0" +jest-util@^25.2.6, jest-util@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.5.0.tgz#31c63b5d6e901274d264a4fec849230aa3fa35b0" + integrity sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA== + dependencies: + "@jest/types" "^25.5.0" + chalk "^3.0.0" + graceful-fs "^4.2.4" + is-ci "^2.0.0" + make-dir "^3.0.0" + jest-validate@^24.7.0, jest-validate@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.9.0.tgz#0775c55360d173cd854e40180756d4ff52def8ab" @@ -8870,6 +8204,18 @@ jest-watch-typeahead@^0.5.0: string-length "^3.1.0" strip-ansi "^6.0.0" +jest-watcher@^25.2.4: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.5.0.tgz#d6110d101df98badebe435003956fd4a465e8456" + integrity sha512-XrSfJnVASEl+5+bb51V0Q7WQx65dTSk7NL4yDdVjPnRNpM0hG+ncFmDYJo9O8jaSRcAitVbuVawyXCRoxGrT5Q== + dependencies: + "@jest/test-result" "^25.5.0" + "@jest/types" "^25.5.0" + ansi-escapes "^4.2.1" + chalk "^3.0.0" + jest-util "^25.5.0" + string-length "^3.1.0" + jest-worker@^24.6.0, jest-worker@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" @@ -8930,36 +8276,36 @@ jsc-android@^245459.0.0: resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-245459.0.0.tgz#e584258dd0b04c9159a27fb104cd5d491fd202c9" integrity sha512-wkjURqwaB1daNkDi2OYYbsLnIdC/lUM2nPXQKRs5pqEU9chDg435bjvo+LSaHotDENygHQDHe+ntUkkw2gwMtg== -jsdom@^15.2.1: - version "15.2.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" - integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== - dependencies: - abab "^2.0.0" - acorn "^7.1.0" - acorn-globals "^4.3.2" - array-equal "^1.0.0" - cssom "^0.4.1" - cssstyle "^2.0.0" - data-urls "^1.1.0" - domexception "^1.0.1" - escodegen "^1.11.1" - html-encoding-sniffer "^1.0.2" +jsdom@^16.2.2: + version "16.2.2" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.2.2.tgz#76f2f7541646beb46a938f5dc476b88705bedf2b" + integrity sha512-pDFQbcYtKBHxRaP55zGXCJWgFHkDAYbKcsXEK/3Icu9nKYZkutUXfLBwbD+09XDutkYSHcgfQLZ0qvpAAm9mvg== + dependencies: + abab "^2.0.3" + acorn "^7.1.1" + acorn-globals "^6.0.0" + cssom "^0.4.4" + cssstyle "^2.2.0" + data-urls "^2.0.0" + decimal.js "^10.2.0" + domexception "^2.0.1" + escodegen "^1.14.1" + html-encoding-sniffer "^2.0.1" + is-potential-custom-element-name "^1.0.0" nwsapi "^2.2.0" - parse5 "5.1.0" - pn "^1.1.0" - request "^2.88.0" - request-promise-native "^1.0.7" - saxes "^3.1.9" - symbol-tree "^3.2.2" + parse5 "5.1.1" + request "^2.88.2" + request-promise-native "^1.0.8" + saxes "^5.0.0" + symbol-tree "^3.2.4" tough-cookie "^3.0.1" - w3c-hr-time "^1.0.1" - w3c-xmlserializer "^1.1.2" - webidl-conversions "^4.0.2" + w3c-hr-time "^1.0.2" + w3c-xmlserializer "^2.0.0" + webidl-conversions "^6.0.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" - whatwg-url "^7.0.0" - ws "^7.0.0" + whatwg-url "^8.0.0" + ws "^7.2.3" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -8977,7 +8323,7 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= -json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== @@ -9070,64 +8416,6 @@ jsx-ast-utils@^2.2.1, jsx-ast-utils@^2.2.3: array-includes "^3.0.3" object.assign "^4.1.0" -karma-chrome-launcher@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz#805a586799a4d05f4e54f72a204979f3f3066738" - integrity sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg== - dependencies: - which "^1.2.1" - -karma-mocha@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-1.3.0.tgz#eeaac7ffc0e201eb63c467440d2b69c7cf3778bf" - integrity sha1-7qrH/8DiAetjxGdEDStpx883eL8= - dependencies: - minimist "1.2.0" - -karma-webpack@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/karma-webpack/-/karma-webpack-4.0.2.tgz#23219bd95bdda853e3073d3874d34447c77bced0" - integrity sha512-970/okAsdUOmiMOCY8sb17A2I8neS25Ad9uhyK3GHgmRSIFJbDcNEFE8dqqUhNe9OHiCC9k3DMrSmtd/0ymP1A== - dependencies: - clone-deep "^4.0.1" - loader-utils "^1.1.0" - neo-async "^2.6.1" - schema-utils "^1.0.0" - source-map "^0.7.3" - webpack-dev-middleware "^3.7.0" - -karma@^4.0.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.4.1.tgz#6d9aaab037a31136dc074002620ee11e8c2e32ab" - integrity sha512-L5SIaXEYqzrh6b1wqYC42tNsFMx2PWuxky84pK9coK09MvmL7mxii3G3bZBh/0rvD27lqDd0le9jyhzvwif73A== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - braces "^3.0.2" - chokidar "^3.0.0" - colors "^1.1.0" - connect "^3.6.0" - di "^0.0.1" - dom-serialize "^2.2.0" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.14" - log4js "^4.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.3.0" - keyv@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" @@ -9296,11 +8584,6 @@ load-json-file@^5.3.0: strip-bom "^3.0.0" type-fest "^0.3.0" -loader-runner@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== - loader-utils@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" @@ -9310,15 +8593,6 @@ loader-utils@1.2.3: emojis-list "^2.0.0" json5 "^1.0.1" -loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^1.0.1" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -9499,13 +8773,6 @@ lodash@^4.15.0, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17. resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" @@ -9513,17 +8780,6 @@ log-symbols@^2.2.0: dependencies: chalk "^2.0.1" -log4js@^4.0.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-4.5.1.tgz#e543625e97d9e6f3e6e7c9fc196dd6ab2cae30b5" - integrity sha512-EEEgFcE9bLgaYUKuozyFfytQM2wDHtXn4tAN41pkaxpNjAykv11GVdeI4tHtmPWW4Xrgh9R/2d7XYghDVjbKKw== - dependencies: - date-format "^2.0.0" - debug "^4.1.1" - flatted "^2.0.0" - rfdc "^1.1.4" - streamroller "^1.0.6" - logalot@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/logalot/-/logalot-2.1.0.tgz#5f8e8c90d304edf12530951a5554abb8c5e3f552" @@ -9541,13 +8797,6 @@ logkitty@^0.6.0: dayjs "^1.8.15" yargs "^12.0.5" -lolex@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" - integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== - dependencies: - "@sinonjs/commons" "^1.7.0" - longest@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -9588,7 +8837,7 @@ lpad-align@^1.0.1: longest "^1.0.0" meow "^3.3.0" -lru-cache@4.1.x, lru-cache@^4.0.1: +lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -9623,10 +8872,10 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-dir@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392" - integrity sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w== +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" @@ -9721,15 +8970,6 @@ md5-file@^4.0.0: resolved "https://registry.yarnpkg.com/md5-file/-/md5-file-4.0.0.tgz#f3f7ba1e2dd1144d5bf1de698d0e5f44a4409584" integrity sha512-UC0qFwyAjn4YdPpKaDNw6gNxRf7Mcx7jC1UGCY4boCzgvU2Aoc1mOGzTtrjjLKhM5ivsnhoKpQVxKPp+1j1qwg== -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - mdn-data@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" @@ -9754,22 +8994,6 @@ mem@^4.0.0: mimic-fn "^2.0.0" p-is-promise "^2.0.0" -memory-fs@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -memory-fs@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" - integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - memory-pager@^1.0.2: version "1.5.0" resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" @@ -10101,18 +9325,10 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.43.0, "mime-db@>= 1.43.0 < 2", mime-db@^1.28.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" - integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== +mime-db@1.44.0, "mime-db@>= 1.43.0 < 2", mime-db@^1.28.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== mime-db@~1.23.0: version "1.23.0" @@ -10127,21 +9343,21 @@ mime-types@2.1.11: mime-db "~1.23.0" mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.26" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" - integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== dependencies: - mime-db "1.43.0" + mime-db "1.44.0" mime@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.3.1, mime@^2.4.1, mime@^2.4.4: - version "2.4.4" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" - integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== +mime@^2.4.1: + version "2.4.5" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.5.tgz#d8de2ecb92982dedbb6541c9b6841d7f218ea009" + integrity sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w== mimic-fn@^1.0.0: version "1.2.0" @@ -10158,17 +9374,7 @@ mimic-response@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: +minimatch@3.0.4, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -10193,11 +9399,6 @@ minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - minipass@^2.3.5, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" @@ -10244,101 +9445,76 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@0.5.3, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" - integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg== +mkdirp@*, mkdirp@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" -mocha@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.1.1.tgz#89fbb30d09429845b1bb893a830bf5771049a441" - integrity sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.3" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - mock-fs@^4.4.1: - version "4.11.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.11.0.tgz#0828107e4b843a6ba855ecebfe3c6e073b69db92" - integrity sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw== + version "4.12.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.12.0.tgz#a5d50b12d2d75e5bec9dac3b67ffe3c41d31ade4" + integrity sha512-/P/HtrlvBxY4o/PzXY9cCNBrdylDNxg7gnrv2sMNxj+UJ2m8jSpl0/A6fuJeNAWr99ZvGWH8XCbE0vmnM5KupQ== modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -mongodb-memory-server-core@6.3.2: - version "6.3.2" - resolved "https://registry.yarnpkg.com/mongodb-memory-server-core/-/mongodb-memory-server-core-6.3.2.tgz#85d9abc6ecd0d58e5bacd9cdc313075d8ef91575" - integrity sha512-QMLYf6CIyBEjh9EyfDdISPwlmD3FEDpyQBwl0ecws4CHMcP8mrA1rw1KzhorhvfiGgSdmxnENxAO8pTzxw2EhQ== +mongodb-memory-server-core@6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/mongodb-memory-server-core/-/mongodb-memory-server-core-6.5.2.tgz#21c96b6e3104b999905ecb232f83d2432467a0f5" + integrity sha512-Cs1wB+GrL2KconDD2emk6ptU1OqdYia11I7fw5sOqnEWc8stTQ4rtptbRcLmHyTcTgRYC/fsQQvzbbd7DBf4DQ== dependencies: "@types/cross-spawn" "^6.0.1" "@types/debug" "^4.1.5" - "@types/decompress" "^4.2.3" "@types/dedent" "^0.7.0" - "@types/find-cache-dir" "^2.0.0" - "@types/find-package-json" "^1.1.0" + "@types/find-cache-dir" "^3.2.0" + "@types/find-package-json" "^1.1.1" "@types/get-port" "^4.0.1" "@types/lockfile" "^1.0.1" - "@types/md5-file" "^4.0.0" - "@types/mkdirp" "^0.5.2" + "@types/md5-file" "^4.0.1" + "@types/mkdirp" "^1.0.0" "@types/tmp" "0.1.0" - "@types/uuid" "3.4.6" + "@types/uuid" "7.0.0" camelcase "^5.3.1" cross-spawn "^7.0.1" debug "^4.1.1" - decompress "^4.2.0" dedent "^0.7.0" - find-cache-dir "3.2.0" + find-cache-dir "3.3.1" find-package-json "^1.2.0" - get-port "5.0.0" - https-proxy-agent "4.0.0" + get-port "5.1.1" + https-proxy-agent "5.0.0" lockfile "^1.0.4" md5-file "^4.0.0" - mkdirp "^0.5.1" + mkdirp "^1.0.3" + tar-stream "^2.1.1" tmp "^0.1.0" - uuid "^3.3.3" + uuid "^7.0.2" + yauzl "^2.10.0" optionalDependencies: - mongodb "^3.2.7" + mongodb "^3.5.4" mongodb-memory-server@^6.3.2: - version "6.3.2" - resolved "https://registry.yarnpkg.com/mongodb-memory-server/-/mongodb-memory-server-6.3.2.tgz#486f480d7ba272f42c282e636d8834332b2836f0" - integrity sha512-iTwSAfmSooCkbmKoPU1iyT8RC+pCHIzk+9GCyCu7eHMst4k08+e3o4CYoFZbqOvmNLdbqsfjwWENZe7exkGd/Q== + version "6.5.2" + resolved "https://registry.yarnpkg.com/mongodb-memory-server/-/mongodb-memory-server-6.5.2.tgz#47f4c19ab830f63ee6119629072eee2df7d8957a" + integrity sha512-PUCiWcHGwyqQiZF3J4iCy1DXqPjoNtehV2qMFJ26rhNBFzmc5SW+9/FUQwGNLge5/Lm1dEwcraJD5PUe8m9Kdg== dependencies: - mongodb-memory-server-core "6.3.2" + mongodb-memory-server-core "6.5.2" -mongodb@^3.1.13, mongodb@^3.2.7: - version "3.5.5" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.5.5.tgz#1334c3e5a384469ac7ef0dea69d59acc829a496a" - integrity sha512-GCjDxR3UOltDq00Zcpzql6dQo1sVry60OXJY3TDmFc2SWFY6c8Gn1Ardidc5jDirvJrx2GC3knGOImKphbSL3A== +mongodb@^3.1.13, mongodb@^3.5.4: + version "3.5.7" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.5.7.tgz#6dcfff3bdbf67a53263dcca1647c265eea1d065d" + integrity sha512-lMtleRT+vIgY/JhhTn1nyGwnSMmJkJELp+4ZbrjctrnBxuLbj6rmLuJFz8W2xUzUqWmqoyVxJLYuC58ZKpcTYQ== dependencies: bl "^2.2.0" - bson "^1.1.1" + bson "^1.1.4" denque "^1.4.1" require_optional "^1.0.1" safe-buffer "^5.1.2" @@ -10407,9 +9583,9 @@ mz@^2.5.0: thenify-all "^1.0.0" nan@^2.12.1: - version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + version "2.14.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" + integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== nanomatch@^1.2.9: version "1.2.13" @@ -10434,9 +9610,9 @@ natural-compare@^1.4.0: integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= nearley@^2.7.10: - version "2.19.1" - resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.19.1.tgz#4af4006e16645ff800e9f993c3af039857d9dbdc" - integrity sha512-xq47GIUGXxU9vQg7g/y1o1xuKnkO7ev4nRWqftmQrLkfnE/FjRqDaGOUakM8XHPn/6pW3bGjU2wgoJyId90rqg== + version "2.19.3" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.19.3.tgz#ae3b040e27616b5348102c436d1719209476a5a1" + integrity sha512-FpAy1PmTsUpOtgxr23g4jRNvJHYzZEW2PixXeSzksLR/ykPfwKhAodc2+9wQhY+JneWLcvkDw6q7FJIsIdF/aQ== dependencies: commander "^2.19.0" moo "^0.5.0" @@ -10449,7 +9625,7 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1: +neo-async@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== @@ -10459,18 +9635,10 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-addon-api@^1.1.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.1.tgz#cf813cd69bb8d9100f6bdca6755fc268f54ac492" - integrity sha512-2+DuKodWvwRTrCfKOeR24KIc5unKjOh8mz17NCzVnHWfjAdDqbfbjqh7gUT+BkXBRQM52+xCHciKWonJ3CbJMQ== - -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" +node-addon-api@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.0.tgz#812446a1001a54f71663bed188314bba07e09247" + integrity sha512-sSHCgWfJ+Lui/u+0msF3oyCgvdkhxDbkCS6Q8uiJquzOimkJBvX6hl5aSSA7DR1XbMpdM8r7phjcF63sF4rkKg== node-fetch-npm@^2.0.2: version "2.0.4" @@ -10507,6 +9675,11 @@ node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.5.0, node-fetch@^2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== +node-gyp-build@^4.2.1: + version "4.2.2" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.2.tgz#3f44b65adaafd42fb6c3d81afd630e45c847eb66" + integrity sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA== + node-gyp@^5.0.2: version "5.1.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.1.0.tgz#8e31260a7af4a2e2f994b0673d4e0b3866156332" @@ -10529,50 +9702,22 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-libs-browser@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.1" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" - node-modules-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-notifier@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" - integrity sha512-SVfQ/wMw+DesunOm5cKqr6yDcvUTDl/yc97ybGHMrteNEY6oekXpNpS3lZwgLlwz0FLgHoiW28ZpmBHUDg37cw== +node-notifier@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-7.0.0.tgz#513bc42f2aa3a49fce1980a7ff375957c71f718a" + integrity sha512-y8ThJESxsHcak81PGpzWwQKxzk+5YtP3IxR8AYdpXQ1IB6FmcVzFdZXrkPin49F/DKUCfeeiziB8ptY9npzGuA== dependencies: growly "^1.3.0" is-wsl "^2.1.1" - semver "^6.3.0" + semver "^7.2.1" shellwords "^0.1.1" - which "^1.3.1" + uuid "^7.0.3" + which "^2.0.2" node-releases@^1.1.29, node-releases@^1.1.53: version "1.1.53" @@ -10580,9 +9725,9 @@ node-releases@^1.1.29, node-releases@^1.1.53: integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== node-stream-zip@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.9.1.tgz#66d210204da7c60e2d6d685eb21a11d016981fd0" - integrity sha512-7/Xs9gkuYF0WBimz5OrSc6UVKLDTxvBG2yLGtEK8PSx94d86o/6iQLvIe/140ATz35JDqHKWIxh3GcA3u5hB0w== + version "1.10.1" + resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.10.1.tgz#d4c648e8d4cf97311e655b3c998d344ccbb421a8" + integrity sha512-fd2jdfvs3xJhSGpipy3EgCHGgFMXZkJh6HeQ8LURfMUW9oHcPEMWLXO657MtMRGJCHvQYQk6dTHZmNycu87PEg== nopt@^4.0.1: version "4.0.3" @@ -10761,11 +9906,6 @@ object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -10781,9 +9921,12 @@ object-inspect@^1.7.0: integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== object-is@^1.0.1, object-is@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.2.tgz#6b80eb84fe451498f65007982f035a5b445edec4" - integrity sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ== + version "1.1.2" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.2.tgz#c5d2e87ff9e119f78b7a088441519e2eec1573b6" + integrity sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" @@ -10797,7 +9940,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@4.1.0, object.assign@^4.1.0: +object.assign@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== @@ -10917,14 +10060,6 @@ opn@4.0.2: object-assign "^4.0.1" pinkie-promise "^2.0.0" -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - optionator@^0.8.1, optionator@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -10968,12 +10103,7 @@ original@^1.0.0: resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== dependencies: - url-parse "^1.4.3" - -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + url-parse "^1.4.3" os-filter-obj@^2.0.0: version "2.0.0" @@ -11056,11 +10186,6 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - p-is-promise@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" @@ -11166,11 +10291,6 @@ p-waterfall@^1.0.0: dependencies: p-reduce "^1.0.0" -pako@~1.0.5: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - parallel-transform@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" @@ -11187,18 +10307,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0: - version "5.1.5" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" - integrity sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ== - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - parse-entities@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50" @@ -11264,10 +10372,10 @@ parse-url@^5.0.0: parse-path "^4.0.0" protocols "^1.4.0" -parse5@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== +parse5@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== parse5@^3.0.1: version "3.0.3" @@ -11276,25 +10384,6 @@ parse5@^3.0.1: dependencies: "@types/node" "*" -parse5@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" - integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= - dependencies: - better-assert "~1.0.0" - parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -11305,11 +10394,6 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -path-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" - integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== - path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -11385,17 +10469,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.3: - version "3.0.17" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -11406,7 +10479,7 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7, picomatch@^2.2.1: +picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== @@ -11498,15 +10571,10 @@ plugin-error@^0.1.2: arr-union "^2.0.1" extend-shallow "^1.1.2" -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - portfinder@^1.0.25: - version "1.0.25" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" - integrity sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg== + version "1.0.26" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.26.tgz#475658d56ca30bed72ac7f1378ed350bd1b64e70" + integrity sha512-Xi7mKxJHHMI3rIUrnm/jjUgwhbYMkp/XKEcZX3aG4BrumLpq3nmoQMX+ClYnDZnZ/New7IatC1no5RX0zo1vXQ== dependencies: async "^2.6.2" debug "^3.1.1" @@ -11788,9 +10856,9 @@ postcss-value-parser@^3.0.0: integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== postcss-value-parser@^4.0.2, postcss-value-parser@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz#651ff4593aa9eda8d5d0d66593a2417aeaeb325d" - integrity sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg== + version "4.1.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" + integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.23, postcss@^7.0.27: version "7.0.27" @@ -11823,15 +10891,15 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^1.13.4: +prettier@^1.19.1: version "1.19.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== prettier@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.4.tgz#2d1bae173e355996ee355ec9830a7a1ee05457ef" - integrity sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w== + version "2.0.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" + integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== pretty-format@^24.7.0, pretty-format@^24.8.0, pretty-format@^24.9.0: version "24.9.0" @@ -11843,6 +10911,16 @@ pretty-format@^24.7.0, pretty-format@^24.8.0, pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" +pretty-format@^25.2.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" + integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== + dependencies: + "@jest/types" "^25.5.0" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + prismjs@^1.17.1: version "1.20.0" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.20.0.tgz#9b685fc480a3514ee7198eac6a3bf5024319ff03" @@ -11860,11 +10938,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -11970,18 +11043,6 @@ psl@^1.1.28: resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - pump@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" @@ -12007,16 +11068,6 @@ pumpify@^1.3.3: inherits "^2.0.3" pump "^2.0.0" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.2.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -12032,11 +11083,6 @@ q@^1.1.2, q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - qs@6.7.0: version "6.7.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" @@ -12061,16 +11107,6 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - querystringify@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" @@ -12110,22 +11146,7 @@ randomatic@^3.0.0: kind-of "^6.0.0" math-random "^1.0.1" -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@^1.2.0, range-parser@^1.2.1, range-parser@~1.2.1: +range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== @@ -12249,7 +11270,17 @@ react-refresh@^0.4.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.2.tgz#54a277a6caaac2803d88f1d6f13c1dcfbd81e334" integrity sha512-kv5QlFFSZWo7OlJFNYbxRtY66JImuP2LcrFgyJfQaf85gSP+byzG21UbDQEYjU7f//ny8rwiEkO6py2Y+fEgAQ== -react-test-renderer@*, react-test-renderer@16.11.0, react-test-renderer@^16.0.0-0: +react-test-renderer@*, react-test-renderer@^16.0.0-0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.13.1.tgz#de25ea358d9012606de51e012d9742e7f0deabc1" + integrity sha512-Sn2VRyOK2YJJldOqoh8Tn/lWQ+ZiKhyZTPtaO0Q6yNj+QDbmRkVFap6pZPy3YQk8DScRDfyqm/KxKYP9gCMRiQ== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.19.1" + +react-test-renderer@16.11.0: version "16.11.0" resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.11.0.tgz#72574566496462c808ac449b0287a4c0a1a7d8f8" integrity sha512-nh9gDl8R4ut+ZNNb2EeKO5VMvTKxwzurbSMuGBoKtjpjbg8JK/u3eVPVNi1h1Ue+eYK9oSzJjb+K3lzLxyA4ag== @@ -12259,7 +11290,16 @@ react-test-renderer@*, react-test-renderer@16.11.0, react-test-renderer@^16.0.0- react-is "^16.8.6" scheduler "^0.17.0" -react@*, react@16.11.0, react@^16.8.4: +react@*, react@^16.8.4: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" + integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + +react@16.11.0: version "16.11.0" resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g== @@ -12373,7 +11413,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -12386,7 +11426,7 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1: +"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -12414,24 +11454,12 @@ readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - -readdirp@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.3.0.tgz#984458d13a1e42e2e9f5841b129e162f369aff17" - integrity sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ== +readdirp@~3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada" + integrity sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ== dependencies: - picomatch "^2.0.7" - -realpath-native@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" - integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== + picomatch "^2.2.1" rechoir@^0.6.2: version "0.6.2" @@ -12629,7 +11657,7 @@ request-promise-core@1.1.3: dependencies: lodash "^4.17.15" -request-promise-native@^1.0.7: +request-promise-native@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36" integrity sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ== @@ -12638,7 +11666,7 @@ request-promise-native@^1.0.7: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.53.0, request@^2.88.0: +request@^2.53.0, request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -12731,11 +11759,6 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.0, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" @@ -12781,11 +11804,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rfdc@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" - integrity sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug== - rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" @@ -12803,7 +11821,7 @@ rimraf@2.6.3: dependencies: glob "^7.1.3" -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -12822,14 +11840,6 @@ rimraf@~2.2.6: resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - rst-selector-parser@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" @@ -12844,11 +11854,9 @@ rsvp@^4.8.4: integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== run-async@^2.2.0, run-async@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8" - integrity sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg== - dependencies: - is-promise "^2.1.0" + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: version "1.1.9" @@ -12898,7 +11906,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== @@ -12947,12 +11955,12 @@ sax@^1.2.1, sax@^1.2.4, sax@~1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -saxes@^3.1.9: - version "3.1.11" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" - integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== +saxes@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" + integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== dependencies: - xmlchars "^2.1.1" + xmlchars "^2.2.0" scheduler@0.17.0, scheduler@^0.17.0: version "0.17.0" @@ -12962,22 +11970,13 @@ scheduler@0.17.0, scheduler@^0.17.0: loose-envify "^1.1.0" object-assign "^4.1.1" -schema-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" - integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== - dependencies: - ajv "^6.1.0" - ajv-errors "^1.0.0" - ajv-keywords "^3.1.0" - -schema-utils@^2.6.5: - version "2.6.5" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.5.tgz#c758f0a7e624263073d396e29cd40aa101152d8a" - integrity sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ== +scheduler@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" + integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== dependencies: - ajv "^6.12.0" - ajv-keywords "^3.4.1" + loose-envify "^1.1.0" + object-assign "^4.1.1" seek-bzip@^1.0.5: version "1.0.5" @@ -13018,6 +12017,11 @@ semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.2.1, semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -13042,11 +12046,6 @@ serialize-error@^2.1.0: resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a" integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= -serialize-javascript@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" - integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== - serve-static@1.14.1, serve-static@^1.13.1: version "1.14.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" @@ -13087,7 +12086,7 @@ setimmediate-napi@^1.0.3: get-symbol-from-current-process-h "^1.0.1" get-uv-event-loop-napi-h "^1.0.5" -setimmediate@^1.0.4, setimmediate@^1.0.5: +setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= @@ -13097,14 +12096,6 @@ setprototypeof@1.1.1: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -13152,9 +12143,9 @@ shell-quote@1.7.2, shell-quote@^1.6.1: integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== shelljs@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" - integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A== + version "0.8.4" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" + integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -13273,52 +12264,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -socket.io-adapter@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9" - integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g== - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - sockjs-client@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.4.0.tgz#c9f2568e19c8fd8173b4997ea3420e0bb306c7d5" @@ -13368,11 +12313,6 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -13384,10 +12324,10 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.16, source-map-support@~0.5.12: - version "0.5.16" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" - integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== +source-map-support@^0.5.16: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -13436,9 +12376,9 @@ spdx-correct@^3.0.0: spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== spdx-expression-parse@^3.0.0: version "3.0.0" @@ -13520,6 +12460,13 @@ stack-utils@^1.0.1: resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== +stack-utils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.2.tgz#5cf48b4557becb4638d0bc4f21d23f5d19586593" + integrity sha512-0H7QK2ECz3fyZMzQ8rH0j2ykpfbnd20BFtfg/SqVC2+sCTtcw0aDTGB7dk+de4U4uUeuz6nOtJcrkFFLG1B0Rg== + dependencies: + escape-string-regexp "^2.0.0" + stacktrace-parser@^0.1.3: version "0.1.9" resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.9.tgz#11e6d61d42e8cfc87293143d0766408b7a87b00f" @@ -13550,14 +12497,6 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - stream-buffers@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" @@ -13578,33 +12517,11 @@ stream-events@^1.0.5: dependencies: stubs "^3.0.0" -stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - stream-shift@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -streamroller@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-1.0.6.tgz#8167d8496ed9f19f05ee4b158d9611321b8cacd9" - integrity sha512-3QC47Mhv3/aZNFpDDVO44qQb9gwB9QggMEE0sQmkTAwBVYdBRWISdsywlkfm5II1Q5y/pmrHflti/IgmIzdDBg== - dependencies: - async "^2.6.2" - date-format "^2.0.0" - debug "^3.2.6" - fs-extra "^7.0.1" - lodash "^4.17.14" - strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -13618,6 +12535,14 @@ string-length@^3.1.0: astral-regex "^1.0.0" strip-ansi "^5.2.0" +string-length@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1" + integrity sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" @@ -13718,7 +12643,7 @@ string_decoder@0.10: resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= -string_decoder@^1.0.0, string_decoder@^1.1.1: +string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -13811,11 +12736,6 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - strip-json-comments@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.0.tgz#7638d31422129ecf4457440009fba03f9f9ac180" @@ -13852,16 +12772,9 @@ stylehacks@^4.0.0: postcss-selector-parser "^3.0.0" sudo-prompt@^9.0.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/sudo-prompt/-/sudo-prompt-9.1.1.tgz#73853d729770392caec029e2470db9c221754db0" - integrity sha512-es33J1g2HjMpyAhz8lOR+ICmXXAqTuKbuXuUWLhOLew20oN9oUCgCJx615U/v7aioZg7IX5lIh9x34vwneu4pA== - -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" + version "9.2.1" + resolved "https://registry.yarnpkg.com/sudo-prompt/-/sudo-prompt-9.2.1.tgz#77efb84309c9ca489527a4e749f287e6bdd52afd" + integrity sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw== supports-color@^2.0.0: version "2.0.0" @@ -13921,7 +12834,7 @@ symbol-observable@1.0.1: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" integrity sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ= -symbol-tree@^3.2.2: +symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== @@ -13936,7 +12849,7 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -tapable@^1.0.0, tapable@^1.1.3: +tapable@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== @@ -13954,6 +12867,17 @@ tar-stream@^1.5.2: to-buffer "^1.1.1" xtend "^4.0.0" +tar-stream@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.2.tgz#6d5ef1a7e5783a95ff70b69b97455a5968dc1325" + integrity sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q== + dependencies: + bl "^4.0.1" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" @@ -13991,6 +12915,11 @@ temp-dir@^1.0.0: resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= +temp-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-2.0.0.tgz#bde92b05bdfeb1516e804c9c00ad45177f31321e" + integrity sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg== + temp-write@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-3.4.0.tgz#8cff630fb7e9da05f047c74ce4ce4d685457d492" @@ -14019,14 +12948,15 @@ tempfile@^2.0.0: temp-dir "^1.0.0" uuid "^3.0.1" -tempy@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/tempy/-/tempy-0.3.0.tgz#6f6c5b295695a16130996ad5ab01a8bd726e8bf8" - integrity sha512-WrH/pui8YCwmeiAoxV+lpRH9HpRtgBhSR2ViBPgpGb/wnYDzp21R4MN45fsCGvLROvY67o3byhJRYRONJyImVQ== +tempy@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/tempy/-/tempy-0.5.0.tgz#2785c89df39fcc4d1714fc554813225e1581d70b" + integrity sha512-VEY96x7gbIRfsxqsafy2l5yVxxp3PhwAGoWMyC2D2Zt5DmEv+2tGiPOrquNRpf21hhGnKLVEsuqleqiZmKG/qw== dependencies: - temp-dir "^1.0.0" - type-fest "^0.3.1" - unique-string "^1.0.0" + is-stream "^2.0.0" + temp-dir "^2.0.0" + type-fest "^0.12.0" + unique-string "^2.0.0" terminal-link@^2.0.0: version "2.1.1" @@ -14036,30 +12966,6 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser-webpack-plugin@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c" - integrity sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA== - dependencies: - cacache "^12.0.2" - find-cache-dir "^2.1.0" - is-wsl "^1.1.0" - schema-utils "^1.0.0" - serialize-javascript "^2.1.2" - source-map "^0.6.1" - terser "^4.1.2" - webpack-sources "^1.4.0" - worker-farm "^1.7.0" - -terser@^4.1.2: - version "4.6.11" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.11.tgz#12ff99fdd62a26de2a82f508515407eb6ccd8a9f" - integrity sha512-76Ynm7OXUG5xhOpblhytE7X58oeNSmC8xnNhjWVo8CksHit0U0kO4hfNbPrrYwowLWFgM2n9L176VNx2QaHmtA== - dependencies: - commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -14133,13 +13039,6 @@ timed-out@^4.0.0, timed-out@^4.0.1: resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= -timers-browserify@^2.0.4: - version "2.0.11" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.11.tgz#800b1f3eee272e5bc53ee465a04d0e804c31211f" - integrity sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ== - dependencies: - setimmediate "^1.0.4" - timsort@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" @@ -14162,7 +13061,7 @@ tiny-lr@^1.1.1: object-assign "^4.1.0" qs "^6.4.0" -tmp@0.0.33, tmp@0.0.x, tmp@^0.0.33: +tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== @@ -14181,16 +13080,6 @@ tmpl@1.0.x: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - to-buffer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" @@ -14267,6 +13156,13 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +tr46@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" + integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== + dependencies: + punycode "^2.1.1" + tree-node-cli@^1.2.5: version "1.3.0" resolved "https://registry.yarnpkg.com/tree-node-cli/-/tree-node-cli-1.3.0.tgz#f7c03e4d14c7b7c42412d3d2a605940102f192cd" @@ -14331,11 +13227,6 @@ tsutils@^3.17.1: dependencies: tslib "^1.8.1" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -14365,7 +13256,12 @@ type-fest@^0.11.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== -type-fest@^0.3.0, type-fest@^0.3.1: +type-fest@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.12.0.tgz#f57a27ab81c68d136a51fd71467eff94157fa1ee" + integrity sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg== + +type-fest@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== @@ -14405,10 +13301,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@^3.8.0-dev.20200111, typescript@^3.8.2: - version "3.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" - integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== +typescript@*, typescript@^3.9.2: + version "3.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9" + integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw== ua-parser-js@^0.7.18: version "0.7.21" @@ -14424,12 +13320,11 @@ uglify-es@^3.1.9: source-map "~0.6.1" uglify-js@^3.1.4: - version "3.8.1" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.8.1.tgz#43bb15ce6f545eaa0a64c49fd29375ea09fa0f93" - integrity sha512-W7KxyzeaQmZvUFbGj4+YFshhVrMBGSg2IbcYAjGWGvx8DHvJMclbTDMpffdxFUGPBHjIytk7KJUR/KUXstUGDw== + version "3.9.1" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.9.1.tgz#a56a71c8caa2d36b5556cc1fd57df01ae3491539" + integrity sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA== dependencies: commander "~2.20.3" - source-map "~0.6.1" uid-number@0.0.6: version "0.0.6" @@ -14441,20 +13336,15 @@ ultron@1.0.x: resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa" integrity sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po= -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - umask@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= unbzip2-stream@^1.0.9: - version "1.4.1" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.1.tgz#151b104af853df3efdaa135d8b1eca850a44b426" - integrity sha512-sgDYfSDPMsA4Hr2/w7vOlrJBlwzmyakk1+hW8ObLvxSp0LA36LcL2XItGvOT3OSblohSdevMuT8FQjLsqyy4sA== + version "1.4.2" + resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.2.tgz#84eb9e783b186d8fb397515fbb656f312f1a7dbf" + integrity sha512-pZMVAofMrrHX6Ik39hCk470kulCbmZ2SWfQLPmTWqfJV/oUm0gn1CblvHdUu4+54Je6Jq34x8kY6XjTy6dMkOg== dependencies: buffer "^5.2.1" through "^2.3.8" @@ -14536,12 +13426,12 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" -unique-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" - integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== dependencies: - crypto-random-string "^1.0.0" + crypto-random-string "^2.0.0" unist-util-is@^3.0.0: version "3.0.0" @@ -14655,14 +13545,6 @@ url-to-options@^1.0.1: resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - urlgrey@0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" @@ -14680,14 +13562,6 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -14710,20 +13584,6 @@ util.promisify@~1.0.0: has-symbols "^1.0.1" object.getownpropertydescriptors "^2.1.0" -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= - dependencies: - inherits "2.0.1" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -14734,6 +13594,11 @@ uuid@^3.0.1, uuid@^3.3.2, uuid@^3.3.3: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^7.0.2, uuid@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" + integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== + v8-compile-cache@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" @@ -14809,30 +13674,18 @@ vlq@^1.0.0: resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== -vm-browserify@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" - integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - -w3c-hr-time@^1.0.1: +w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== dependencies: browser-process-hrtime "^1.0.0" -w3c-xmlserializer@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" - integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== +w3c-xmlserializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" + integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== dependencies: - domexception "^1.0.1" - webidl-conversions "^4.0.2" xml-name-validator "^3.0.0" wait-for-expect@^1.3.0: @@ -14847,15 +13700,6 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" -watchpack@^1.6.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.1.tgz#280da0a8718592174010c078c7585a74cd8cd0e2" - integrity sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA== - dependencies: - chokidar "^2.1.8" - graceful-fs "^4.1.2" - neo-async "^2.5.0" - wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -14863,13 +13707,13 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -weak-napi@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/weak-napi/-/weak-napi-1.0.3.tgz#ff4dfa818db1c509ba4166530b42414ef74cbba6" - integrity sha512-cyqeMaYA5qI7RoZKAKvIHwEROEKDNxK7jXj3u56nF2rGBh+HFyhYmBb1/wAN4RqzRmkYKVVKQyqHpBoJjqtGUA== +weak-napi@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/weak-napi/-/weak-napi-2.0.1.tgz#406c69e4b6924b1b336e6c93e150334bd6e6e43e" + integrity sha512-5K6swEmuZrS8jjtXon9w0Q8qWUSxQYGSp5G4NUjDerNSPSmwBsb9+DXUbr6hAbrDUGFmjeLDRqxv/ma2OfZ1Xw== dependencies: - bindings "^1.3.0" - node-addon-api "^1.1.0" + node-addon-api "^3.0.0" + node-gyp-build "^4.2.1" setimmediate-napi "^1.0.3" webidl-conversions@^4.0.2: @@ -14877,61 +13721,15 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -webpack-dev-middleware@^3.7.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz#0019c3db716e3fa5cecbf64f2ab88a74bab331f3" - integrity sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw== - dependencies: - memory-fs "^0.4.1" - mime "^2.4.4" - mkdirp "^0.5.1" - range-parser "^1.2.1" - webpack-log "^2.0.0" - -webpack-log@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" - integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== - dependencies: - ansi-colors "^3.0.0" - uuid "^3.3.2" - -webpack-sources@^1.4.0, webpack-sources@^1.4.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" - integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" +webidl-conversions@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" + integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== -webpack@^4.28.4: - version "4.42.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.42.1.tgz#ae707baf091f5ca3ef9c38b884287cfe8f1983ef" - integrity sha512-SGfYMigqEfdGchGhFFJ9KyRpQKnipvEvjc1TwrXEPCM6H5Wywu10ka8o3KGrMzSMxMQKt8aCHUFh5DaQ9UmyRg== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/wasm-edit" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - acorn "^6.2.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" - chrome-trace-event "^1.0.2" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.3" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.3" - watchpack "^1.6.0" - webpack-sources "^1.4.1" +webidl-conversions@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" + integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== websocket-driver@>=0.5.1: version "0.7.3" @@ -14947,7 +13745,7 @@ websocket-extensions@>=0.1.1: resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: +whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== @@ -14964,7 +13762,7 @@ whatwg-fetch@>=0.10.0, whatwg-fetch@^3.0.0: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== -whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: +whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== @@ -14978,12 +13776,21 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +whatwg-url@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.0.0.tgz#37f256cb746398e19b107bd6ef820b4ae2d15871" + integrity sha512-41ou2Dugpij8/LPO5Pq64K5q++MnRCBpEHvQr26/mArEKTkCV5aoXIqyhuYtE0pkqScXwhf2JP57rkRTYM29lQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^2.0.0" + webidl-conversions "^5.0.0" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1.3.1, which@^1.2.1, which@^1.2.9, which@^1.3.1: +which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -14997,7 +13804,7 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wide-align@1.1.3, wide-align@^1.1.0: +wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== @@ -15026,12 +13833,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -worker-farm@^1.6.0, worker-farm@^1.7.0: +worker-farm@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== @@ -15151,19 +13953,10 @@ ws@^1.1.0, ws@^1.1.5: options ">=0.0.5" ultron "1.0.x" -ws@^7, ws@^7.0.0: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" +ws@^7, ws@^7.2.3: + version "7.2.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.5.tgz#abb1370d4626a5a9cd79d8de404aa18b3465d10d" + integrity sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA== x-is-string@^0.1.0: version "0.1.0" @@ -15205,7 +13998,7 @@ xmlbuilder@^9.0.7: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= -xmlchars@^2.1.1: +xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== @@ -15222,11 +14015,6 @@ xmldom@0.1.x: resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff" integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ== -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= - xpipe@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/xpipe/-/xpipe-1.0.5.tgz#8dd8bf45fc3f7f55f0e054b878f43a62614dafdf" @@ -15267,14 +14055,6 @@ yamljs@^0.2.1: argparse "^1.0.7" glob "^7.0.5" -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" @@ -15299,38 +14079,13 @@ yargs-parser@^15.0.1: decamelize "^1.2.0" yargs-parser@^18.1.1: - version "18.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1" - integrity sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ== + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - yargs@^12.0.5: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" @@ -15390,7 +14145,7 @@ yargs@^2.3.0: dependencies: wordwrap "0.0.2" -yauzl@^2.4.2: +yauzl@^2.10.0, yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= @@ -15398,11 +14153,6 @@ yauzl@^2.4.2: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= - zone.js@~0.10.2: version "0.10.3" resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.10.3.tgz#3e5e4da03c607c9dcd92e37dd35687a14a140c16"