From 85b7f52f5cdfaeaeebb4fda0100c839c81ad5a7a Mon Sep 17 00:00:00 2001 From: ossdev Date: Wed, 19 Sep 2018 14:20:51 +0000 Subject: [PATCH] replacing phantomjs with headless chrome --- karma.conf.js | 9 +++++++-- package.json | 6 ++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index ab2d0de..155d087 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -53,8 +53,13 @@ module.exports = function(config) { // - Safari (only Mac) // - PhantomJS // - IE (only Windows) - browsers: ['Chrome'], - + browsers: ['HeadlessChrome'], + customLaunchers: { + HeadlessChrome:{ + base: 'ChromeHeadless', + flags: ['--no-sandbox'] + }, + }, // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits diff --git a/package.json b/package.json index c6158a2..e339c07 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "bundle": "del-cli dist && node ./scripts/bundle.js . Ajv pure_getters", "bundle-beautify": "node ./scripts/bundle.js js-beautify", "build": "del-cli lib/dotjs/*.js '!lib/dotjs/index.js' && node scripts/compile-dots.js", - "test-karma": "karma start --single-run --browsers PhantomJS", + "test-karma": "karma start", "test-browser": "del-cli .browser && npm run bundle && scripts/prepare-tests && npm run test-karma", "test": "npm run jshint && npm run eslint && npm run test-ts && npm run build && npm run test-cov && if-node-version 8 npm run test-browser", "prepublish": "npm run build && npm run bundle", @@ -82,13 +82,11 @@ "jshint": "^2.9.4", "json-schema-test": "^2.0.0", "karma": "^3.0.0", - "karma-chrome-launcher": "^2.0.0", + "karma-chrome-launcher": "^2.2.0", "karma-mocha": "^1.1.1", - "karma-phantomjs-launcher": "^1.0.0", "karma-sauce-launcher": "^1.1.0", "mocha": "^5.1.1", "nyc": "^12.0.1", - "phantomjs-prebuilt": "^2.1.4", "pre-commit": "^1.1.1", "require-globify": "^1.3.0", "typescript": "^2.8.3",