Skip to content

Instantly share code, notes, and snippets.

@sebdeckers
Last active August 29, 2015 14:22
Show Gist options
  • Save sebdeckers/7e0bda3f8101b503465e to your computer and use it in GitHub Desktop.
Save sebdeckers/7e0bda3f8101b503465e to your computer and use it in GitHub Desktop.
Codecov / Coverify Example

Sample Output

$ npm run -s report
COVERAGE "c:\\Users\\seb\\Documents\\GitHub\\cbas\\test\\foo.js" [[19,39],[42,47],[42,47]]
COVERED "c:\\Users\\seb\\Documents\\GitHub\\cbas\\test\\foo.js" 2
COVERED "c:\\Users\\seb\\Documents\\GitHub\\cbas\\test\\foo.js" 1
COVERED "c:\\Users\\seb\\Documents\\GitHub\\cbas\\test\\foo.js" 0
function bar() {
return 'hello world'
}
bar() // comment out to drop coverage
// extras: transpiled code issue with coverify
// require('./template.jade')() // ok -- coverify reports invalid range because it covers the non-sourcemapped jadeify output
// require('./template.jade') // fail -- coverify tries to look up the range in original .jade source file and explodes
{
"name": "example-coverify",
"version": "1.0.0",
"description": "Playing around with coverify",
"main": "foo.js",
"scripts": {
"browserify": "browserify . -t jadeify -t coverify",
"report": "npm run -s browserify | node",
"test": "npm run -s report | coverify"
},
"author": "Sebastiaan Deckers <[email protected]>",
"license": "ISC",
"devDependencies": {
"browserify": "^10.2.1",
"coverify": "^1.3.3",
"jadeify": "^4.3.0"
}
}
h1 hello world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment