Last active
January 1, 2016 23:09
-
-
Save fiveisprime/8214397 to your computer and use it in GitHub Desktop.
Makefile with lint (JSHint), test (mocha), and coverage. Uses locally install modules - make sure that jshint, mocha, and istanbul are devDependencies.
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
SRC = $(wildcard *.js) | |
test: $(SRC) | |
@node_modules/.bin/jshint $^ | |
@node_modules/.bin/istanbul test node_modules/.bin/_mocha \ | |
-R spec -- \ | |
--require should \ | |
--reporter spec | |
# Uncomment if your tests are in a directory named test. | |
# .PHONY: test |
could you help me out with my makefile? https://github.com/keystonejs/keystone/blob/testing-overhaul/Makefile @fiveisprime When I run make test
it tries to run jshint then mocha. But if there are any jshint errors mocha never runs. Also when I just run make lint
make complains about error 2.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
package.json
:Run
npm test
to run tests,npm test --coverage
to generate the coverage report.