When I run my test suite, I get an error in a totally different unit test than the one I've been working in. What am I doing wrong?
HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
{
"isTrusted": true
}
It is then followed by some build steps and the following error during test execution:
HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
An error was thrown in afterAll
[object ErrorEvent] thrown
If I comment out certain tests, say in class A, another test fails in Component B. If I comment those out, another test fails in Component C. None of these tests has been updated recently so none of them should be failing.
I saw in this question that some people attribute this issue to the node_modules folder. However, I just mitigated a similar issue to this by reinstalling the node_modules folder yesterday. Is this that common of an error? It can't possibly be the case that developers are supposed to consistently delete and reinstall the node_modules folder. I must have done something wrong but all I've been doing is unit testing like usual.
How can I debug and fix this Headless Chrome error so that I can get back to unit testing?
Here are some stats about my environment:
Relevant Dependency versions:
"@angular/cli": "6.0.8",
"@angular/compiler-cli": "6.0.6",
"@angular/language-service": "6.0.6",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-diff-match-patch": "^2.0.6",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "2.7.2",
"@angular-devkit/build-angular": "~0.6.8"
Relevant Karma.conf settings:
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: false,
customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--headless',
// '--disable-gpu',
'--no-sandbox',
// Without a remote debugging port, Google Chrome exits immediately.
'--remote-debugging-port=9222',
],
}
},
browserDisconnectTolerance: 8,
browserNoActivityTimeout: 60000,
browserDisconnectTimeout: 20000,