-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`prints correct coverage report, if a CJS module is put under test without transformation 1`] = ` | ||
" console.log | ||
this will print | ||
at covered (module.js:11:11) | ||
--------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------|---------|----------|---------|---------|------------------- | ||
All files | 60 | 50 | 50 | 60 | | ||
module.js | 66.66 | 50 | 50 | 66.66 | 14-15,19 | ||
uncovered.js | 0 | 100 | 100 | 0 | 8 | ||
--------------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`prints correct coverage report, if a TS module is transpiled by Babel to CJS and put under test 1`] = ` | ||
" console.log | ||
this will print | ||
at log (module.ts:13:11) | ||
--------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------|---------|----------|---------|---------|------------------- | ||
All files | 62.5 | 50 | 50 | 62.5 | | ||
module.ts | 62.5 | 50 | 50 | 62.5 | 16-17,21 | ||
types.ts | 0 | 0 | 0 | 0 | | ||
uncovered.ts | 0 | 0 | 0 | 0 | | ||
--------------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`prints correct coverage report, if a TS module is transpiled by custom transformer to ESM put under test 1`] = ` | ||
" console.log | ||
this will print | ||
at covered (module.ts:13:11) | ||
--------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------|---------|----------|---------|---------|------------------- | ||
All files | 62.5 | 50 | 50 | 62.5 | | ||
module.ts | 62.5 | 50 | 50 | 62.5 | 16-17,21 | ||
types.ts | 0 | 0 | 0 | 0 | | ||
uncovered.ts | 0 | 0 | 0 | 0 | | ||
--------------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`prints correct coverage report, if an ESM module is put under test without transformation 1`] = ` | ||
" console.log | ||
this will print | ||
at covered (module.js:11:11) | ||
--------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------|---------|----------|---------|---------|------------------- | ||
All files | 62.5 | 50 | 50 | 62.5 | | ||
module.js | 62.5 | 50 | 50 | 62.5 | 14-15,19 | ||
uncovered.js | 0 | 0 | 0 | 0 | | ||
--------------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`prints coverage with empty sourcemaps 1`] = ` | ||
"----------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
----------|---------|----------|---------|---------|------------------- | ||
All files | 0 | 0 | 0 | 0 | | ||
types.ts | 0 | 0 | 0 | 0 | | ||
----------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`prints coverage with missing sourcemaps 1`] = ` | ||
" console.log | ||
42 | ||
at Object.log (__tests__/Thing.test.js:10:9) | ||
----------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
----------|---------|----------|---------|---------|------------------- | ||
All files | 100 | 100 | 100 | 100 | | ||
Thing.js | 100 | 100 | 100 | 100 | | ||
x.css | 0 | 0 | 0 | 0 | | ||
----------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`reports coverage with \`resetModules\` 1`] = ` | ||
" console.log | ||
this will print | ||
at log (module.js:11:11) | ||
console.log | ||
this will print | ||
at log (module.js:11:11) | ||
--------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------|---------|----------|---------|---------|------------------- | ||
All files | 60 | 50 | 50 | 60 | | ||
module.js | 66.66 | 50 | 50 | 66.66 | 14-15,19 | ||
uncovered.js | 0 | 100 | 100 | 0 | 8 | ||
--------------|---------|----------|---------|---------|-------------------" | ||
`; | ||
|
||
exports[`vm script coverage generator 1`] = ` | ||
"-------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
-------------|---------|----------|---------|---------|------------------- | ||
All files | 80 | 75 | 66.66 | 80 | | ||
vmscript.js | 80 | 75 | 66.66 | 80 | 20-21 | ||
-------------|---------|----------|---------|---------|-------------------" | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import * as path from 'path'; | ||
import runJest from '../runJest'; | ||
|
||
const DIR = path.resolve(__dirname, '../coverage-provider-v8'); | ||
|
||
test('prints coverage with missing sourcemaps', () => { | ||
const sourcemapDir = path.join(DIR, 'no-sourcemap'); | ||
|
||
const {stdout, stderr, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz'], | ||
{stripAnsi: true}, | ||
); | ||
|
||
expect(stderr).toBe(''); | ||
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
Check failure on line 22 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints coverage with missing sourcemaps
|
||
expect(exitCode).toBe(0); | ||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('prints coverage with empty sourcemaps', () => { | ||
const sourcemapDir = path.join(DIR, 'empty-sourcemap'); | ||
|
||
const {stdout, stderr, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz'], | ||
{stripAnsi: true}, | ||
); | ||
|
||
expect(stderr).toBe(''); | ||
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
Check failure on line 36 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints coverage with empty sourcemaps
|
||
expect(exitCode).toBe(0); | ||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('reports coverage with `resetModules`', () => { | ||
const sourcemapDir = path.join(DIR, 'with-resetModules'); | ||
|
||
const {stdout, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz'], | ||
{stripAnsi: true}, | ||
); | ||
|
||
expect(exitCode).toBe(0); | ||
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xreports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2reports coverage with `resetModules`
Check failure on line 50 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2reports coverage with `resetModules`
|
||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('prints correct coverage report, if a CJS module is put under test without transformation', () => { | ||
const sourcemapDir = path.join(DIR, 'cjs-native-without-sourcemap'); | ||
|
||
const {stdout, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz', '--no-cache'], | ||
{stripAnsi: true}, | ||
); | ||
|
||
expect(exitCode).toBe(0); | ||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('prints correct coverage report, if a TS module is transpiled by Babel to CJS and put under test', () => { | ||
const sourcemapDir = path.join(DIR, 'cjs-with-babel-transformer'); | ||
|
||
const {stdout, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz', '--no-cache'], | ||
{stripAnsi: true}, | ||
); | ||
|
||
expect(exitCode).toBe(0); | ||
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v22.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v20.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v18.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node v16.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Node LTS on Ubuntu with coverage (1/4)prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v20.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v18.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v16.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v18.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v22.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v20.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / macOS with shard 1/3 / Node v22.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node v16.xprints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints correct coverage report
Check failure on line 76 in e2e/__tests__/coverageProviderODZ.test.ts GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2prints correct coverage report
|
||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('prints correct coverage report, if an ESM module is put under test without transformation', () => { | ||
const sourcemapDir = path.join(DIR, 'esm-native-without-sourcemap'); | ||
|
||
const {stdout, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz', '--no-cache'], | ||
{ | ||
nodeOptions: '--experimental-vm-modules --no-warnings', | ||
stripAnsi: true, | ||
}, | ||
); | ||
|
||
expect(exitCode).toBe(0); | ||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('prints correct coverage report, if a TS module is transpiled by custom transformer to ESM put under test', () => { | ||
const sourcemapDir = path.join(DIR, 'esm-with-custom-transformer'); | ||
|
||
const {stdout, exitCode} = runJest( | ||
sourcemapDir, | ||
['--coverage', '--coverage-provider', 'odz', '--no-cache'], | ||
{ | ||
nodeOptions: '--experimental-vm-modules --no-warnings', | ||
stripAnsi: true, | ||
}, | ||
); | ||
|
||
expect(exitCode).toBe(0); | ||
expect(stdout).toMatchSnapshot(); | ||
}); | ||
|
||
test('vm script coverage generator', () => { | ||
const dir = path.resolve(__dirname, '../vmscript-coverage'); | ||
const {stdout, exitCode} = runJest( | ||
dir, | ||
['--coverage', '--coverage-provider', 'odz'], | ||
{stripAnsi: true}, | ||
); | ||
|
||
expect(exitCode).toBe(0); | ||
expect(stdout).toMatchSnapshot(); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,8 @@ | |
"jest": "workspace:*", | ||
"jest-environment-node": "workspace:*", | ||
"psl": "patch:psl@npm:^1.9.0#./.yarn/patches/psl-npm-1.9.0-a546edad1a.patch", | ||
"ts-node@^10.5.0": "patch:ts-node@npm:^10.5.0#./.yarn/patches/ts-node-npm-10.9.1-6c268be7f4.patch" | ||
"ts-node@^10.5.0": "patch:ts-node@npm:^10.5.0#./.yarn/patches/ts-node-npm-10.9.1-6c268be7f4.patch", | ||
"typescript": "~5.5.4" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |