In my AngularJS, npm times out when running tests, with message "Disconnectedreconnect failed before timeout of Xs" . My karma.conf.js file is configured as such:
...
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 100000,
...
Increasing these values didn't help - the same error would appear after the newly specified amount of time.
I solved it by adding this to my karma.conf.js file, below the browserNoActivityTimeout property.
flags: [
'--disable-gpu',
'--no-sandbox'
]
From https://peter.sh/experiments/chromium-command-line-switches/:
I had to use both of these in combination to eradicate the timeout in my project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With