Node/22.8.0/Node Script Update To Experimental Test Coverage

/icons/calendar.svg

Last update

Sep 10, 2024

Node.js now supports requiring code coverage to meet a specific threshold before the process exits successfully. To use this feature, you need to enable the --experimental-test-coverage flag.

Before

{
"name": "my-project",
"version": "1.0.0",
"scripts": {
"start": "node server.js",
},
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"jest": "^27.0.6"
}
}

After

{
"name": "my-project",
"version": "1.0.0",
"scripts": {
"start": "node --experimental-test-coverage server.js",
},
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"jest": "^27.0.6"
}
}

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now