[Test] Use PhantomJS to run tests

Switch Karma to use PhantomJS to run tests.  CI machines no longer
need to have Chrome installed.

Implemented after changes to build process due to imperative registration.

https://github.com/nasa/openmctweb/issues/450
This commit is contained in:
Pete Richards 2016-01-15 11:15:01 -08:00
parent 6fc028e112
commit db7560c31f
3 changed files with 12 additions and 3 deletions

View File

@ -71,7 +71,7 @@ module.exports = function(config) {
// Specify browsers to run tests in.
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [
'Chrome'
'PhantomJS'
],
// Code coverage reporting.

View File

@ -17,12 +17,13 @@
"karma-coverage": "^0.5.3",
"karma-html-reporter": "^0.2.7",
"karma-jasmine": "^0.1.5",
"karma-phantomjs-launcher": "^0.1.4",
"karma-phantomjs-launcher": "^0.2.3",
"karma-requirejs": "^0.2.2",
"lodash": "^3.10.1",
"markdown-toc": "^0.11.7",
"marked": "^0.3.5",
"mkdirp": "^0.5.1",
"phantomjs": "^1.9.19",
"requirejs": "^2.1.17",
"split": "^1.0.0"
},

View File

@ -51,5 +51,13 @@ require.config({
deps: allTestFiles,
// we have to kickoff jasmine, as it is asynchronous
callback: window.__karma__.start
callback: function () {
var args = [].slice.apply(arguments);
require(['es6-promise'], function (es6Promise) {
if (!window.Promise) {
window.Promise = es6Promise.Promise;
}
window.__karma__.start.apply(window.__karma__, args);
});
}
});