I have configured jest for Lightning web component test. My tests are running and passing but code coverage not displaying into output. Following is package.json
file: -
{
"name": "my-project",
"version": "1.0.0",
"description": "Some description",
"main": "index.js",
"scripts": {
"test:unit": "lwc-jest --coverage",
"test:unit:watch": "lwc-jest --watch",
"test:unit:debug": "lwc-jest --debug"
},
"repository": {
"type": "git",
"url": "some url here"
},
"author": "",
"license": "ISC",
"homepage": "read me file link",
"devDependencies": {
"@salesforce/lwc-jest": "^0.5.1"
},
"jest" : {
"collectCoverage" : true,
"collectCoverageFrom" :[
"**/*.test.js"
]
}
}
I used npm run test:unit
command to run test. and following is my output:
Please suggest me where I am doing wrong. Thanks in advance.