commit
b84be89095
@ -156,16 +156,19 @@ exports.build = function (compsBase32, buildName) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.test = function() {
|
exports.test = function() {
|
||||||
var testacular = require('testacular'),
|
var karma = require('karma'),
|
||||||
testConfig = {configFile : __dirname + '/../spec/testacular.conf.js'};
|
testConfig = {configFile : __dirname + '/../spec/karma.conf.js'};
|
||||||
|
|
||||||
testConfig.browsers = ['PhantomJS'];
|
testConfig.browsers = ['PhantomJS'];
|
||||||
isArgv('--chrome') && testConfig.browsers.push('Chrome');
|
|
||||||
isArgv('--ff') && testConfig.browsers.push('Firefox');
|
|
||||||
|
|
||||||
// will work only with new testacular that supports code coverage (today it's in master)
|
if (isArgv('--chrome')) {
|
||||||
if (isArgv('--cov')) { // temporary hack until testacular with coverage becomes stable
|
testConfig.browsers.push('Chrome');
|
||||||
testacular = require('../node_modules/testacular/lib/index.js'); // use local testacular
|
}
|
||||||
|
if (isArgv('--ff')) {
|
||||||
|
testConfig.browsers.push('Firefox');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isArgv('--cov')) {
|
||||||
testConfig.preprocessors = {
|
testConfig.preprocessors = {
|
||||||
'**/src/**/*.js': 'coverage',
|
'**/src/**/*.js': 'coverage',
|
||||||
};
|
};
|
||||||
@ -176,9 +179,9 @@ exports.test = function() {
|
|||||||
testConfig.reporters = ['coverage'];
|
testConfig.reporters = ['coverage'];
|
||||||
}
|
}
|
||||||
|
|
||||||
testacular.server.start(testConfig);
|
karma.server.start(testConfig);
|
||||||
|
|
||||||
function isArgv(optName){
|
function isArgv(optName) {
|
||||||
return process.argv.indexOf(optName) !== -1;
|
return process.argv.indexOf(optName) !== -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"description": "JavaScript library for mobile-friendly interactive maps",
|
"description": "JavaScript library for mobile-friendly interactive maps",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint": "~1.1.0",
|
"jshint": "~1.1.0",
|
||||||
"testacular": "~0.6.0",
|
"karma": "~0.8.0",
|
||||||
"uglify-js": "~2.2.5",
|
"uglify-js": "~2.2.5",
|
||||||
"jake": "~0.5.10"
|
"jake": "~0.5.10"
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Testacular configuration
|
// Karma configuration
|
||||||
var libSources = require(__dirname+'/../build/build.js').getFiles();
|
var libSources = require(__dirname+'/../build/build.js').getFiles();
|
||||||
|
|
||||||
// base path, that will be used to resolve files and exclude
|
// base path, that will be used to resolve files and exclude
|
||||||
@ -13,7 +13,7 @@ files = [].concat([
|
|||||||
JASMINE,
|
JASMINE,
|
||||||
JASMINE_ADAPTER,
|
JASMINE_ADAPTER,
|
||||||
"before.js",
|
"before.js",
|
||||||
"testacular.js"
|
"karma.js"
|
||||||
], libSources, [
|
], libSources, [
|
||||||
"after.js",
|
"after.js",
|
||||||
"happen.js",
|
"happen.js",
|
Loading…
Reference in New Issue
Block a user