Karma error - Chrome have not captured in 60000 ms, killing

放肆的年华 提交于 2019-12-04 04:08:56

As Mikey mentioned, setting the NO_PROXY works for me, however it is not via export, but I have to do it inside the karma.conf.js file for Karma to pick this env variable up.

process.env.NO_PROXY = 'localhost, 0.0.0.0/4201, 0.0.0.0/9876'; process.env.no_proxy = 'localhost, 0.0.0.0/4201, 0.0.0.0/9876';

Hopefully it helps some hopeless ppl like me for a day....

I was executing the command on the visual studio code terminal. When I switched to iTerm suddenly it worked.

Try to set a NO_PROXU such as: export NO_PROXY="localhost, 0.0.0.0/4201, 0.0.0.0/9876"

My solution was to update my global installation of Karma to the latest version. I suspect that I could have also just re-installed the existing version as I think the Karma install had gotten corrupted because it didn't matter what browser I used Karma still couldn't connect to it (or it couldn't connect to Karma).

this worked for me:

1) install puppeteer

npm install puppeteer --save-dev

2) add this code to karma conf at the very top of your module exports function:

const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();

3) disable chrome sandbox:

browsers: ['ChromeHeadlessCI'],
customLaunchers: {
    ChromeHeadlessCI: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox']
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!