diff options
author | Pete Richards <peter.l.richards@nasa.gov> | 2016-01-15 22:15:01 +0300 |
---|---|---|
committer | Pete Richards <peter.l.richards@nasa.gov> | 2016-01-19 00:57:32 +0300 |
commit | db7560c31fed2291c37ab1da288be1053ee60525 (patch) | |
tree | 04bff394304a49aef71fb04ef9b4d145a17b6a64 | |
parent | 6fc028e11200c57303741db68c08f8ff03af3eb0 (diff) |
[Test] Use PhantomJS to run testsnem-build-fixes
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
-rw-r--r-- | karma.conf.js | 2 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | test-main.js | 10 |
3 files changed, 12 insertions, 3 deletions
diff --git a/karma.conf.js b/karma.conf.js index 8ce816223..636442bc2 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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. diff --git a/package.json b/package.json index d325fe5bb..906a733fe 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/test-main.js b/test-main.js index 09edf9854..c73af2688 100644 --- a/test-main.js +++ b/test-main.js @@ -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); + }); + } }); |