From 966aab60faa1b0a8cfdd51b95bcca780c68001d7 Mon Sep 17 00:00:00 2001 From: Aftab Khan Date: Thu, 15 Feb 2018 23:33:19 +0530 Subject: [PATCH] Removing the mapCoverage condition on reading inlineSourceMaps. (#5177) * * Removed usage of mapCoverage on reading inline sourcemaps. * Removed usage of instrument check before saving file into cache. * Passing sourceMaps only for files on which the coverage was obtained * Updated the changelog * Removed usage of mapCoverage from codebase * * Maintaining internal mapCoverage, map only for files which are instrumented by us * Feat: Return sourcemap from babel-jest * Adding back retainLines * * Removed the mapCoverage from docs * Updated the integration testcases * Remove mapCoverage from code base and add deprecation warning * Get sourcemaps only for the files covered in testcases * Updated the condition in babel-jest to prevent breaking changes for the existing users * Added some tests for babel-jest --- CHANGELOG.md | 6 +- TestUtils.js | 1 - docs/Configuration.md | 28 - ...verage_transform_instrumented.test.js.snap | 78 ++ .../__snapshots__/show_config.test.js.snap | 1 - .../__tests__/coverage_remapping.test.js | 2 +- .../coverage_transform_instrumented.test.js | 41 + .../__tests__/stack_trace_source_maps.test.js | 23 + .../Preprocessor.js | 43 + .../__tests__/covered-test.js | 13 + .../covered.js | 12 + .../package.json | 20 + .../coverage-transform-instrumented/yarn.lock | 1152 +++++++++++++++++ .../snapshot_escape_substitution.test.js.snap | 3 + .../stack-trace-source-maps/Preprocessor.js | 21 + .../__tests__/fails.ts | 15 + .../stack-trace-source-maps/package.json | 14 + .../stack-trace-source-maps/yarn.lock | 7 + packages/babel-jest/src/__tests__/index.js | 74 ++ packages/babel-jest/src/index.js | 27 +- packages/jest-cli/src/cli/args.js | 2 +- .../jest-cli/src/generate_empty_coverage.js | 3 +- .../src/reporters/coverage_reporter.js | 14 +- packages/jest-config/src/defaults.js | 1 - packages/jest-config/src/deprecated.js | 8 +- packages/jest-config/src/index.js | 1 - packages/jest-config/src/valid_config.js | 1 - packages/jest-jasmine2/src/index.js | 5 +- packages/jest-runner/src/run_test.js | 5 +- .../script_transformer.test.js.snap | 1 - .../src/__tests__/script_transformer.test.js | 7 +- packages/jest-runtime/src/index.js | 17 +- .../jest-runtime/src/script_transformer.js | 73 +- types/Argv.js | 1 - types/Config.js | 2 - types/Transform.js | 5 +- 36 files changed, 1612 insertions(+), 115 deletions(-) create mode 100644 integration-tests/__tests__/__snapshots__/coverage_transform_instrumented.test.js.snap create mode 100644 integration-tests/__tests__/coverage_transform_instrumented.test.js create mode 100644 integration-tests/__tests__/stack_trace_source_maps.test.js create mode 100644 integration-tests/coverage-transform-instrumented/Preprocessor.js create mode 100644 integration-tests/coverage-transform-instrumented/__tests__/covered-test.js create mode 100644 integration-tests/coverage-transform-instrumented/covered.js create mode 100644 integration-tests/coverage-transform-instrumented/package.json create mode 100644 integration-tests/coverage-transform-instrumented/yarn.lock create mode 100644 integration-tests/snapshot-escape/__tests__/__snapshots__/snapshot_escape_substitution.test.js.snap create mode 100644 integration-tests/stack-trace-source-maps/Preprocessor.js create mode 100644 integration-tests/stack-trace-source-maps/__tests__/fails.ts create mode 100644 integration-tests/stack-trace-source-maps/package.json create mode 100644 integration-tests/stack-trace-source-maps/yarn.lock create mode 100644 packages/babel-jest/src/__tests__/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e19d82c71ed..440913d3b748 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ ### Features * `[docs]` Add MongoDB guide ([#5571](https://github.com/facebook/jest/pull/5571)) +* `[jest-runtime]` Deprecate mapCoverage option. + ([#5177](https://github.com/facebook/jest/pull/5177)) +* `[babel-jest]` Add option to return sourcemap from the transformer separately + from source. ([#5177](https://github.com/facebook/jest/pull/5177)) ## jest 22.3.0 @@ -1597,4 +1601,4 @@ See https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html ## <=0.4.0 -* See commit history for changes in previous versions of jest. +* See commit history for changes in previous versions of jest. \ No newline at end of file diff --git a/TestUtils.js b/TestUtils.js index e4f8476c4464..0050dd123c77 100644 --- a/TestUtils.js +++ b/TestUtils.js @@ -32,7 +32,6 @@ const DEFAULT_GLOBAL_CONFIG: GlobalConfig = { lastCommit: false, listTests: false, logHeapUsage: false, - mapCoverage: false, maxWorkers: 2, noSCM: null, noStackTrace: false, diff --git a/docs/Configuration.md b/docs/Configuration.md index e38ac19a510e..88a23ae1a1ad 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -313,34 +313,6 @@ Default: `undefined` This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites. -### `mapCoverage` [boolean] - -##### available in Jest **20.0.0+** - -Default: `false` - -If you have [transformers](#transform-object-string-string) configured that emit -source maps, Jest will use them to try and map code coverage against the -original source code when writing [reports](#coveragereporters-array-string) and -checking [thresholds](#coveragethreshold-object). This is done on a best-effort -basis as some compile-to-JavaScript languages may provide more accurate source -maps than others. This can also be resource-intensive. If Jest is taking a long -time to calculate coverage at the end of a test run, try setting this option to -`false`. - -Both inline source maps and source maps returned directly from a transformer are -supported. Source map URLs are not supported because Jest may not be able to -locate them. To return source maps from a transformer, the `process` function -can return an object like the following. The `map` property may either be the -source map object, or the source map object as a string. - -```js -return { - code: 'the code', - map: 'the source map', -}; -``` - ### `moduleFileExtensions` [array] Default: `["js", "json", "jsx", "node"]` diff --git a/integration-tests/__tests__/__snapshots__/coverage_transform_instrumented.test.js.snap b/integration-tests/__tests__/__snapshots__/coverage_transform_instrumented.test.js.snap new file mode 100644 index 000000000000..42ff385fe8ff --- /dev/null +++ b/integration-tests/__tests__/__snapshots__/coverage_transform_instrumented.test.js.snap @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`code coverage for transform instrumented code 1`] = ` +Object { + "covered.js": Object { + "_coverageSchema": "332fd63041d2c1bcb487cc26dd0d5f7d97098a6c", + "b": Object {}, + "branchMap": Object {}, + "f": Object { + "0": 1, + }, + "fnMap": Object { + "0": Object { + "decl": Object { + "end": Object { + "column": 36, + "line": 9, + }, + "start": Object { + "column": 26, + "line": 9, + }, + }, + "line": 9, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 58, + "line": 9, + }, + }, + "name": "doES6Stuff", + }, + }, + "path": "covered.js", + "s": Object { + "0": 1, + "1": 1, + "2": 1, + }, + "statementMap": Object { + "0": Object { + "end": Object { + "column": 2, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "1": Object { + "end": Object { + "column": 41, + "line": 10, + }, + "start": Object { + "column": 34, + "line": 10, + }, + }, + "2": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + }, + }, +} +`; diff --git a/integration-tests/__tests__/__snapshots__/show_config.test.js.snap b/integration-tests/__tests__/__snapshots__/show_config.test.js.snap index 0d9f5b139263..63b0a5ea04a5 100644 --- a/integration-tests/__tests__/__snapshots__/show_config.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/show_config.test.js.snap @@ -75,7 +75,6 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"globalSetup\\": null, \\"globalTeardown\\": null, \\"listTests\\": false, - \\"mapCoverage\\": false, \\"maxWorkers\\": \\"[maxWorkers]\\", \\"noStackTrace\\": false, \\"nonFlagArgs\\": [], diff --git a/integration-tests/__tests__/coverage_remapping.test.js b/integration-tests/__tests__/coverage_remapping.test.js index 15d5f8b1a09a..676a0f07e29a 100644 --- a/integration-tests/__tests__/coverage_remapping.test.js +++ b/integration-tests/__tests__/coverage_remapping.test.js @@ -23,7 +23,7 @@ beforeAll(() => { it('maps code coverage against original source', () => { run('yarn', dir); - const result = runJest(dir, ['--coverage', '--mapCoverage', '--no-cache']); + const result = runJest(dir, ['--coverage', '--no-cache']); expect(result.status).toBe(0); diff --git a/integration-tests/__tests__/coverage_transform_instrumented.test.js b/integration-tests/__tests__/coverage_transform_instrumented.test.js new file mode 100644 index 000000000000..47aad1f84c83 --- /dev/null +++ b/integration-tests/__tests__/coverage_transform_instrumented.test.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + * + * @flow + */ + +'use strict'; + +const {readFileSync} = require('fs'); +const path = require('path'); +const {cleanup, run} = require('../Utils'); +const runJest = require('../runJest'); + +const dir = path.resolve(__dirname, '../coverage-transform-instrumented'); +const coverageDir = path.join(dir, 'coverage'); + +beforeAll(() => { + cleanup(coverageDir); +}); + +it('code coverage for transform instrumented code', () => { + run('yarn', dir); + const result = runJest(dir, ['--coverage', '--no-cache']); + + expect(result.status).toBe(0); + + const coverageMapFile = path.join(coverageDir, 'coverage-final.json'); + const coverageMap = JSON.parse(readFileSync(coverageMapFile, 'utf-8')); + + // reduce absolute paths embedded in the coverage map to just filenames + Object.keys(coverageMap).forEach(filename => { + coverageMap[filename].path = path.basename(coverageMap[filename].path); + delete coverageMap[filename].hash; + coverageMap[path.basename(filename)] = coverageMap[filename]; + delete coverageMap[filename]; + }); + expect(coverageMap).toMatchSnapshot(); +}); diff --git a/integration-tests/__tests__/stack_trace_source_maps.test.js b/integration-tests/__tests__/stack_trace_source_maps.test.js new file mode 100644 index 000000000000..4d990fb74555 --- /dev/null +++ b/integration-tests/__tests__/stack_trace_source_maps.test.js @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + * + * @flow + */ + +'use strict'; + +const path = require('path'); +const {run} = require('../Utils'); +const runJest = require('../runJest'); + +it('processes stack traces and code frames with source maps', () => { + const dir = path.resolve(__dirname, '../stack-trace-source-maps'); + run('yarn', dir); + const {stderr} = runJest(dir, ['--no-cache']); + expect(stderr).toMatch('> 14 | (() => expect(false).toBe(true))();'); + expect(stderr).toMatch(`at __tests__/fails.ts:14:24 + at Object. (__tests__/fails.ts:14:35)`); +}); diff --git a/integration-tests/coverage-transform-instrumented/Preprocessor.js b/integration-tests/coverage-transform-instrumented/Preprocessor.js new file mode 100644 index 000000000000..244c940e3be2 --- /dev/null +++ b/integration-tests/coverage-transform-instrumented/Preprocessor.js @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + */ + +const jestPreset = require('babel-preset-jest'); +const babelTransform = require('babel-core').transform; +const babelIstanbulPlugin = require('babel-plugin-istanbul').default; + +const options = { + presets: ['env', jestPreset], + retainLines: true, + sourceMaps: 'inline', +}; + +module.exports = { + canInstrument: true, + process(src, filename, config, transformOptions) { + options.filename = filename; + if (transformOptions && transformOptions.instrument) { + options.auxiliaryCommentBefore = ' istanbul ignore next '; + options.plugins = [ + [ + babelIstanbulPlugin, + { + cwd: config.rootDir, + exclude: [], + }, + ], + ]; + } + + const transformResult = babelTransform(src, options); + + if (!transformResult) { + return src; + } + + return transformResult.code; + }, +}; diff --git a/integration-tests/coverage-transform-instrumented/__tests__/covered-test.js b/integration-tests/coverage-transform-instrumented/__tests__/covered-test.js new file mode 100644 index 000000000000..62222b4084ef --- /dev/null +++ b/integration-tests/coverage-transform-instrumented/__tests__/covered-test.js @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + */ + +const doES6Stuff = require('../covered.js'); + +it('works correctly', () => { + const someObj = {someNumber: 10, this: 'is irrelevant'}; + expect(doES6Stuff(someObj, 2)).toBe(20); +}); diff --git a/integration-tests/coverage-transform-instrumented/covered.js b/integration-tests/coverage-transform-instrumented/covered.js new file mode 100644 index 000000000000..ca8531dcc468 --- /dev/null +++ b/integration-tests/coverage-transform-instrumented/covered.js @@ -0,0 +1,12 @@ +/* eslint-disable no-unused-vars */ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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 = function doES6Stuff(testObj, multiplier) { + const {someNumber, ...others} = testObj; + return someNumber * multiplier; +}; diff --git a/integration-tests/coverage-transform-instrumented/package.json b/integration-tests/coverage-transform-instrumented/package.json new file mode 100644 index 000000000000..b5263f057316 --- /dev/null +++ b/integration-tests/coverage-transform-instrumented/package.json @@ -0,0 +1,20 @@ +{ + "jest": { + "rootDir": "./", + "transform": { + "^.+\\.(js)$": "/Preprocessor.js" + }, + "testRegex": "/__tests__/.*\\.(js)$", + "testEnvironment": "node", + "moduleFileExtensions": ["js"] + }, + "babel": { + "presets": ["env"] + }, + "dependencies": { + "babel-core": "6.26.0", + "babel-plugin-istanbul": "4.1.5", + "babel-preset-env": "1.6.1", + "babel-preset-jest": "22.2.0" + } +} diff --git a/integration-tests/coverage-transform-instrumented/yarn.lock b/integration-tests/coverage-transform-instrumented/yarn.lock new file mode 100644 index 000000000000..5b32161c2f00 --- /dev/null +++ b/integration-tests/coverage-transform-instrumented/yarn.lock @@ -0,0 +1,1152 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@6.26.0, babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.5" + test-exclude "^4.1.1" + +babel-plugin-jest-hoist@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.2.0.tgz#bd34f39d652406669713b8c89e23ef25c890b993" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-preset-env@1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^2.1.2" + invariant "^2.2.2" + semver "^5.3.0" + +babel-preset-jest@22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.2.0.tgz#f77b43f06ef4d8547214b2e206cc76a25c3ba0e2" + dependencies: + babel-plugin-jest-hoist "^22.2.0" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browserslist@^2.1.2: + version "2.11.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2" + dependencies: + caniuse-lite "^1.0.30000792" + electron-to-chromium "^1.3.30" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +caniuse-lite@^1.0.30000792: + version "1.0.30000807" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000807.tgz#51ea478d07269e9dd4d8c639509df61d2516fa92" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +convert-source-map@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" + +debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +electron-to-chromium@^1.3.30: + version "1.3.33" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.33.tgz#bf00703d62a7c65238136578c352d6c5c042a545" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + +invariant@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-instrument@^1.7.5: + version "1.9.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.17.4: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +p-limit@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +private@^0.1.6, private@^0.1.7: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerate@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" diff --git a/integration-tests/snapshot-escape/__tests__/__snapshots__/snapshot_escape_substitution.test.js.snap b/integration-tests/snapshot-escape/__tests__/__snapshots__/snapshot_escape_substitution.test.js.snap new file mode 100644 index 000000000000..5763722d1fa8 --- /dev/null +++ b/integration-tests/snapshot-escape/__tests__/__snapshots__/snapshot_escape_substitution.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`escape substitution 1`] = `"\${banana}"`; diff --git a/integration-tests/stack-trace-source-maps/Preprocessor.js b/integration-tests/stack-trace-source-maps/Preprocessor.js new file mode 100644 index 000000000000..73a6a30fc215 --- /dev/null +++ b/integration-tests/stack-trace-source-maps/Preprocessor.js @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + */ + +const tsc = require('typescript'); + +module.exports = { + process(src, path) { + return tsc.transpileModule(src, { + compilerOptions: { + inlineSourceMap: true, + module: tsc.ModuleKind.CommonJS, + target: 'es5', + }, + fileName: path, + }).outputText; + }, +}; diff --git a/integration-tests/stack-trace-source-maps/__tests__/fails.ts b/integration-tests/stack-trace-source-maps/__tests__/fails.ts new file mode 100644 index 000000000000..27f15b3ab110 --- /dev/null +++ b/integration-tests/stack-trace-source-maps/__tests__/fails.ts @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + */ +interface NotUsedButTakesUpLines { + a: number; + b: string; +} + +it('fails', () => { + // wrapped in arrow function for character offset + (() => expect(false).toBe(true))(); +}); diff --git a/integration-tests/stack-trace-source-maps/package.json b/integration-tests/stack-trace-source-maps/package.json new file mode 100644 index 000000000000..cb29f0b9a69a --- /dev/null +++ b/integration-tests/stack-trace-source-maps/package.json @@ -0,0 +1,14 @@ +{ + "jest": { + "rootDir": "./", + "transform": { + "^.+\\.(ts)$": "/Preprocessor.js" + }, + "testEnvironment": "node", + "moduleFileExtensions": ["ts", "js"], + "testRegex": "fails" + }, + "dependencies": { + "typescript": "^2.7.1" + } +} diff --git a/integration-tests/stack-trace-source-maps/yarn.lock b/integration-tests/stack-trace-source-maps/yarn.lock new file mode 100644 index 000000000000..c0556dcccc9b --- /dev/null +++ b/integration-tests/stack-trace-source-maps/yarn.lock @@ -0,0 +1,7 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1.tgz#bb3682c2c791ac90e7c6210b26478a8da085c359" diff --git a/packages/babel-jest/src/__tests__/index.js b/packages/babel-jest/src/__tests__/index.js new file mode 100644 index 000000000000..38423c2c1ff1 --- /dev/null +++ b/packages/babel-jest/src/__tests__/index.js @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. 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. + */ +const babelJest = require('../index'); + +//Mock canCompile to always return true +const babelCore = require('babel-core'); +babelCore.util = { + canCompile: () => true, +}; + +//Mock data for all the tests +const sourceString = ` +const sum = (a, b) => a+b; +const difference = (a, b) => a-b; + +const customMultiply = (obj, mul) => { + const {a, ...rest} = obj; + return a * mul; +} + +customMultiply({a: 32, dummy: "test"}, 2); +`; + +const mockConfig = { + moduleFileExtensions: [], +}; + +test(`Returns source string with inline maps when no transformOptions is passed`, () => { + const result = babelJest.process(sourceString, 'dummy_path.js', mockConfig); + expect(typeof result).toBe('string'); + expect(result).toMatch('//# sourceMappingURL'); + expect(result).toMatch('customMultiply'); +}); + +test(`Returns source string with inline maps when transformOptions + is passed but doesn't have returnSourceString passed`, () => { + const result = babelJest.process( + sourceString, + 'dummy_path.js', + mockConfig, + {}, + ); + expect(typeof result).toBe('string'); + expect(result).toMatch('//# sourceMappingURL'); + expect(result).toMatch('customMultiply'); +}); + +test(`Returns source string with inline maps when transformOptions + is passed and returnSourceString is true`, () => { + const result = babelJest.process(sourceString, 'dummy_path.js', mockConfig, { + returnSourceString: true, + }); + expect(typeof result).toBe('string'); + expect(result).toMatch('//# sourceMappingURL'); + expect(result).toMatch('customMultiply'); +}); + +test(`Returns source string with inline maps when transformOptions + is passed and returnSourceString is false`, () => { + const result = babelJest.process(sourceString, 'dummy_path.js', mockConfig, { + returnSourceString: false, + }); + expect(typeof result).toBe('object'); + expect(result.code).toBeDefined(); + expect(result.map).toBeDefined(); + expect(result.code).toMatch('//# sourceMappingURL'); + expect(result.code).toMatch('customMultiply'); + expect(result.map.sources).toEqual(['dummy_path.js']); + expect(JSON.stringify(result.map.sourcesContent)).toMatch('customMultiply'); +}); diff --git a/packages/babel-jest/src/index.js b/packages/babel-jest/src/index.js index 4dd71bacbe87..810abb73a579 100644 --- a/packages/babel-jest/src/index.js +++ b/packages/babel-jest/src/index.js @@ -8,7 +8,12 @@ */ import type {Path, ProjectConfig} from 'types/Config'; -import type {CacheKeyOptions, TransformOptions} from 'types/Transform'; +import type { + CacheKeyOptions, + Transformer, + TransformOptions, + TransformedSource, +} from 'types/Transform'; import crypto from 'crypto'; import fs from 'fs'; @@ -23,7 +28,7 @@ const BABEL_CONFIG_KEY = 'babel'; const PACKAGE_JSON = 'package.json'; const THIS_FILE = fs.readFileSync(__filename); -const createTransformer = (options: any) => { +const createTransformer = (options: any): Transformer => { const cache = Object.create(null); const getBabelRC = filename => { @@ -70,7 +75,7 @@ const createTransformer = (options: any) => { plugins: (options && options.plugins) || [], presets: ((options && options.presets) || []).concat([jestPreset]), retainLines: true, - sourceMaps: 'inline', + sourceMaps: 'both', }); delete options.cacheDirectory; delete options.filename; @@ -102,8 +107,8 @@ const createTransformer = (options: any) => { src: string, filename: Path, config: ProjectConfig, - transformOptions: TransformOptions, - ): string { + transformOptions?: TransformOptions, + ): string | TransformedSource { const altExts = config.moduleFileExtensions.map( extension => '.' + extension, ); @@ -129,7 +134,17 @@ const createTransformer = (options: any) => { // babel v7 might return null in the case when the file has been ignored. const transformResult = babelTransform(src, theseOptions); - return transformResult ? transformResult.code : src; + + if (!transformResult) { + return src; + } + + const shouldReturnCodeOnly = + transformOptions == null || + transformOptions.returnSourceString == null || + transformOptions.returnSourceString === true; + + return shouldReturnCodeOnly ? transformResult.code : transformResult; }, }; }; diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index 6dbacfd14138..41f3ce44e0c4 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -307,7 +307,7 @@ export const options = { default: undefined, description: 'Maps code coverage reports against original source code ' + - 'when transformers supply source maps.', + 'when transformers supply source maps.\n\nDEPRECATED', type: 'boolean', }, maxWorkers: { diff --git a/packages/jest-cli/src/generate_empty_coverage.js b/packages/jest-cli/src/generate_empty_coverage.js index 17b83e2d0148..87be42cf3656 100644 --- a/packages/jest-cli/src/generate_empty_coverage.js +++ b/packages/jest-cli/src/generate_empty_coverage.js @@ -27,14 +27,13 @@ export default function( collectCoverage: globalConfig.collectCoverage, collectCoverageFrom: globalConfig.collectCoverageFrom, collectCoverageOnlyFrom: globalConfig.collectCoverageOnlyFrom, - mapCoverage: globalConfig.mapCoverage, }; if (Runtime.shouldInstrument(filename, coverageOptions, config)) { // Transform file without instrumentation first, to make sure produced // source code is ES6 (no flowtypes etc.) and can be instrumented const transformResult = new Runtime.ScriptTransformer( config, - ).transformSource(filename, source, false, globalConfig.mapCoverage); + ).transformSource(filename, source, false); const instrumenter = createInstrumenter(); instrumenter.instrumentSync(transformResult.code, filename); return { diff --git a/packages/jest-cli/src/reporters/coverage_reporter.js b/packages/jest-cli/src/reporters/coverage_reporter.js index e95761fe5899..4fa08a4f0a9d 100644 --- a/packages/jest-cli/src/reporters/coverage_reporter.js +++ b/packages/jest-cli/src/reporters/coverage_reporter.js @@ -58,9 +58,11 @@ export default class CoverageReporter extends BaseReporter { delete testResult.coverage; Object.keys(testResult.sourceMaps).forEach(sourcePath => { - let coverage: FileCoverage, inputSourceMap: ?Object; + let inputSourceMap: ?Object; try { - coverage = this._coverageMap.fileCoverageFor(sourcePath); + const coverage: FileCoverage = this._coverageMap.fileCoverageFor( + sourcePath, + ); ({inputSourceMap} = coverage.toJSON()); } finally { if (inputSourceMap) { @@ -81,11 +83,9 @@ export default class CoverageReporter extends BaseReporter { aggregatedResults: AggregatedResult, ) { await this._addUntestedFiles(this._globalConfig, contexts); - let map = this._coverageMap; - let sourceFinder: Object; - if (this._globalConfig.mapCoverage) { - ({map, sourceFinder} = this._sourceMapStore.transformCoverage(map)); - } + const {map, sourceFinder} = this._sourceMapStore.transformCoverage( + this._coverageMap, + ); const reporter = createReporter(); try { diff --git a/packages/jest-config/src/defaults.js b/packages/jest-config/src/defaults.js index c839cc2af09a..29a74310d386 100644 --- a/packages/jest-config/src/defaults.js +++ b/packages/jest-config/src/defaults.js @@ -46,7 +46,6 @@ export default ({ haste: { providesModuleNodeModules: [], }, - mapCoverage: false, moduleDirectories: ['node_modules'], moduleFileExtensions: ['js', 'json', 'jsx', 'node'], moduleNameMapper: {}, diff --git a/packages/jest-config/src/deprecated.js b/packages/jest-config/src/deprecated.js index 2914996bb318..907cb2705924 100644 --- a/packages/jest-config/src/deprecated.js +++ b/packages/jest-config/src/deprecated.js @@ -13,6 +13,12 @@ import prettyFormat from 'pretty-format'; const format = (value: mixed) => prettyFormat(value, {min: true}); export default { + mapCoverage: () => ` Option ${chalk.bold( + '"mapCoverage"', + )} has been removed, as it's no longer necessary. + + Please update your configuration.`, + preprocessorIgnorePatterns: (options: { preprocessorIgnorePatterns: Array, }) => ` Option ${chalk.bold( @@ -24,7 +30,7 @@ export default { Jest now treats your current configuration as: { ${chalk.bold('"transformIgnorePatterns"')}: ${chalk.bold( - `${format(options.preprocessorIgnorePatterns)}`, + format(options.preprocessorIgnorePatterns), )} } diff --git a/packages/jest-config/src/index.js b/packages/jest-config/src/index.js index 57a647fdb0b7..dc37e4d16158 100644 --- a/packages/jest-config/src/index.js +++ b/packages/jest-config/src/index.js @@ -112,7 +112,6 @@ const getConfigs = ( lastCommit: options.lastCommit, listTests: options.listTests, logHeapUsage: options.logHeapUsage, - mapCoverage: options.mapCoverage, maxWorkers: options.maxWorkers, noSCM: undefined, noStackTrace: options.noStackTrace, diff --git a/packages/jest-config/src/valid_config.js b/packages/jest-config/src/valid_config.js index 9c6a60850c53..dab85ee45587 100644 --- a/packages/jest-config/src/valid_config.js +++ b/packages/jest-config/src/valid_config.js @@ -49,7 +49,6 @@ export default ({ json: false, lastCommit: false, logHeapUsage: true, - mapCoverage: false, moduleDirectories: ['node_modules'], moduleFileExtensions: ['js', 'json', 'jsx', 'node'], moduleLoader: '', diff --git a/packages/jest-jasmine2/src/index.js b/packages/jest-jasmine2/src/index.js index ed12771f958d..38422b08d5b2 100644 --- a/packages/jest-jasmine2/src/index.js +++ b/packages/jest-jasmine2/src/index.js @@ -117,7 +117,10 @@ async function jasmine2( } runtime - .requireModule(require.resolve('source-map-support'), 'source-map-support') + .requireInternalModule( + require.resolve('source-map-support'), + 'source-map-support', + ) .install({ environment: 'node', handleUncaughtExceptions: false, diff --git a/packages/jest-runner/src/run_test.js b/packages/jest-runner/src/run_test.js index 91315d541a95..0a225dbaad1f 100644 --- a/packages/jest-runner/src/run_test.js +++ b/packages/jest-runner/src/run_test.js @@ -105,7 +105,6 @@ async function runTestInternal( collectCoverage: globalConfig.collectCoverage, collectCoverageFrom: globalConfig.collectCoverageFrom, collectCoverageOnlyFrom: globalConfig.collectCoverageOnlyFrom, - mapCoverage: globalConfig.mapCoverage, }); const start = Date.now(); @@ -124,7 +123,9 @@ async function runTestInternal( result.perfStats = {end: Date.now(), start}; result.testFilePath = path; result.coverage = runtime.getAllCoverageInfoCopy(); - result.sourceMaps = runtime.getSourceMapInfo(); + result.sourceMaps = runtime.getSourceMapInfo( + new Set(Object.keys(result.coverage || {})), + ); result.console = testConsole.getBuffer(); result.skipped = testCount === result.numPendingTests; result.displayName = config.displayName; diff --git a/packages/jest-runtime/src/__tests__/__snapshots__/script_transformer.test.js.snap b/packages/jest-runtime/src/__tests__/__snapshots__/script_transformer.test.js.snap index f49522301150..87cfb4a9b77d 100644 --- a/packages/jest-runtime/src/__tests__/__snapshots__/script_transformer.test.js.snap +++ b/packages/jest-runtime/src/__tests__/__snapshots__/script_transformer.test.js.snap @@ -3,7 +3,6 @@ exports[`ScriptTransformer passes expected transform options to getCacheKey 1`] = ` Object { "instrument": true, - "mapCoverage": true, "rootDir": "/", } `; diff --git a/packages/jest-runtime/src/__tests__/script_transformer.test.js b/packages/jest-runtime/src/__tests__/script_transformer.test.js index 4e4da13c9d40..a7b74ffb95c6 100644 --- a/packages/jest-runtime/src/__tests__/script_transformer.test.js +++ b/packages/jest-runtime/src/__tests__/script_transformer.test.js @@ -318,7 +318,6 @@ describe('ScriptTransformer', () => { const result = scriptTransformer.transform('/fruits/banana.js', { collectCoverage: true, - mapCoverage: true, }); expect(result.sourceMapPath).toEqual(expect.any(String)); const mapStr = JSON.stringify(map); @@ -347,7 +346,6 @@ describe('ScriptTransformer', () => { const result = scriptTransformer.transform('/fruits/banana.js', { collectCoverage: true, - mapCoverage: true, }); expect(result.sourceMapPath).toEqual(expect.any(String)); expect(writeFileAtomic.sync).toBeCalledWith( @@ -357,7 +355,7 @@ describe('ScriptTransformer', () => { ); }); - it.skip('writes source maps if given by the transformer', () => { + it('writes source maps if given by the transformer', () => { config = Object.assign(config, { transform: [['^.+\\.js$', 'preprocessor-with-sourcemaps']], }); @@ -375,7 +373,6 @@ describe('ScriptTransformer', () => { const result = scriptTransformer.transform('/fruits/banana.js', { collectCoverage: true, - mapCoverage: false, }); expect(result.sourceMapPath).toEqual(expect.any(String)); expect(writeFileAtomic.sync).toBeCalledWith( @@ -400,7 +397,6 @@ describe('ScriptTransformer', () => { const result = scriptTransformer.transform('/fruits/banana.js', { collectCoverage: true, - mapCoverage: false, }); expect(result.sourceMapPath).toBeFalsy(); expect(writeFileAtomic.sync).toHaveBeenCalledTimes(1); @@ -414,7 +410,6 @@ describe('ScriptTransformer', () => { scriptTransformer.transform('/fruits/banana.js', { collectCoverage: true, - mapCoverage: true, }); const {getCacheKey} = require('test_preprocessor'); diff --git a/packages/jest-runtime/src/index.js b/packages/jest-runtime/src/index.js index cc1084ff1795..a75e091d5e78 100644 --- a/packages/jest-runtime/src/index.js +++ b/packages/jest-runtime/src/index.js @@ -55,7 +55,6 @@ type CoverageOptions = { collectCoverage: boolean, collectCoverageFrom: Array, collectCoverageOnlyFrom: ?{[key: string]: boolean, __proto__: null}, - mapCoverage: boolean, }; type ModuleRegistry = {[key: string]: Module, __proto__: null}; @@ -96,6 +95,7 @@ class Runtime { _mockRegistry: {[key: string]: any, __proto__: null}; _moduleMocker: ModuleMocker; _moduleRegistry: ModuleRegistry; + _needsCoverageMapped: Set; _resolver: Resolver; _shouldAutoMock: boolean; _shouldMockModuleCache: BooleanObject; @@ -119,7 +119,6 @@ class Runtime { collectCoverage: false, collectCoverageFrom: [], collectCoverageOnlyFrom: null, - mapCoverage: false, }; this._currentlyExecutingModulePath = ''; this._environment = environment; @@ -130,6 +129,7 @@ class Runtime { this._mockRegistry = Object.create(null); this._moduleMocker = this._environment.moduleMocker; this._moduleRegistry = Object.create(null); + this._needsCoverageMapped = new Set(); this._resolver = resolver; this._scriptTransformer = new ScriptTransformer(config); this._shouldAutoMock = config.automock; @@ -181,7 +181,6 @@ class Runtime { collectCoverage: options.collectCoverage, collectCoverageFrom: options.collectCoverageFrom, collectCoverageOnlyFrom: options.collectCoverageOnlyFrom, - mapCoverage: options.mapCoverage, }, config, ); @@ -437,9 +436,13 @@ class Runtime { return deepCyclicCopy(this._environment.global.__coverage__); } - getSourceMapInfo() { + getSourceMapInfo(coveredFiles: Set) { return Object.keys(this._sourceMapRegistry).reduce((result, sourcePath) => { - if (fs.existsSync(this._sourceMapRegistry[sourcePath])) { + if ( + coveredFiles.has(sourcePath) && + this._needsCoverageMapped.has(sourcePath) && + fs.existsSync(this._sourceMapRegistry[sourcePath]) + ) { result[sourcePath] = this._sourceMapRegistry[sourcePath]; } return result; @@ -526,13 +529,15 @@ class Runtime { collectCoverageFrom: this._coverageOptions.collectCoverageFrom, collectCoverageOnlyFrom: this._coverageOptions.collectCoverageOnlyFrom, isInternalModule, - mapCoverage: this._coverageOptions.mapCoverage, }, this._cacheFS[filename], ); if (transformedFile.sourceMapPath) { this._sourceMapRegistry[filename] = transformedFile.sourceMapPath; + if (transformedFile.mapCoverage) { + this._needsCoverageMapped.add(filename); + } } const wrapper = this._environment.runScript(transformedFile.script)[ diff --git a/packages/jest-runtime/src/script_transformer.js b/packages/jest-runtime/src/script_transformer.js index 9cd85d276d44..019cf2718e4b 100644 --- a/packages/jest-runtime/src/script_transformer.js +++ b/packages/jest-runtime/src/script_transformer.js @@ -36,7 +36,6 @@ export type Options = {| collectCoverageOnlyFrom: ?{[key: string]: boolean, __proto__: null}, isCoreModule?: boolean, isInternalModule?: boolean, - mapCoverage: boolean, |}; const cache: Map = new Map(); @@ -57,12 +56,7 @@ export default class ScriptTransformer { this._transformCache = new Map(); } - _getCacheKey( - fileData: string, - filename: Path, - instrument: boolean, - mapCoverage: boolean, - ): string { + _getCacheKey(fileData: string, filename: Path, instrument: boolean): string { if (!configToJsonMap.has(this._config)) { // We only need this set of config options that can likely influence // cached output instead of all config options. @@ -77,7 +71,6 @@ export default class ScriptTransformer { .update( transformer.getCacheKey(fileData, filename, configString, { instrument, - mapCoverage, rootDir: this._config.rootDir, }), ) @@ -89,7 +82,6 @@ export default class ScriptTransformer { .update(fileData) .update(configString) .update(instrument ? 'instrument' : '') - .update(mapCoverage ? 'mapCoverage' : '') .update(CACHE_VERSION) .digest('hex'); } @@ -99,19 +91,13 @@ export default class ScriptTransformer { filename: Path, content: string, instrument: boolean, - mapCoverage: boolean, ): Path { const baseCacheDir = HasteMap.getCacheFilePath( this._config.cacheDirectory, 'jest-transform-cache-' + this._config.name, VERSION, ); - const cacheKey = this._getCacheKey( - content, - filename, - instrument, - mapCoverage, - ); + const cacheKey = this._getCacheKey(content, filename, instrument); // Create sub folders based on the cacheKey to avoid creating one // directory with many files. const cacheDir = path.join(baseCacheDir, cacheKey[0] + cacheKey[1]); @@ -191,24 +177,26 @@ export default class ScriptTransformer { } } - transformSource( - filepath: Path, - content: string, - instrument: boolean, - mapCoverage: boolean, - ) { + transformSource(filepath: Path, content: string, instrument: boolean) { const filename = this._getRealPath(filepath); const transform = this._getTransformer(filename); - const cacheFilePath = this._getFileCachePath( - filename, - content, - instrument, - mapCoverage, - ); + const cacheFilePath = this._getFileCachePath(filename, content, instrument); let sourceMapPath = cacheFilePath + '.map'; // Ignore cache if `config.cache` is set (--no-cache) let code = this._config.cache ? readCodeCacheFile(cacheFilePath) : null; + const shouldCallTransform = + transform && shouldTransform(filename, this._config); + + // That means that the transform has a custom instrumentation + // logic and will handle it based on `config.collectCoverage` option + const transformWillInstrument = + shouldCallTransform && transform && transform.canInstrument; + + // If we handle the coverage instrumentation, we should try to map code + // coverage against original source with any provided source map + const mapCoverage = instrument && !transformWillInstrument; + if (code) { // This is broken: we return the code, and a path for the source map // directly from the cache. But, nothing ensures the source map actually @@ -216,6 +204,7 @@ export default class ScriptTransformer { // two separate processes write concurrently to the same cache files. return { code, + mapCoverage, sourceMapPath, }; } @@ -225,9 +214,10 @@ export default class ScriptTransformer { map: null, }; - if (transform && shouldTransform(filename, this._config)) { + if (transform && shouldCallTransform) { const processed = transform.process(content, filename, this._config, { instrument, + returnSourceString: false, }); if (typeof processed === 'string') { @@ -242,26 +232,22 @@ export default class ScriptTransformer { } } - if (mapCoverage) { - if (!transformed.map) { - const inlineSourceMap = convertSourceMap.fromSource(transformed.code); - if (inlineSourceMap) { - transformed.map = inlineSourceMap.toJSON(); - } + if (!transformed.map) { + //Could be a potential freeze here. + //See: https://github.com/facebook/jest/pull/5177#discussion_r158883570 + const inlineSourceMap = convertSourceMap.fromSource(transformed.code); + if (inlineSourceMap) { + transformed.map = inlineSourceMap.toJSON(); } } - // That means that the transform has a custom instrumentation - // logic and will handle it based on `config.collectCoverage` option - const transformDidInstrument = transform && transform.canInstrument; - - if (!transformDidInstrument && instrument) { + if (!transformWillInstrument && instrument) { code = this._instrumentFile(filename, transformed.code); } else { code = transformed.code; } - if (instrument && mapCoverage && transformed.map) { + if (transformed.map) { const sourceMapContent = typeof transformed.map === 'string' ? transformed.map @@ -275,6 +261,7 @@ export default class ScriptTransformer { return { code, + mapCoverage, sourceMapPath, }; } @@ -293,6 +280,7 @@ export default class ScriptTransformer { let wrappedCode: string; let sourceMapPath: ?string = null; + let mapCoverage = false; const willTransform = !isInternalModule && @@ -305,16 +293,17 @@ export default class ScriptTransformer { filename, content, instrument, - !!(options && options.mapCoverage), ); wrappedCode = wrap(transformedSource.code); sourceMapPath = transformedSource.sourceMapPath; + mapCoverage = transformedSource.mapCoverage; } else { wrappedCode = wrap(content); } return { + mapCoverage, script: new vm.Script(wrappedCode, { displayErrors: true, filename: isCoreModule ? 'jest-nodejs-core-' + filename : filename, diff --git a/types/Argv.js b/types/Argv.js index 0293067b8ef8..71b3388b123f 100644 --- a/types/Argv.js +++ b/types/Argv.js @@ -43,7 +43,6 @@ export type Argv = {| json: boolean, lastCommit: boolean, logHeapUsage: boolean, - mapCoverage: boolean, moduleDirectories: Array, moduleFileExtensions: Array, moduleLoader: string, diff --git a/types/Config.js b/types/Config.js index d38bc2bbb609..f509ad6fec4b 100644 --- a/types/Config.js +++ b/types/Config.js @@ -38,7 +38,6 @@ export type DefaultOptions = {| globalTeardown: ?string, haste: HasteConfig, detectLeaks: boolean, - mapCoverage: boolean, moduleDirectories: Array, moduleFileExtensions: Array, moduleNameMapper: {[key: string]: string}, @@ -183,7 +182,6 @@ export type GlobalConfig = {| lastCommit: boolean, logHeapUsage: boolean, listTests: boolean, - mapCoverage: boolean, maxWorkers: number, noStackTrace: boolean, nonFlagArgs: Array, diff --git a/types/Transform.js b/types/Transform.js index 5ff94580ef57..3747720537c4 100644 --- a/types/Transform.js +++ b/types/Transform.js @@ -17,22 +17,23 @@ export type TransformedSource = {| export type TransformResult = {| script: Script, + mapCoverage: boolean, sourceMapPath: ?string, |}; export type TransformOptions = {| instrument: boolean, + returnSourceString?: boolean, |}; export type CacheKeyOptions = {| instrument: boolean, - mapCoverage: boolean, rootDir: string, |}; export type Transformer = {| canInstrument?: boolean, - createTransformer(options: any): Transformer, + createTransformer?: (options: any) => Transformer, getCacheKey: ( fileData: string,