Skip to content

Commit 88b901d

Browse files
charabarukaydrian
authored andcommitted
Ensure tests and coverage will run properly in Windows environments (#139)
1 parent 996d7ce commit 88b901d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Gruntfile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var matchdep = require('matchdep')
2-
, gruntTimer = require('time-grunt');
2+
, gruntTimer = require('time-grunt')
3+
, path = require('path');
34

45
module.exports = function(grunt) {
56
// Dynamically load any preexisting grunt tasks/modules
@@ -9,7 +10,7 @@ module.exports = function(grunt) {
910
gruntTimer(grunt);
1011

1112
var config = {
12-
binPath: './node_modules/.bin'
13+
binPath: path.join('.', 'node_modules', '.bin'),
1314
};
1415

1516
var reporter = grunt.option('reporter') || 'xunit-file';
@@ -46,14 +47,14 @@ module.exports = function(grunt) {
4647
},
4748
shell: {
4849
coverage: {
49-
command : '<%= config.binPath %>/istanbul cover --report lcov --dir test/reports/ <%= config.binPath %>/_mocha test/spec -- --reporter ' + reporter,
50+
command : path.join(config.binPath, 'istanbul') + ' cover --report lcov --dir test/reports/ node_modules/mocha/bin/_mocha test/spec -- --reporter ' + reporter,
5051
options : {
5152
stdout : true,
5253
failOnError : true
5354
}
5455
},
5556
test: {
56-
command: '<%= config.binPath %>/_mocha test/spec'
57+
command: path.join(config.binPath, '_mocha') + ' test/spec'
5758
}
5859
},
5960
coveralls: {

0 commit comments

Comments
 (0)