1.0.5 • Published 9 years ago
@trussle/qc v1.0.5
Trussle QC
QC is a tool that performs quality control checks on a Javascript repository. It makes sure that:
- All tests are passing (by calling
npm test) - All code is lint-free (using Trussle's ESLint rules)
- Code coverage is sufficient (using Istanbul)
If any of these checks don't pass, QC won't let you push your changes. Mean, I know - but it's the only way you'll learn.
Installation
QC should be installed as a dependency in your project:
npm install --save-dev @trussle/qcIf you're using mocha, you'll need to change from using mocha to using _mocha; this avoids forking the process, which causes some issues with code coverage.
Usage
On installation, QC will do a few things:
- If there is no
.eslintrc.jsfile, one is added to the root of the project. - If there is no
.istanbul.ymlfile, one is added to the root of your project. - It will set up a Git pre-push hook that runs itself when pushing code, to make sure you're behaving 😘
If you want to run QC yourself, just run ./node_modules/.bin/qc or set up the following script in your package.json:
{
"scripts": {
"qc": "qc"
}
}Assumptions
Please read this section very carefully: if any of these assumptions are not true about your project, QC will fail.
QC assumes the following about your package:
- There is a
testscript in yourpackage.jsonwhich points to an executable in the./node_modules/.bindirectory (not global; usually_mocha).