forked from outmoded/university
-
Notifications
You must be signed in to change notification settings - Fork 0
3.5 Testing with lab and code
zoe-1 edited this page Mar 29, 2015
·
36 revisions
Make directory and files:
./test/index.js and
./test/version.js.
- Ensure package.json and Makefile are configured properly.
Note1: npm run syntax allows you to run custom commands with npm.
See package.json file for example.
This package.json illustrates npm run syntax
"scripts": {
"start": "node start.js",
"test": "lab",
"test-coverage": "lab -t 100",
"test-coverage-html": "lab -r html -o test/coverage.html"
},
The above part of the package.json file allows you to run commands like:
npm run test This executes: lab -t 100.
nom run test-coverage executes:lab -t 100
Note2: Use Makefile to simplify the commands you run.
See sample projects below for Makefile examples.
- Build tests for corresponding file under /lib.
Make recommenations of projects and files to study.
@TheAlphaNerd Assignment3
@Chyld Assignment3
@idanwe Assignment3
@zoe-1 Assignment3