Makefile 695 B

123456789101112131415161718192021222324252627282930313233343536
  1. NPM=./node_modules/.bin
  2. test: dependencies
  3. @$(NPM)/_mocha \
  4. --reporter $(if $(or $(TEST),$(V)),spec,dot) \
  5. --slow 600 --timeout 2000 \
  6. --grep '$(TEST)'
  7. lint: dependencies
  8. @$(NPM)/jshint --config .jshintrc \
  9. validator.js test/*.js
  10. dependencies: node_modules
  11. node_modules:
  12. @echo "Installing dependencies.."
  13. @npm install
  14. coverage: dependencies
  15. @$(NPM)/istanbul cover $(NPM)/_mocha -- --reporter spec
  16. @open coverage/lcov-report/validator.js/validator.js.html
  17. clean:
  18. @rm -rf coverage
  19. distclean: clean
  20. @rm -rf node_modules
  21. min: validator.min.js
  22. %.min.js: %.js dependencies
  23. @$(NPM)/uglifyjs --compress --mangle --comments '/Copyright/' $< > $@
  24. check: test
  25. deps: dependencies