Merge pull request #5 from yemel/karma-conf

Add karma config
This commit is contained in:
Esteban Ordano 2015-01-16 12:18:03 -03:00
commit e8dd0143d3
3 changed files with 43 additions and 1 deletions

View File

@ -68,7 +68,7 @@ function startGulp(name, opts) {
};
var testkarma = shell.task([
'./node_modules/karma/bin/karma start'
'./node_modules/bitcore-build/node_modules/karma/bin/karma start ./node_modules/bitcore-build/karma.conf.js'
]);
gulp.task('test:node', testmocha);

36
karma.conf.js Normal file
View File

@ -0,0 +1,36 @@
'use strict';
// karma.conf.js
module.exports = function(config) {
config.set({
browsers: ['Firefox'],
frameworks: ['mocha', 'detectBrowsers'],
detectBrowsers: {
enabled: true,
usePhantomJS: false,
postDetection: function(availableBrowser) {
// modify to enable additional browsers if available
var runBrowsers = ['Firefox', 'Chrome'];
var browsers = [];
for(var i = 0; i < runBrowsers.length; i++) {
if(~availableBrowser.indexOf(runBrowsers[i])) {
browsers.push(runBrowsers[i]);
}
}
return browsers;
}
},
singleRun: true,
files: [
'./../../tests.js' // project root
],
plugins: [
'karma-mocha',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-detect-browsers'
]
});
};

View File

@ -49,6 +49,12 @@
"gulp-shell": "^0.2.10",
"gulp-uglify": "^1.0.2",
"gulp-util": "=3.0.1",
"mocha": "^2.0.1",
"karma": "^0.12.28",
"karma-firefox-launcher": "^0.1.3",
"karma-chrome-launcher": "^0.1.7",
"karma-detect-browsers": "^0.1.3",
"karma-mocha": "^0.1.9",
"lodash": "^2.4.1",
"plato": "^1.3.0",
"run-sequence": "^1.0.2"