Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
340CT/Softwarequality
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
43 lines (35 sloc)
1.27 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ensuring Software Quality | |
Manual tests are time-consuming and error-prone | |
Range of automated tools available to help ensure quality is maintained | |
All tests are pass/fail | |
When running automated tests, a non-zero exit code means failure. | |
Script Aliases | |
Many commands require a path plus multiple parameters | |
Installed nodejs commands are in the node_modules/.bin directory | |
Avoid having to type these in full by creating script aliases | |
These are stored in the scripts object in the package.json file. | |
Examples of Script Aliases | |
"scripts": { | |
"test": "node_modules/.bin/jest --coverage", | |
"watch": "node_modules/.bin/jest --coverage --watchAll" | |
} | |
Running Code-Coverage as Pass/Fail | |
By default the jest code coverage tool returns 0 (pass) | |
To change this to a pass/fail test you need to tell it what the acceptable thresholds are | |
This should be added to the jest section in your package.json file. | |
Setting the Thresholds | |
"jest": { | |
"testEnvironment": "node", | |
"verbose": true, | |
"coverageThreshold": { | |
"global": { | |
"branches": 100, | |
"functions": 100, | |
"lines": 100, | |
"statements": -10 | |
} | |
} | |
} | |
Parser Options | |
specify the JavaScript language options you want to support (defaults to ECMA5) | |
"parserOptions": { "ecmaVersion": 6,"sourceType": "module",} | |