Skip to content

Commit f92d6f0

Browse files
aladdin-addnot-an-aardvark
authored andcommitted
Build: Add karma-chrome-launcher support (#11027)
* Revert "Revert "Build: Use karma-chrome-launcher to run tests (#10898)" (#10973)" This reverts commit 536611a. * Build: add devdeps [email protected] * Chore: set the path to chromium binary
1 parent 166853d commit f92d6f0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

karma.conf.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use strict";
22

3+
process.env.CHROME_BIN = require("puppeteer").executablePath();
4+
35
module.exports = function(config) {
46
config.set({
57

@@ -67,8 +69,13 @@ module.exports = function(config) {
6769

6870
// start these browsers
6971
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
70-
browsers: ["PhantomJS"],
71-
72+
browsers: ["HeadlessChrome"],
73+
customLaunchers: {
74+
HeadlessChrome: {
75+
base: 'ChromeHeadless',
76+
flags: [ '--no-sandbox', ],
77+
},
78+
},
7279

7380
// Continuous Integration mode
7481
// if true, Karma captures browsers, runs the tests and exits

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,17 @@
9797
"jsdoc": "^3.5.5",
9898
"karma": "^3.0.0",
9999
"karma-babel-preprocessor": "^7.0.0",
100+
"karma-chrome-launcher": "^2.2.0",
100101
"karma-mocha": "^1.3.0",
101102
"karma-mocha-reporter": "^2.2.3",
102-
"karma-phantomjs-launcher": "^1.0.4",
103103
"leche": "^2.2.3",
104104
"load-perf": "^0.2.0",
105105
"markdownlint": "^0.11.0",
106106
"mocha": "^5.0.5",
107107
"mock-fs": "^4.6.0",
108108
"npm-license": "^0.3.3",
109-
"phantomjs-prebuilt": "^2.1.16",
110109
"proxyquire": "^2.0.1",
110+
"puppeteer": "^1.9.0",
111111
"shelljs": "^0.8.2",
112112
"sinon": "^3.3.0",
113113
"temp": "^0.8.3",

0 commit comments

Comments
 (0)