Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1 #2 #3 #4

Merged
merged 1 commit into from
Jul 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
.DS_Store
lib-cov
coverage.html
html-report
6 changes: 5 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"maxlen" : 120,
"indent" : 4,
"predef" : ["describe", "it", "beforeEach"],
"quotmark" : "single"
"quotmark" : "single",
"maxerr": 5,
"maxdepth": 2,
"maxstatements": 12,
"maxcomplexity": 5
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ test/
lib-cov
node_modules
coverage.html
html-report
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BIN = ./node_modules/.bin
MOCHA = $(BIN)/mocha
ISTANBUL = $(BIN)/istanbul
JSHINT = $(BIN)/jshint
JSCS = $(BIN)/jscs

.PHONY: test
test:
$(MOCHA) -u bdd -R spec --recursive

.PHONY: clean
clean:
-rm -rf lib-cov
-rm -rf html-report

.PHONY: lib-cov
lib-cov: clean
$(ISTANBUL) instrument --output lib-cov --no-compact --variable global.__coverage__ lib

.PHONY: coverage
coverage: lib-cov
PACKAGE_COVERAGE=1 $(MOCHA) -u bdd --reporter mocha-istanbul
@echo
@echo Open html-report/index.html file in your browser

.PHONY: lint
lint:
$(JSHINT) .
$(JSCS) .
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"devDependencies" : {
"jshint": "2.1.3",
"mocha": "1.11.0",
"jscs": "1.0.0"
"jscs": "1.0.0",
"istanbul": "0.1.39",
"mocha-istanbul": "*"
},
"bin" : {
"package-bin" : "./bin/package-bin"
},
"scripts": {
"test" : "npm run-script jshint && npm run-script check-style && npm run-script unit-test",
"jshint": "./node_modules/.bin/jshint .",
"unit-test": "./node_modules/.bin/mocha -u bdd -R spec --recursive test",
"check-style": "./node_modules/jscs/bin/jscs .",
"lib-cov": "jscoverage lib lib-cov",
"coverage": "rm -Rf lib-cov && npm run-script lib-cov && PACKAGE_COVERAGE=1 ./node_modules/.bin/mocha -u bdd -R html-cov --recursive test > coverage.html"
"test" : "make test",
"lint": "make lint",
"coverage": "make coverage",
"clean": "make clean"
}
}