You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make directory and files:
./test/index.js
./test/version.js.
Configure package.json and Makefile for testing
step1: Configure package.json to allow npm to execute needed test commands.
npm run syntax allows you to run custom commands with npm. This package.json illustrates npm run syntax
The above part of the package.json file allows you to run commands like:
npm run test // This executes: lab -t 100.
npm run test-coverage // executes:lab -t 100
step2: Use Makefile to simplify the commands you run.
Important: put ".PHONY: all test clean" in your make file to ensure the
command "make test" does not conflict with the ./test directory.
See Sample Makefile
Build tests for corresponding files in /lib.
Make sure you get 100% coverage.
Important: Use your Makefile commands as short cuts to execute your tests.
For example:
make test (should run your tests)
make cov (should run your coverage tests)
See Sample Makefile