This repository demonstrate a simple coverage example using:
The jest example is failing at coverage report.
Linked issue: jestjs/jest#1214.
git clone [email protected]:vvo/test-coverage-jest.git
cd test-coverage-jest
npm install
npm test
> [email protected] test /home/vvo/Dev/Algolia/test-coverage
> npm run test:mocha && npm run test:jest
> [email protected] test:mocha /home/vvo/Dev/Algolia/test-coverage
> NODE_ENV=test nyc mocha --compilers js:babel-register
test
โ works
1 passing (345ms)
----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------------|----------|----------|----------|----------|----------------|
test-coverage/ | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
----------------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
----------------|----------|----------|----------|----------|----------------|
> [email protected] test:jest /home/vvo/Dev/Algolia/test-coverage
> jest --no-cache --coverage
Using Jest CLI v13.0.0, jasmine2
PASS __tests__/index.js (0.093s)
1 test passed (1 total in 1 test suite, run time 0.601s)
----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------------|----------|----------|----------|----------|----------------|
test-coverage/ | 50 | 100 | 0 | 50 | |
index.js | 50 | 100 | 0 | 50 | 2 |
----------------|----------|----------|----------|----------|----------------|
All files | 50 | 100 | 0 | 50 | |
----------------|----------|----------|----------|----------|----------------|