Skip to content

Simple repro for issues with jest --outputfile --json and code coverage

Notifications You must be signed in to change notification settings

wilhen01/jest-outputfile-bug-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest Outputfile Bug Repro

Simple reproduction to show that the use of --outputfile --json affects coverage output on the command line.

Setup

npm install

Test with outputfile

npm run test-outputfile

Returns output:

❯ npm run test-outputfile

> [email protected] test-outputfile
> jest --outputFile test-results.json --json

 PASS  test/hello.test.ts
  hello world function
    ✓ returns the correct string (1 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.935 s, estimated 3 s
Ran all test suites.
Test results written to: test-results.json

Test without outputfile

npm run test-no-outputfile

Returns output:

❯ npm run test-no-outputfile

> [email protected] test-no-outputfile
> jest

 PASS  test/hello.test.ts
  hello world function
    ✓ returns the correct string (1 ms)

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |     100 |      100 |     100 |     100 |
 index.ts |     100 |      100 |     100 |     100 |
----------|---------|----------|---------|---------|-------------------
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.83 s, estimated 2 s
Ran all test suites.

About

Simple repro for issues with jest --outputfile --json and code coverage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published