Skip to content

Commit

Permalink
upgrade should
Browse files Browse the repository at this point in the history
  • Loading branch information
aleafs committed Sep 25, 2014
1 parent 8348019 commit 211a6ed
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,7 +1,7 @@
language: node_js
node_js:
- 0.6
- 0.8
- 0.9
- 0.10

script: make test
script: make coveralls
35 changes: 23 additions & 12 deletions Makefile
@@ -1,19 +1,30 @@
TESTS = test/*.test.js
REPORTER = spec
TIMEOUT = 5000
JSCOVERAGE = ./node_modules/visionmedia-jscoverage/jscoverage --encoding=utf-8
MOCHA = ./node_modules/mocha/bin/mocha
NPM_REGISTRY =
NPM_INSTALL_PRODUCTION = PYTHON=`which python2.6` NODE_ENV=production npm install $(NPM_REGISTRY)
NPM_INSTALL_TEST = PYTHON=`which python2.6` NODE_ENV=test npm install $(NPM_REGISTRY)

test:
@npm install
@NODE_ENV=test $(MOCHA) --reporter $(REPORTER) --timeout $(TIMEOUT) $(MOCHA_OPTS) $(TESTS)
MOCHA_OPTS =

cov:
@npm install
-npm install visionmedia-jscoverage
-rm -rf lib.bak
-mv -f lib lib.bak && ${JSCOVERAGE} lib.bak lib
-$(MOCHA) --reporter html-cov --timeout $(TIMEOUT) $(MOCHA_OPTS) $(TESTS) > ./coverage.html
-rm -rf lib && mv -f lib.bak lib
init:
@$(NPM_INSTALL_TEST)

test: init
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

cov: init
-rm -f coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov

coveralls: init
@$(MAKE) test
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js

.PHONY: test
1 change: 1 addition & 0 deletions README.md
@@ -1,4 +1,5 @@
[![Build Status](https://secure.travis-ci.org/aleafs/build4js.png?branch=master)](http://travis-ci.org/aleafs/build4js)
[![Coverage Status](https://coveralls.io/repos/aleafs/build4js/badge.png)](https://coveralls.io/r/aleafs/build4js)

## About

Expand Down
24 changes: 20 additions & 4 deletions package.json
Expand Up @@ -3,7 +3,11 @@
"version": "0.1.4",
"author": "Aleafs Zhang (zhangxc83@gmail.com)",
"contributors": [],
"homepage": "git@github.com:aleafs/build4js.git",
"homepage": "https://github.com/aleafs/build4js",
"repository": {
"type": "git",
"url": "git@github.com:aleafs/build4js.git"
},
"description": "build4js a lightweight build tool for Node.js",
"keywords": [ "build", "ci" ],
"dependencies": {},
Expand All @@ -12,10 +16,22 @@
},
"devDependencies": {
"mocha" : ">=0.9.0",
"should" : ">=0.4.2"
"should" : ">=4.0.0",
"blanket": "*",
"coveralls" : "*",
"travis-cov": "*",
"mocha-lcov-reporter": "*"
},
"main": "./index.js",
"scripts": {
"test": "make test"
"main" : "index.js",
"test" : "make test"
},
"config" : {
"blanket": {
"pattern": "//^((?!(node_modules|test)).)*$/"
},
"travis-cov": {
"threshold": 90
}
}
}
6 changes: 3 additions & 3 deletions test/fileset.test.js
Expand Up @@ -17,7 +17,7 @@ describe('fileset test', function () {
(true).should.eql(false);
}
});
_files.should.include(__filename);
_files.should.containEql(__filename);

fileset(__filename, function(fname) {
fname.toString().should.eql(__filename);
Expand All @@ -30,7 +30,7 @@ describe('fileset test', function () {
});
(true).should.eql(false);
} catch (e) {
e.message.should.include('ENOENT, no such file or directory');
e.message.should.containEql('ENOENT, no such file or directory');
}
_files.should.eql([]);
});
Expand All @@ -55,7 +55,7 @@ describe('fileset test', function () {
f.setmode(0644, './i_am_not_exists');
(true).should.eql(false);
} catch (e) {
e.message.should.include('ENOENT, no such file or directory');
e.message.should.containEql('ENOENT, no such file or directory');
}
done();
});
Expand Down

0 comments on commit 211a6ed

Please sign in to comment.