From 4a62c56a0db5a387f5a807892268d0f50aa8cc77 Mon Sep 17 00:00:00 2001 From: Riophae Lee Date: Mon, 12 Aug 2019 06:20:56 +0800 Subject: [PATCH] fuck WSL, finally no more hassels with ChromeHeadless --- package.json | 1 + test/unit/karma.conf.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 40a12b76..c4479b50 100755 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "pre-commit": "^1.2.2", "pug": "^2.0.0", "pug-loader": "^2.4.0", + "puppeteer": "^1.19.0", "raw-loader": "^3.0.0", "regenerator-runtime": "^0.13.1", "rimraf": "^2.6.2", diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index a5d8eefd..0a8d3201 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -1,16 +1,18 @@ const webpackConfig = require('../../build/webpack.test.conf') +process.env.CHROME_BIN = require('puppeteer').executablePath() + module.exports = config => { config.set({ files: [ './index.js' ], - browsers: [ 'CustomChrome' ], + browsers: [ 'ChromeHeadlessWithoutSandbox' ], customLaunchers: { - CustomChrome: { - // `ChromeHeadless` without any flags used to be fine, - // but it is not now for some unknown reason. + ChromeHeadlessWithoutSandbox: { + // `ChromeHeadless` without any flags used to be working + // well, but it is not now for some unknown reason. // Adding `--no-sandbox` flag solves the issue, which - // I know is insecure. But since we are only running - // tests, there would be no problem. + // I know is insecure. But since we are only using + // Chrome to run the tests, it should be just fine. base: 'ChromeHeadless', flags: [ '--no-sandbox' ], },