Skip to content

Commit

Permalink
change basePath to project root to not confuse karma
Browse files Browse the repository at this point in the history
 The karma-runner has a bug where on Windows the HTML-coverage report is
 saved next to the source file that was tested ie. in build/ next to
 the tested boomerang-0.9.0.js file instead of in the configured
 tests/coverage directory.
  • Loading branch information
andreas-marschke committed Oct 21, 2014
1 parent f71f89c commit 3263705
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions Gruntfile.js
Expand Up @@ -80,23 +80,26 @@ module.exports = function (grunt) {
options: {
configFile: "./karma.config.js",
preprocessors: {
"../build/*.js": ["coverage"],
"./build/*.js": ["coverage"],
},
basePath: "./",
files: [
"./vendor/mocha/mocha.css",
"./vendor/mocha/mocha.js",
"./vendor/chai/chai.js",
"./library/*.js",
"../build/<%= pkg.name %>-<%= pkg.version %>.js"
"tests/vendor/mocha/mocha.css",
"tests/vendor/mocha/mocha.js",
"tests/vendor/chai/chai.js",
"tests/library/*.js",
"./build/<%= pkg.name %>-<%= pkg.version %>.js"
]
},
unit: {
singleRun: true,
browsers: ['PhantomJS']
colors: false,
browsers: ['PhantomJS']
},
dev: {
singleRun: false,
browsers: ['PhantomJS']
colors: false,
browsers: ['Chrome']
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions karma.config.js
Expand Up @@ -4,13 +4,13 @@
module.exports = function(config) {
config.set({

basePath: "./tests",
basePath: "./",

port: 4000,
runnerPort: 4001,
logLevel: config.LOG_INFO,

colors: true,
colors: false,
autoWatch: false,

frameworks: ["mocha"],
Expand All @@ -19,7 +19,7 @@ module.exports = function(config) {

coverageReporter: {
type : 'html',
dir : 'coverage/'
dir : 'tests/coverage/'
}
});
};
Expand Down

0 comments on commit 3263705

Please sign in to comment.