Skip to content

Commit

Permalink
Move coverage files in test
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisGuillem committed Aug 16, 2017
1 parent 7a441ee commit 02779a4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/node_modules
/coverage
/test/coverage
/test/results
7 changes: 4 additions & 3 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ module.exports = function(grunt) {
all: 'test/test.html'
},
makeReport: {
src: 'coverage/coverage.json',
src: 'test/coverage/coverage.json',
options: {
type: 'lcov',
dir: 'coverage',
dir: 'test/coverage',
print: 'detail'
}
}
Expand All @@ -69,7 +69,8 @@ module.exports = function(grunt) {
// Default task(s).
grunt.registerTask('build', ['browserify', 'uglify']);
grunt.registerTask("build-test", ['browserify:test']);
grunt.registerTask("test", ["build-test", "mocha_phantomjs", "makeReport"])
grunt.registerTask("test", ["build-test", "mocha_phantomjs"]);
grunt.registerTask("coverage", ["test", "makeReport"]);
grunt.registerTask('default', ['watch:source']);

};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "A template to write robust client-side javascript libraries",
"main": "src/main.js",
"scripts": {
"test": "mocha-phantomjs ./test/test.html --hooks ./test/src/phantom_hooks.js -R xunit -f test/results/result.xml",
"coverage-report": "istanbul report --root coverage lcov"
"test": "mocha-phantomjs ./test/test.html --hooks ./test/src/phantom_hooks.js -R xunit -f test/results/result.xml"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions test/src/phantom_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = {
});

if (coverage) {
console.log('Writing coverage to coverage/coverage.json');
fs.write('coverage/coverage.json', JSON.stringify(coverage), 'w');
console.log('Writing coverage to test/coverage/coverage.json');
fs.write('test/coverage/coverage.json', JSON.stringify(coverage), 'w');
} else {
console.log('No coverage data generated');
}
Expand Down
6 changes: 3 additions & 3 deletions test/test.js

Large diffs are not rendered by default.

0 comments on commit 02779a4

Please sign in to comment.