Skip to content

Commit

Permalink
Add travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Jun 8, 2015
1 parent 4cbcb9b commit beb0c7a
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
.idea/
.idea/
coverage
42 changes: 42 additions & 0 deletions .jshintrc
@@ -0,0 +1,42 @@
{
"predef": [
"document",
"module",
"require",
"__dirname",
"process",
"console",
"it",
"xit",
"describe",
"xdescribe",
"before",
"beforeEach",
"after",
"afterEach"
],

"node": true,
"es5": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"latedef": true,
"noarg": true,
"noempty": true,
"nonew": true,
"plusplus": false,
"undef": true,
"strict": false,
"trailing": false,
"globalstrict": true,
"nonstandard": true,
"white": false,
"indent": 2,
"expr": true,
"multistr": true,
"onevar": false,
"unused": "vars"
}
6 changes: 6 additions & 0 deletions .travis.yml
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "0.12"
- "0.11"
- "0.10"
script: make test-coveralls
26 changes: 26 additions & 0 deletions Makefile
@@ -0,0 +1,26 @@
TESTS = test/*.js
REPORTER = spec
TIMEOUT = 20000
ISTANBUL = ./node_modules/.bin/istanbul
MOCHA = ./node_modules/mocha/bin/_mocha
COVERALLS = ./node_modules/coveralls/bin/coveralls.js

clean:
@rm -rf node_modules

test:
@NODE_ENV=test $(MOCHA) -r should -R $(REPORTER) -t $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-cov:
@$(ISTANBUL) cover --report html $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS)

test-coveralls:
@$(ISTANBUL) cover --report lcovonly $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS)
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@cat ./coverage/lcov.info | $(COVERALLS) && rm -rf ./coverage

test-all: test test-coveralls

.PHONY: test
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -21,12 +21,17 @@
},
"devDependencies": {
"express": "~4.10.0",
"supertest": "*",
"mocha": "*",
"should": "~3.0.0",
"methods": "0.0.1"
"travis-cov": "*",
"coveralls": "*",
"mocha-lcov-reporter": "*",
"istanbul": "*",
"methods": "*"
},
"scripts": {
"test": "./node_modules/.bin/mocha -r should -R spec"
"test": "make test"
},
"bugs": {
"url": "https://github.com/JacksonTian/ejs-mate/issues"
Expand Down

0 comments on commit beb0c7a

Please sign in to comment.