plasmajs
plasmajs copied to clipboard
Suggestion: Use Jest for testing
Jest is a testing framework from Facebook that attempts to make testing as "delightful" as possible. They do so by eliminating many of the pain points in manual testing, including code coverage and mocking. A benefit to using them would be the simplification of the test
and coverage
scripts. It uses mocha by default, so those two lines simplify down to:
{
"scripts": {
"test": "jest",
"coverage": "jest --coverage"
},
//optional, key for configuring in `package.json`; also available as `jest.config.js`
"jest": {
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": -10
}
}
}
}
The negative number there indicates the number of uncovered statements it can have when testing code coverage.