-
Notifications
You must be signed in to change notification settings - Fork 465
Closed
Labels
Description
🐛 Bug Report
I'm developing a small library ( just an index.ts and index.spec.ts for tests) and apparently jest is ignoring the coverage from index.ts although the tests are passing!
To Reproduce
Steps to reproduce the behavior:
npm init
npm i -D webpack webpack-cli @webpack-cli/init
Init the project with default typescript settings:
webpack init
npm i -D jest typescript ts-jest @types/jest
npx ts-jest config:init
npm run test -- --collect-coverage
This the structure of the project:
jest.config:
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: [
"<rootDir>/src"
]
};
Expected behavior
Collect coverage
Link to repo (highly encouraged)
Debug log:
# content of ts-jest.log :
envinfo
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
Npm packages:
jest: 26.6.1
ts-jest: 26.4.3
typescript: 4.0.5
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@types/jest": "^26.0.15",
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
hamzahamidi commentedon Nov 4, 2020
I was able to solve this by changing the name of the file (index.ts)
ahnpnl commentedon Nov 4, 2020
Duplicate with #2090
You need to clear jest cache first before running the tests.
@jest/create-cache-key-function
#2108fix: revert usage of `@jest/create-cache-key-function` (#2108)