diff --git a/CHANGELOG.md b/CHANGELOG.md index 721224415e57..ad040187169b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ - `[jest-cli]` [**BREAKING**] Remove re-exports from `@jest/core` ([#8874](https://github.com/facebook/jest/pull/8874)) - `[jest-diff]` Remove the need to export `splitLines0` function ([#9151](https://github.com/facebook/jest/pull/9151)) - `[jest-environment-jsdom]` [**BREAKING**] Upgrade JSDOM from v11 to v15 ([#8851](https://github.com/facebook/jest/pull/8851)) +- `[jest-reporters]` [**BREAKING**] Upgrade Istanbul dependencies, which are used for code coverage ([#9192](https://github.com/facebook/jest/pull/9192)) - `[jest-util]` [**BREAKING**] Remove deprecated exports ([#8863](https://github.com/facebook/jest/pull/8863)) - `[jest-validate]` [**BREAKING**] Use ESM exports ([#8874](https://github.com/facebook/jest/pull/8874)) - `[jest-types]` Mark `InitialOptions` as `Partial` ([#8848](https://github.com/facebook/jest/pull/8848)) diff --git a/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap b/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap index 104b7cb67776..deaad1f6b81b 100644 --- a/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap +++ b/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap @@ -1,63 +1,63 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`collects coverage from duplicate files avoiding shared cache 1`] = ` ----------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ----------------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - a | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | - b | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | ----------------|----------|----------|----------|----------|-------------------| +---------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + a | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | + b | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | +---------------|---------|----------|---------|---------|------------------- `; exports[`collects coverage only from multiple specified files 1`] = ` ---------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ---------------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - file.js | 100 | 100 | 100 | 100 | | - otherFile.js | 100 | 100 | 100 | 100 | | ---------------|----------|----------|----------|----------|-------------------| +--------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +--------------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + file.js | 100 | 100 | 100 | 100 | + otherFile.js | 100 | 100 | 100 | 100 | +--------------|---------|----------|---------|---------|------------------- `; exports[`collects coverage only from specified file 1`] = ` -----------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - file.js | 100 | 100 | 100 | 100 | | -----------|----------|----------|----------|----------|-------------------| +----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + file.js | 100 | 100 | 100 | 100 | +----------|---------|----------|---------|---------|------------------- `; exports[`collects coverage only from specified files avoiding dependencies 1`] = ` -----------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------|----------|----------|----------|----------|-------------------| -All files | 87.5 | 100 | 50 | 100 | | - sum.js | 87.5 | 100 | 50 | 100 | | -----------|----------|----------|----------|----------|-------------------| +----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------|---------|----------|---------|---------|------------------- +All files | 87.5 | 100 | 50 | 100 | + sum.js | 87.5 | 100 | 50 | 100 | +----------|---------|----------|---------|---------|------------------- `; exports[`does not output coverage report when html is requested 1`] = ``; exports[`generates coverage when using the testRegex config param 1`] = ` --------------------------------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------------------------|----------|----------|----------|----------|-------------------| -All files | 60 | 0 | 50 | 60 | | - coverage-report | 47.37 | 0 | 25 | 50 | | - file.js | 100 | 100 | 100 | 100 | | - notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 | - otherFile.js | 100 | 100 | 100 | 100 | | - sum.js | 87.5 | 100 | 50 | 100 | | - sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 | - coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | - coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | --------------------------------------|----------|----------|----------|----------|-------------------| +-------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-------------------------------------|---------|----------|---------|---------|------------------- +All files | 60 | 0 | 50 | 60 | + coverage-report | 47.37 | 0 | 25 | 50 | + file.js | 100 | 100 | 100 | 100 | + notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 + otherFile.js | 100 | 100 | 100 | 100 | + sum.js | 87.5 | 100 | 50 | 100 | + sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 + coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | + coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | +-------------------------------------|---------|----------|---------|---------|------------------- `; exports[`json reporter printing with --coverage 1`] = ` @@ -69,21 +69,21 @@ Ran all test suites. `; exports[`outputs coverage report 1`] = ` --------------------------------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------------------------|----------|----------|----------|----------|-------------------| -All files | 60 | 0 | 50 | 60 | | - coverage-report | 47.37 | 0 | 25 | 50 | | - file.js | 100 | 100 | 100 | 100 | | - notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 | - otherFile.js | 100 | 100 | 100 | 100 | | - sum.js | 87.5 | 100 | 50 | 100 | | - sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 | - coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | - coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | --------------------------------------|----------|----------|----------|----------|-------------------| +-------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-------------------------------------|---------|----------|---------|---------|------------------- +All files | 60 | 0 | 50 | 60 | + coverage-report | 47.37 | 0 | 25 | 50 | + file.js | 100 | 100 | 100 | 100 | + notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 + otherFile.js | 100 | 100 | 100 | 100 | + sum.js | 87.5 | 100 | 50 | 100 | + sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 + coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | + coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | +-------------------------------------|---------|----------|---------|---------|------------------- `; exports[`outputs coverage report when text and text-summary is requested 1`] = ` @@ -94,39 +94,39 @@ Branches : 0% ( 0/4 ) Functions : 50% ( 3/6 ) Lines : 60% ( 12/20 ) ================================================================================ --------------------------------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------------------------|----------|----------|----------|----------|-------------------| -All files | 60 | 0 | 50 | 60 | | - coverage-report | 47.37 | 0 | 25 | 50 | | - file.js | 100 | 100 | 100 | 100 | | - notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 | - otherFile.js | 100 | 100 | 100 | 100 | | - sum.js | 87.5 | 100 | 50 | 100 | | - sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 | - coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | - coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | --------------------------------------|----------|----------|----------|----------|-------------------| +-------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-------------------------------------|---------|----------|---------|---------|------------------- +All files | 60 | 0 | 50 | 60 | + coverage-report | 47.37 | 0 | 25 | 50 | + file.js | 100 | 100 | 100 | 100 | + notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 + otherFile.js | 100 | 100 | 100 | 100 | + sum.js | 87.5 | 100 | 50 | 100 | + sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 + coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | + coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | +-------------------------------------|---------|----------|---------|---------|------------------- `; exports[`outputs coverage report when text is requested 1`] = ` --------------------------------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------------------------|----------|----------|----------|----------|-------------------| -All files | 60 | 0 | 50 | 60 | | - coverage-report | 47.37 | 0 | 25 | 50 | | - file.js | 100 | 100 | 100 | 100 | | - notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 | - otherFile.js | 100 | 100 | 100 | 100 | | - sum.js | 87.5 | 100 | 50 | 100 | | - sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 | - coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | - coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | | - identical.js | 100 | 100 | 100 | 100 | | --------------------------------------|----------|----------|----------|----------|-------------------| +-------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-------------------------------------|---------|----------|---------|---------|------------------- +All files | 60 | 0 | 50 | 60 | + coverage-report | 47.37 | 0 | 25 | 50 | + file.js | 100 | 100 | 100 | 100 | + notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 + otherFile.js | 100 | 100 | 100 | 100 | + sum.js | 87.5 | 100 | 50 | 100 | + sumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 + coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | + coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | + identical.js | 100 | 100 | 100 | 100 | +-------------------------------------|---------|----------|---------|---------|------------------- `; exports[`outputs coverage report when text-summary is requested 1`] = ` diff --git a/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap b/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap index ea6b81579472..7ff4cc9d5618 100644 --- a/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap +++ b/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap @@ -16,22 +16,22 @@ Ran all test suites. `; exports[`excludes tests matched by path threshold groups from global group: stdout 1`] = ` ------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ------------|----------|----------|----------|----------|-------------------| -All files | 50 | 100 | 50 | 50 | | - apple.js | 0 | 100 | 0 | 0 | 2,3 | - banana.js | 100 | 100 | 100 | 100 | | ------------|----------|----------|----------|----------|-------------------| +-----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------|---------|----------|---------|---------|------------------- +All files | 50 | 100 | 50 | 50 | + apple.js | 0 | 100 | 0 | 0 | 2,3 + banana.js | 100 | 100 | 100 | 100 | +-----------|---------|----------|---------|---------|------------------- `; exports[`exits with 0 if global threshold group is not found in coverage data: stdout 1`] = ` ------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ------------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - banana.js | 100 | 100 | 100 | 100 | | ------------|----------|----------|----------|----------|-------------------| +-----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + banana.js | 100 | 100 | 100 | 100 | +-----------|---------|----------|---------|---------|------------------- `; exports[`exits with 1 if coverage threshold is not met 1`] = ` @@ -50,12 +50,12 @@ Ran all test suites. `; exports[`exits with 1 if coverage threshold is not met: stdout 1`] = ` -----------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------------|----------|----------|----------|----------|-------------------| -All files | 50 | 100 | 0 | 50 | | - not-covered.js | 50 | 100 | 0 | 50 | 3 | -----------------|----------|----------|----------|----------|-------------------| +----------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------------|---------|----------|---------|---------|------------------- +All files | 50 | 100 | 0 | 50 | + not-covered.js | 50 | 100 | 0 | 50 | 3 +----------------|---------|----------|---------|---------|------------------- `; exports[`exits with 1 if path threshold group is not found in coverage data 1`] = ` @@ -74,12 +74,12 @@ Ran all test suites. `; exports[`exits with 1 if path threshold group is not found in coverage data: stdout 1`] = ` ------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ------------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - banana.js | 100 | 100 | 100 | 100 | | ------------|----------|----------|----------|----------|-------------------| +-----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + banana.js | 100 | 100 | 100 | 100 | +-----------|---------|----------|---------|---------|------------------- `; exports[`file is matched by all path and glob threshold groups 1`] = ` @@ -100,10 +100,10 @@ Ran all test suites. `; exports[`file is matched by all path and glob threshold groups: stdout 1`] = ` ------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ------------|----------|----------|----------|----------|-------------------| -All files | 50 | 100 | 0 | 50 | | - banana.js | 50 | 100 | 0 | 50 | 3 | ------------|----------|----------|----------|----------|-------------------| +-----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +-----------|---------|----------|---------|---------|------------------- +All files | 50 | 100 | 0 | 50 | + banana.js | 50 | 100 | 0 | 50 | 3 +-----------|---------|----------|---------|---------|------------------- `; diff --git a/e2e/__tests__/__snapshots__/coverageTransformInstrumented.test.ts.snap b/e2e/__tests__/__snapshots__/coverageTransformInstrumented.test.ts.snap index 62621f95e594..5940566012f5 100644 --- a/e2e/__tests__/__snapshots__/coverageTransformInstrumented.test.ts.snap +++ b/e2e/__tests__/__snapshots__/coverageTransformInstrumented.test.ts.snap @@ -3,7 +3,7 @@ exports[`code coverage for transform instrumented code 1`] = ` Object { "covered.js": Object { - "_coverageSchema": "43e27e138ebf9cfc5966b082cf9a028302ed4184", + "_coverageSchema": "1a1c01bbd47fc00a2c39e90264f33305004495a9", "b": Object {}, "branchMap": Object {}, "f": Object { diff --git a/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap b/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap index d0183e881440..d7cf67285466 100644 --- a/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap +++ b/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap @@ -14,12 +14,12 @@ PASS __tests__/a.test.js `; exports[`--findRelatedTests flag coverage configuration is applied correctly 3`] = ` -----------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - a.js | 100 | 100 | 100 | 100 | | -----------|----------|----------|----------|----------|-------------------| +----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + a.js | 100 | 100 | 100 | 100 | +----------|---------|----------|---------|---------|------------------- `; exports[`--findRelatedTests flag generates coverage report for filename 1`] = ` @@ -36,13 +36,13 @@ PASS __tests__/b.test.js `; exports[`--findRelatedTests flag generates coverage report for filename 3`] = ` -----------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - a.js | 100 | 100 | 100 | 100 | | - b.js | 100 | 100 | 100 | 100 | | -----------|----------|----------|----------|----------|-------------------| +----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + a.js | 100 | 100 | 100 | 100 | + b.js | 100 | 100 | 100 | 100 | +----------|---------|----------|---------|---------|------------------- `; exports[`--findRelatedTests flag generates coverage report for filename 4`] = ` @@ -59,10 +59,10 @@ PASS __tests__/a.test.js `; exports[`--findRelatedTests flag generates coverage report for filename 6`] = ` -----------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - a.js | 100 | 100 | 100 | 100 | | -----------|----------|----------|----------|----------|-------------------| +----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + a.js | 100 | 100 | 100 | 100 | +----------|---------|----------|---------|---------|------------------- `; diff --git a/e2e/__tests__/__snapshots__/transform.test.ts.snap b/e2e/__tests__/__snapshots__/transform.test.ts.snap index 91cf5be06873..195359dad96c 100644 --- a/e2e/__tests__/__snapshots__/transform.test.ts.snap +++ b/e2e/__tests__/__snapshots__/transform.test.ts.snap @@ -10,36 +10,36 @@ FAIL __tests__/ignoredFile.test.js `; exports[`babel-jest instruments only specific files and collects coverage 1`] = ` -------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -------------|----------|----------|----------|----------|-------------------| -All files | 83.33 | 100 | 50 | 80 | | - covered.js | 83.33 | 100 | 50 | 80 | 13 | -------------|----------|----------|----------|----------|-------------------| +------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +------------|---------|----------|---------|---------|------------------- +All files | 83.33 | 100 | 50 | 80 | + covered.js | 83.33 | 100 | 50 | 80 | 13 +------------|---------|----------|---------|---------|------------------- `; exports[`custom transformer instruments files 1`] = ` -----------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -----------|----------|----------|----------|----------|-------------------| -All files | 0 | 0 | 0 | 0 | | -----------|----------|----------|----------|----------|-------------------| +----------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +----------|---------|----------|---------|---------|------------------- +All files | 0 | 0 | 0 | 0 | +----------|---------|----------|---------|---------|------------------- `; exports[`no babel-jest instrumentation with no babel-jest 1`] = ` -------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -------------|----------|----------|----------|----------|-------------------| -All files | 83.33 | 100 | 50 | 80 | | - covered.js | 83.33 | 100 | 50 | 80 | 13 | -------------|----------|----------|----------|----------|-------------------| +------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +------------|---------|----------|---------|---------|------------------- +All files | 83.33 | 100 | 50 | 80 | + covered.js | 83.33 | 100 | 50 | 80 | 13 +------------|---------|----------|---------|---------|------------------- `; exports[`transformer-config instruments only specific files and collects coverage 1`] = ` -"------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -------------|----------|----------|----------|----------|-------------------| -All files | 83.33 | 100 | 50 | 80 | | - Covered.js | 83.33 | 100 | 50 | 80 | 13 | -------------|----------|----------|----------|----------|-------------------|" +"------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +------------|---------|----------|---------|---------|------------------- +All files | 83.33 | 100 | 50 | 80 | + Covered.js | 83.33 | 100 | 50 | 80 | 13 +------------|---------|----------|---------|---------|-------------------" `; diff --git a/e2e/__tests__/__snapshots__/typescriptCoverage.test.ts.snap b/e2e/__tests__/__snapshots__/typescriptCoverage.test.ts.snap index e3f422c49a17..98190d64a6d6 100644 --- a/e2e/__tests__/__snapshots__/typescriptCoverage.test.ts.snap +++ b/e2e/__tests__/__snapshots__/typescriptCoverage.test.ts.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`instruments and collects coverage for typescript files 1`] = ` -------------|----------|----------|----------|----------|-------------------| -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | -------------|----------|----------|----------|----------|-------------------| -All files | 100 | 100 | 100 | 100 | | - covered.ts | 100 | 100 | 100 | 100 | | -------------|----------|----------|----------|----------|-------------------| +------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +------------|---------|----------|---------|---------|------------------- +All files | 100 | 100 | 100 | 100 | + covered.ts | 100 | 100 | 100 | 100 | +------------|---------|----------|---------|---------|------------------- `; diff --git a/e2e/coverage-transform-instrumented/package.json b/e2e/coverage-transform-instrumented/package.json index e4356a9f2ea9..e086e5064554 100644 --- a/e2e/coverage-transform-instrumented/package.json +++ b/e2e/coverage-transform-instrumented/package.json @@ -18,6 +18,6 @@ "dependencies": { "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", - "babel-plugin-istanbul": "^5.1.0" + "babel-plugin-istanbul": "^6.0.0-beta.0" } } diff --git a/e2e/coverage-transform-instrumented/yarn.lock b/e2e/coverage-transform-instrumented/yarn.lock index a9b1964ebabf..5ab2b4f3e220 100644 --- a/e2e/coverage-transform-instrumented/yarn.lock +++ b/e2e/coverage-transform-instrumented/yarn.lock @@ -9,7 +9,7 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.0.0": +"@babel/core@^7.0.0", "@babel/core@^7.6.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.2.tgz#ea5b99693bcfc058116f42fa1dd54da412b29d91" integrity sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ== @@ -29,7 +29,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.7.2": +"@babel/generator@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== @@ -220,7 +220,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2": +"@babel/parser@^7.6.2", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2": version "7.7.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.3.tgz#5fad457c2529de476a248f75b0f090b3060af043" integrity sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A== @@ -617,7 +617,7 @@ js-levenshtein "^1.1.3" semver "^5.5.0" -"@babel/template@^7.4.0", "@babel/template@^7.7.0": +"@babel/template@^7.6.0", "@babel/template@^7.7.0": version "7.7.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0" integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ== @@ -626,7 +626,7 @@ "@babel/parser" "^7.7.0" "@babel/types" "^7.7.0" -"@babel/traverse@^7.4.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" integrity sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw== @@ -641,7 +641,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.4.0", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": +"@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== @@ -650,6 +650,21 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@istanbuljs/load-nyc-config@^1.0.0-alpha.1": + version "1.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0-alpha.1.tgz#9771951889c9c152c076348a0f643de210db8216" + integrity sha512-ztOcmioPc9meI3VRTHFU73bha0xwBr55X2na1+hRZfvtmVWXBknnSm6SI16UOXUrwIzpSMkEmEXsS7FG/gu8ZQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.0", "@istanbuljs/schema@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.1.tgz#0bd2538b2ee89a95943756028aa80ed95f973e0f" + integrity sha512-Dt63B/JcXUxwnngdR8BYqSuQBX0HVXgLZtGMsKAAIQLe0whQdypOjsuqcSf8HR5M00/L8NuRC/+dZb6rEc+b5g== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -657,6 +672,13 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + 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" @@ -664,15 +686,16 @@ babel-plugin-dynamic-import-node@^2.3.0: dependencies: object.assign "^4.1.0" -babel-plugin-istanbul@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" - integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== +babel-plugin-istanbul@^6.0.0-beta.0: + version "6.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0-beta.0.tgz#503308b1edaa324b3e0c0d6638ba94cf6a705c42" + integrity sha512-HwHIN30J7P94fqW4fzTh2CBEBncRmn9SD7J/+Ta2syHKF39TmrV280eOqmGxXrrjllBr0BHCJ6pQOFDnkFY1Hw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - find-up "^3.0.0" - istanbul-lib-instrument "^3.3.0" - test-exclude "^5.2.3" + "@istanbuljs/load-nyc-config" "^1.0.0-alpha.1" + "@istanbuljs/schema" "^0.1.1" + istanbul-lib-instrument "^4.0.0-alpha.1" + test-exclude "^6.0.0-alpha.1" balanced-match@^1.0.0: version "1.0.0" @@ -696,6 +719,11 @@ browserslist@^4.6.0, browserslist@^4.7.2: electron-to-chromium "^1.3.295" node-releases "^1.1.38" +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + caniuse-lite@^1.0.30001004: version "1.0.30001010" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001010.tgz#397a14034d384260453cc81994f494626d34b938" @@ -761,29 +789,28 @@ electron-to-chromium@^1.3.295: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.306.tgz#e8265301d053d5f74e36cb876486830261fbe946" integrity sha512-frDqXvrIROoYvikSKTIKbHbzO6M3/qC6kCIt/1FOa9kALe++c4VAJnwjSFvf1tYLEUsP2n9XZ4XSCyqc3l7A/A== -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== +find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: - locate-path "^3.0.0" + locate-path "^5.0.0" + path-exists "^4.0.0" fs.realpath@^1.0.0: version "1.0.0" @@ -795,7 +822,7 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -glob@^7.1.3: +glob@^7.1.4: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -812,11 +839,6 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -graceful-fs@^4.1.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -827,11 +849,6 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= -hosted-git-info@^2.1.4: - version "2.8.5" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c" - integrity sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -852,28 +869,23 @@ invariant@^2.2.2: 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" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - -istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" +istanbul-lib-coverage@^3.0.0-alpha.1: + version "3.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0-alpha.1.tgz#a3eeb4316f951607e4654931094676c53c85c96c" + integrity sha512-6E/XA1/lI0NG7PuIkD3FdBuUDpTKZijp2SiQ0d08dHx6Rp4ba2Ph4LPE0Og6HE2IuqiXxy12sePpQJh9pWS53g== + +istanbul-lib-instrument@^4.0.0-alpha.1: + version "4.0.0-alpha.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0-alpha.2.tgz#d329c9f385656a00d4e93ff0faa865c01de865ea" + integrity sha512-0zSGZ1Xxb2EQOoCW+i/fzaLUissLndYr9njE2V7ZrYHJTsKL/BkDW1byFLUM/VqTkoosERqX3e7/AbtdH16awQ== + dependencies: + "@babel/core" "^7.6.2" + "@babel/parser" "^7.6.2" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.2" + "@istanbuljs/schema" "^0.1.0" + istanbul-lib-coverage "^3.0.0-alpha.1" + semver "^6.3.0" js-levenshtein@^1.1.3: version "1.1.6" @@ -885,6 +897,14 @@ js-levenshtein@^1.1.3: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-yaml@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -895,11 +915,6 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= -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== - json5@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" @@ -907,23 +922,12 @@ json5@^2.1.0: dependencies: minimist "^1.2.0" -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" + p-locate "^4.1.0" lodash@^4.17.13: version "4.17.15" @@ -961,16 +965,6 @@ node-releases@^1.1.38: dependencies: semver "^6.3.0" -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - object-keys@^1.0.11, object-keys@^1.0.12: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -993,37 +987,29 @@ once@^1.3.0: dependencies: wrappy "1" -p-limit@^2.0.0: +p-limit@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== dependencies: p-try "^2.0.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: - p-limit "^2.0.0" + p-limit "^2.2.0" p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -parse-json@^4.0.0: +path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" @@ -1035,40 +1021,11 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - private@^0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - regenerate-unicode-properties@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" @@ -1112,12 +1069,12 @@ regjsparser@^0.6.0: dependencies: jsesc "~0.5.0" -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.10.0, resolve@^1.3.2: +resolve@^1.3.2: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== @@ -1129,12 +1086,12 @@ 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== -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: +semver@^5.4.1, semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.3.0: +semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -1144,36 +1101,10 @@ source-map@^0.5.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== - dependencies: - spdx-expression-parse "^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== - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" - integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= supports-color@^5.3.0: version "5.5.0" @@ -1182,15 +1113,13 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== +test-exclude@^6.0.0-alpha.1: + version "6.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0-alpha.1.tgz#56b7123436f693539fde73f23d0b543ec2e21a9a" + integrity sha512-5mYhiJ+PfxG37MdIfvsj2mbpnC8uwYSHbgJgQE/7OOsUM2QwB0U7Z05SZzQGknevs0Fp+UGJtKayrYLYwC4vMw== dependencies: - glob "^7.1.3" + glob "^7.1.4" minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" to-fast-properties@^2.0.0: version "2.0.0" @@ -1220,14 +1149,6 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/package.json b/package.json index 654310f2d425..11b6c65176a2 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,9 @@ "glob": "^7.1.1", "graceful-fs": "^4.2.3", "isbinaryfile": "^4.0.0", - "istanbul-lib-coverage": "^2.0.2", - "istanbul-lib-report": "^2.0.4", - "istanbul-reports": "^2.1.1", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "istanbul-lib-report": "^3.0.0-alpha.1", + "istanbul-reports": "^3.0.0-alpha.4", "jest-junit": "^9.0.0", "jest-silent-reporter": "^0.1.2", "jest-snapshot-serializer-raw": "^1.1.0", diff --git a/packages/babel-jest/package.json b/packages/babel-jest/package.json index db76931ce5bb..cd5236191df2 100644 --- a/packages/babel-jest/package.json +++ b/packages/babel-jest/package.json @@ -14,7 +14,7 @@ "@jest/transform": "^24.9.0", "@jest/types": "^24.9.0", "@types/babel__core": "^7.1.0", - "babel-plugin-istanbul": "^5.1.0", + "babel-plugin-istanbul": "^6.0.0-beta.0", "babel-preset-jest": "^24.9.0", "chalk": "^3.0.0", "slash": "^3.0.0" diff --git a/packages/jest-reporters/package.json b/packages/jest-reporters/package.json index 2865da31cbf2..4e24c60050af 100644 --- a/packages/jest-reporters/package.json +++ b/packages/jest-reporters/package.json @@ -13,11 +13,11 @@ "chalk": "^3.0.0", "exit": "^0.1.2", "glob": "^7.1.2", - "istanbul-lib-coverage": "^2.0.2", - "istanbul-lib-instrument": "^3.0.1", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.1", - "istanbul-reports": "^2.2.6", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "istanbul-lib-instrument": "^4.0.0-alpha.2", + "istanbul-lib-report": "^3.0.0-alpha.1", + "istanbul-lib-source-maps": "^4.0.0-alpha.4", + "istanbul-reports": "^3.0.0-alpha.4", "jest-haste-map": "^24.9.0", "jest-resolve": "^24.9.0", "jest-runtime": "^24.9.0", diff --git a/packages/jest-reporters/src/__tests__/__snapshots__/generateEmptyCoverage.test.js.snap b/packages/jest-reporters/src/__tests__/__snapshots__/generateEmptyCoverage.test.js.snap index c99be7a71887..ede240cf808b 100644 --- a/packages/jest-reporters/src/__tests__/__snapshots__/generateEmptyCoverage.test.js.snap +++ b/packages/jest-reporters/src/__tests__/__snapshots__/generateEmptyCoverage.test.js.snap @@ -75,7 +75,6 @@ Object { "name": "(anonymous_0)", }, }, - "hash": Any, "path": Any, "s": Object { "0": 0, diff --git a/packages/jest-reporters/src/__tests__/coverage_reporter.test.js b/packages/jest-reporters/src/__tests__/coverage_reporter.test.js index b7936e051c3b..3fc1c78686e4 100644 --- a/packages/jest-reporters/src/__tests__/coverage_reporter.test.js +++ b/packages/jest-reporters/src/__tests__/coverage_reporter.test.js @@ -118,7 +118,7 @@ describe('onRunComplete', () => { libSourceMaps.createSourceMapStore = jest.fn(() => ({ transformCoverage(map) { - return {map}; + return Promise.resolve(map); }, })); }); diff --git a/packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js b/packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js index d93d3b48dc8e..fc8a081c4aaf 100644 --- a/packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js +++ b/packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js @@ -22,7 +22,7 @@ jest.mock('@jest/transform', () => ({ describe('generateEmptyCoverage', () => { const coverageMap = istanbulCoverage.createCoverageMap({}); const sourceMapStore = libSourceMaps.createSourceMapStore(); - const rootDir = '/tmp'; + const rootDir = __dirname; const filepath = path.join(rootDir, './sum.js'); it('generates an empty coverage object for a file without running it', () => { @@ -49,6 +49,7 @@ describe('generateEmptyCoverage', () => { makeGlobalConfig(), makeProjectConfig({ cacheDirectory: os.tmpdir(), + cwd: rootDir, rootDir, transform: [['^.+\\.js$', require.resolve('babel-jest')]], }), @@ -67,7 +68,6 @@ describe('generateEmptyCoverage', () => { } expect(coverage.data).toMatchSnapshot({ - hash: expect.any(String), path: expect.any(String), }); }); @@ -93,6 +93,7 @@ describe('generateEmptyCoverage', () => { makeGlobalConfig(), makeProjectConfig({ cacheDirectory: os.tmpdir(), + cwd: rootDir, rootDir, transform: [['^.+\\.js$', require.resolve('babel-jest')]], }), @@ -121,6 +122,7 @@ describe('generateEmptyCoverage', () => { makeGlobalConfig(), makeProjectConfig({ cacheDirectory: os.tmpdir(), + cwd: rootDir, rootDir, transform: [['^.+\\.js$', require.resolve('babel-jest')]], }), diff --git a/packages/jest-reporters/src/coverage_reporter.ts b/packages/jest-reporters/src/coverage_reporter.ts index dde9ed0a6b5d..7fefd26508ac 100644 --- a/packages/jest-reporters/src/coverage_reporter.ts +++ b/packages/jest-reporters/src/coverage_reporter.ts @@ -77,14 +77,15 @@ export default class CoverageReporter extends BaseReporter { aggregatedResults: AggregatedResult, ) { await this._addUntestedFiles(this._globalConfig, contexts); - const {map, sourceFinder} = this._sourceMapStore.transformCoverage( - this._coverageMap, - ); + const map = await this._sourceMapStore.transformCoverage(this._coverageMap); try { const reportContext = istanbulReport.createContext({ + // @ts-ignore + coverageMap: map, dir: this._globalConfig.coverageDirectory, - sourceFinder, + // @ts-ignore + sourceFinder: this._sourceMapStore.sourceFinder, }); const coverageReporters = this._globalConfig.coverageReporters || []; @@ -92,10 +93,13 @@ export default class CoverageReporter extends BaseReporter { coverageReporters.push('text-summary'); } - const tree = istanbulReport.summarizers.pkg(map); coverageReporters.forEach(reporter => { - tree.visit(istanbulReports.create(reporter, {}), reportContext); + istanbulReports + .create(reporter, {maxCols: process.stdout.columns || Infinity}) + // @ts-ignore + .execute(reportContext); }); + // @ts-ignore aggregatedResults.coverageMap = map; } catch (e) { console.error( @@ -107,6 +111,7 @@ export default class CoverageReporter extends BaseReporter { ); } + // @ts-ignore this._checkThreshold(map); } diff --git a/packages/jest-reporters/src/generateEmptyCoverage.ts b/packages/jest-reporters/src/generateEmptyCoverage.ts index 2b3bd795faed..c9420ff6bdc2 100644 --- a/packages/jest-reporters/src/generateEmptyCoverage.ts +++ b/packages/jest-reporters/src/generateEmptyCoverage.ts @@ -34,6 +34,7 @@ export default function( const {code, mapCoverage, sourceMapPath} = new ScriptTransformer( config, ).transformSource(filename, source, true); + // TODO: consider passing AST const extracted = readInitialCoverage(code); // Check extracted initial coverage is not null, this can happen when using /* istanbul ignore file */ if (extracted) { diff --git a/packages/jest-runtime/src/__tests__/instrumentation.test.ts b/packages/jest-runtime/src/__tests__/instrumentation.test.ts index a969c161e685..48fedd2e51d5 100644 --- a/packages/jest-runtime/src/__tests__/instrumentation.test.ts +++ b/packages/jest-runtime/src/__tests__/instrumentation.test.ts @@ -23,7 +23,8 @@ it('instruments files', () => { const config = makeProjectConfig({ cache: false, cacheDirectory: os.tmpdir(), - rootDir: '/', + cwd: __dirname, + rootDir: __dirname, }); const instrumented = new ScriptTransformer(config).transform( FILE_PATH_TO_INSTRUMENT, diff --git a/packages/jest-transform/package.json b/packages/jest-transform/package.json index c462a5c91136..b28829db846b 100644 --- a/packages/jest-transform/package.json +++ b/packages/jest-transform/package.json @@ -11,7 +11,7 @@ "dependencies": { "@babel/core": "^7.1.0", "@jest/types": "^24.9.0", - "babel-plugin-istanbul": "^5.1.0", + "babel-plugin-istanbul": "^6.0.0-beta.0", "chalk": "^3.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", 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 b95aa2b36b0f..5b128fd762dc 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 @@ -76,9 +76,9 @@ Object { exports[`ScriptTransformer transforms a file properly 1`] = ` "({\\"Object.\\":function(module,exports,require,__dirname,__filename,global,jest){/* istanbul ignore next */ -var cov_25u22311x4 = function () { +function cov_25u22311x4() { var path = \\"/fruits/banana.js\\"; - var hash = \\"ef12c7f3c0d46c0ac007781d50b4e524293578c6\\"; + var hash = \\"4be0f6184160be573fc43f7c2a5877c28b7ce249\\"; var global = new Function(\\"return this\\")(); var gcv = \\"__coverage__\\"; var coverageData = { @@ -102,28 +102,34 @@ var cov_25u22311x4 = function () { }, f: {}, b: {}, - _coverageSchema: \\"43e27e138ebf9cfc5966b082cf9a028302ed4184\\", - hash: \\"ef12c7f3c0d46c0ac007781d50b4e524293578c6\\" + _coverageSchema: \\"1a1c01bbd47fc00a2c39e90264f33305004495a9\\", + hash: \\"4be0f6184160be573fc43f7c2a5877c28b7ce249\\" }; var coverage = global[gcv] || (global[gcv] = {}); - if (coverage[path] && coverage[path].hash === hash) { - return coverage[path]; + if (!coverage[path] || coverage[path].hash !== hash) { + coverage[path] = coverageData; } - return coverage[path] = coverageData; -}(); + var actualCoverage = coverage[path]; -cov_25u22311x4.s[0]++; + cov_25u22311x4 = function () { + return actualCoverage; + }; + + return actualCoverage; +} + +cov_25u22311x4().s[0]++; module.exports = \\"banana\\"; }});" `; exports[`ScriptTransformer transforms a file properly 2`] = ` "({\\"Object.\\":function(module,exports,require,__dirname,__filename,global,jest){/* istanbul ignore next */ -var cov_23yvu8etmu = function () { +function cov_23yvu8etmu() { var path = \\"/fruits/kiwi.js\\"; - var hash = \\"90cf6273dfbcd93e4510a6c5503c2125aab1f1b8\\"; + var hash = \\"7705dd5fcfbc884dcea7062944cfb8cc5d141d1a\\"; var global = new Function(\\"return this\\")(); var gcv = \\"__coverage__\\"; var coverageData = { @@ -185,24 +191,30 @@ var cov_23yvu8etmu = function () { \\"0\\": 0 }, b: {}, - _coverageSchema: \\"43e27e138ebf9cfc5966b082cf9a028302ed4184\\", - hash: \\"90cf6273dfbcd93e4510a6c5503c2125aab1f1b8\\" + _coverageSchema: \\"1a1c01bbd47fc00a2c39e90264f33305004495a9\\", + hash: \\"7705dd5fcfbc884dcea7062944cfb8cc5d141d1a\\" }; var coverage = global[gcv] || (global[gcv] = {}); - if (coverage[path] && coverage[path].hash === hash) { - return coverage[path]; + if (!coverage[path] || coverage[path].hash !== hash) { + coverage[path] = coverageData; } - return coverage[path] = coverageData; -}(); + var actualCoverage = coverage[path]; + + cov_23yvu8etmu = function () { + return actualCoverage; + }; + + return actualCoverage; +} -cov_23yvu8etmu.s[0]++; +cov_23yvu8etmu().s[0]++; module.exports = () => { /* istanbul ignore next */ - cov_23yvu8etmu.f[0]++; - cov_23yvu8etmu.s[1]++; + cov_23yvu8etmu().f[0]++; + cov_23yvu8etmu().s[1]++; return \\"kiwi\\"; }; }});" diff --git a/scripts/mapCoverage.js b/scripts/mapCoverage.js index af27ed9b5ef5..deab981034f4 100644 --- a/scripts/mapCoverage.js +++ b/scripts/mapCoverage.js @@ -32,8 +32,6 @@ const coverage = require('../coverage/coverage-final.json'); const map = istanbulCoverage.createCoverageMap(); -const context = istanbulReport.createContext(); - const mapFileCoverage = fileCoverage => { fileCoverage.path = fileCoverage.path.replace( /(.*packages\/.*\/)(build)(\/.*)/, @@ -46,7 +44,8 @@ Object.keys(coverage).forEach(filename => map.addFileCoverage(mapFileCoverage(coverage[filename])) ); -const tree = istanbulReport.summarizers.pkg(map); +const context = istanbulReport.createContext({coverageMap: map}); + ['json', 'lcov', 'text'].forEach(reporter => - tree.visit(istanbulReports.create(reporter, {}), context) + istanbulReports.create(reporter, {}).execute(context) ); diff --git a/yarn.lock b/yarn.lock index 37b72d8348b2..53fa6b52b96a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -71,7 +71,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0", "@babel/generator@^7.4.0", "@babel/generator@^7.7.2": +"@babel/generator@^7.0.0", "@babel/generator@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== @@ -282,7 +282,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2": +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.6.2", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2": version "7.7.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.3.tgz#5fad457c2529de476a248f75b0f090b3060af043" integrity sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A== @@ -908,7 +908,7 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.0.0", "@babel/template@^7.4.0", "@babel/template@^7.7.0": +"@babel/template@^7.0.0", "@babel/template@^7.6.0", "@babel/template@^7.7.0": version "7.7.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0" integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ== @@ -917,7 +917,7 @@ "@babel/parser" "^7.7.0" "@babel/types" "^7.7.0" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.3.4", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.3.4", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" integrity sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw== @@ -932,7 +932,7 @@ 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.0", "@babel/types@^7.6.1", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.6.1", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== @@ -1023,6 +1023,21 @@ unique-filename "^1.1.1" which "^1.3.1" +"@istanbuljs/load-nyc-config@^1.0.0-alpha.1": + version "1.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0-alpha.1.tgz#9771951889c9c152c076348a0f643de210db8216" + integrity sha512-ztOcmioPc9meI3VRTHFU73bha0xwBr55X2na1+hRZfvtmVWXBknnSm6SI16UOXUrwIzpSMkEmEXsS7FG/gu8ZQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.0", "@istanbuljs/schema@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.1.tgz#0bd2538b2ee89a95943756028aa80ed95f973e0f" + integrity sha512-Dt63B/JcXUxwnngdR8BYqSuQBX0HVXgLZtGMsKAAIQLe0whQdypOjsuqcSf8HR5M00/L8NuRC/+dZb6rEc+b5g== + "@lerna/add@3.18.4": version "3.18.4" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.18.4.tgz#0d97c75b64febc10a9a38546a3019f0f2c24b0e6" @@ -3001,15 +3016,16 @@ babel-plugin-dynamic-import-node@^2.3.0: dependencies: object.assign "^4.1.0" -babel-plugin-istanbul@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" - integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== +babel-plugin-istanbul@^6.0.0-beta.0: + version "6.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0-beta.0.tgz#503308b1edaa324b3e0c0d6638ba94cf6a705c42" + integrity sha512-HwHIN30J7P94fqW4fzTh2CBEBncRmn9SD7J/+Ta2syHKF39TmrV280eOqmGxXrrjllBr0BHCJ6pQOFDnkFY1Hw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - find-up "^3.0.0" - istanbul-lib-instrument "^3.3.0" - test-exclude "^5.2.3" + "@istanbuljs/load-nyc-config" "^1.0.0-alpha.1" + "@istanbuljs/schema" "^0.1.1" + istanbul-lib-instrument "^4.0.0-alpha.1" + test-exclude "^6.0.0-alpha.1" babel-plugin-replace-ts-export-assignment@^0.0.2: version "0.0.2" @@ -6974,7 +6990,7 @@ gzip-size@5.1.1: duplexer "^0.1.1" pify "^4.0.1" -handlebars@^4.1.2, handlebars@^4.4.0: +handlebars@^4.4.0: version "4.5.2" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.2.tgz#5a4eb92ab5962ca3415ac188c86dc7f784f76a0f" integrity sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg== @@ -7161,6 +7177,11 @@ html-encoding-sniffer@^1.0.2: dependencies: whatwg-encoding "^1.0.1" +html-escaper@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.0.tgz#71e87f931de3fe09e56661ab9a29aadec707b491" + integrity sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig== + htmlparser2@^3.9.1: version "3.10.1" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" @@ -8111,50 +8132,49 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== +istanbul-lib-coverage@^3.0.0-alpha.1: + version "3.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0-alpha.1.tgz#a3eeb4316f951607e4654931094676c53c85c96c" + integrity sha512-6E/XA1/lI0NG7PuIkD3FdBuUDpTKZijp2SiQ0d08dHx6Rp4ba2Ph4LPE0Og6HE2IuqiXxy12sePpQJh9pWS53g== -istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" +istanbul-lib-instrument@^4.0.0-alpha.1, istanbul-lib-instrument@^4.0.0-alpha.2: + version "4.0.0-alpha.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0-alpha.2.tgz#d329c9f385656a00d4e93ff0faa865c01de865ea" + integrity sha512-0zSGZ1Xxb2EQOoCW+i/fzaLUissLndYr9njE2V7ZrYHJTsKL/BkDW1byFLUM/VqTkoosERqX3e7/AbtdH16awQ== + dependencies: + "@babel/core" "^7.6.2" + "@babel/parser" "^7.6.2" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.2" + "@istanbuljs/schema" "^0.1.0" + istanbul-lib-coverage "^3.0.0-alpha.1" + semver "^6.3.0" -istanbul-lib-report@^2.0.4: - version "2.0.8" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" - integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== +istanbul-lib-report@^3.0.0-alpha.1: + version "3.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0-alpha.1.tgz#d28b90a20c8cc179fc878f52249d972f43f869f9" + integrity sha512-EeRtb2Frb5Ttt+TNvmIJ5oXHr6rogCpmKbNJskORRqjv6/ajCzm9ZO7tVegwZQNNyKAWi7JocxOF8IoTa3OZhw== dependencies: - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - supports-color "^6.1.0" + istanbul-lib-coverage "^3.0.0-alpha.1" + make-dir "^3.0.0" + supports-color "^7.1.0" -istanbul-lib-source-maps@^3.0.1: - version "3.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" - integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== +istanbul-lib-source-maps@^4.0.0-alpha.4: + version "4.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0-alpha.4.tgz#cd0e5fdcc57c0541ba8369c2132f01526de3cb0c" + integrity sha512-T6SCz977OqDyT30dxME6QsrosclFxO2vMcFyVWxzhMECbBtOvErgpIpSIeFrxi6s9wEW2P5HYVDG2gmlM2P3Zg== dependencies: debug "^4.1.1" - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - rimraf "^2.6.3" + istanbul-lib-coverage "^3.0.0-alpha.1" source-map "^0.6.1" -istanbul-reports@^2.1.1, istanbul-reports@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" - integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== +istanbul-reports@^3.0.0-alpha.4: + version "3.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.0-alpha.4.tgz#f703c04cc76b27e89b88c4fa74efec7865582e73" + integrity sha512-TPIUdttWC1oUvTL163ZtS0FqTlYaaAQBQdlVpF9Enu+w6oPOUR0p//WRdRyT/hbDG83PoQoSyatYzV6FrICDKg== dependencies: - handlebars "^4.1.2" + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0-alpha.1" isurl@^1.0.0-alpha5: version "1.0.0" @@ -8949,6 +8969,13 @@ 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.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.0.tgz#1b5f39f6b9270ed33f9f054c5c0f84304989f801" + integrity sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== + dependencies: + semver "^6.0.0" + make-fetch-happen@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz#aa8387104f2687edca01c8687ee45013d02d19bd" @@ -11720,14 +11747,6 @@ read-pkg-up@^3.0.0: find-up "^2.0.0" read-pkg "^3.0.0" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.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" @@ -13346,15 +13365,13 @@ terser@^4.1.2: source-map "~0.6.1" source-map-support "~0.5.12" -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== +test-exclude@^6.0.0-alpha.1: + version "6.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0-alpha.1.tgz#56b7123436f693539fde73f23d0b543ec2e21a9a" + integrity sha512-5mYhiJ+PfxG37MdIfvsj2mbpnC8uwYSHbgJgQE/7OOsUM2QwB0U7Z05SZzQGknevs0Fp+UGJtKayrYLYwC4vMw== dependencies: - glob "^7.1.3" + glob "^7.1.4" minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" text-extensions@^1.0.0: version "1.9.0"