github上面 好多都是mocha,jscover;
使用makefile
make test
make
make run 什么的
TESTS = $(shell find test -type f -name "*.test.js")
TEST_TIMEOUT = 10000
MOCHA_REPORTER = spec
# NPM_REGISTRY = "--registry=http://registry.npm.taobao.org"
NPM_REGISTRY = ""
all: test
install:
@npm install $(NPM_REGISTRY)
pretest:
@if ! test -f config.js; then \
cp config.default.js config.js; \
fi
@if ! test -d public/upload; then \
mkdir public/upload; \
fi
test: install pretest
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(MOCHA_REPORTER) \
-r should \
-r test/env \
--timeout $(TEST_TIMEOUT) \
$(TESTS)
集成.travis.yml
项目开发中应该用不到makefile travis吧?