Permalink
Browse files

Setup npm run-script cov

  • Loading branch information...
1 parent e813748 commit 75d044d9d6c9dd00c27f920d5149021a10dc54b1 @andreyvit committed Nov 23, 2012
Showing with 13 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 .npmignore
  3. +4 −0 README.md
  4. +3 −2 package.json
  5. +1 −1 test/colorize_test.coffee
  6. +1 −1 test/diff_test.coffee
View
@@ -1,3 +1,5 @@
node_modules
*.js
!bin/*.js
+/lib-cov
+coverage.html
View
@@ -1,3 +1,5 @@
*.iced
*.coffee
/example
+/lib-cov
+coverage.html
View
@@ -50,6 +50,10 @@ Run:
npm test
+Test coverage report:
+
+ npm run-script cov
+
Output:
colorize
View
@@ -10,15 +10,16 @@
"main": "lib/index.js",
"bin": "bin/json-diff.js",
"scripts": {
- "test": "./node_modules/mocha/bin/mocha"
+ "test": "./node_modules/mocha/bin/mocha",
+ "cov": "rm -rf lib-cov; jscoverage lib lib-cov; env JSLIB=lib-cov mocha -R dot && env JSLIB=lib-cov mocha -R html-cov >coverage.html; open coverage.html"
},
"dependencies": {
"dreamopt": "~0.6.0",
"difflib": "~0.2.1",
"cli-color": "~0.1.6"
},
"devDependencies": {
- "mocha": "~1.0.1"
+ "mocha": "~1.7.0"
},
"optionalDependencies": {},
"engines": {
@@ -1,6 +1,6 @@
assert = require 'assert'
-{ colorizeToArray } = require '../lib/colorize'
+{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorize', ->
View
@@ -1,6 +1,6 @@
assert = require 'assert'
-{ diff } = require '../lib/index'
+{ diff } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->

0 comments on commit 75d044d

Please sign in to comment.