Skip to content

Commit

Permalink
Correct how config parameters for karma are set (#369)
Browse files Browse the repository at this point in the history
Last time we had an error during test execution on macOS we saw that the
**captureTimeout** parameter was not applied. This happened because the
content of `karma.config.d/karma.conf.js` file was merged into the
following block:

```js
module.exports = function(config) {
 // kotlin configuration
 // ...
 // content from our file
}
```

As a result, it looked like this:

```js
module.exports = function(config) {
 // kotlin configuration
 // ...
 // content from our file
 module.exports = function(config) {
 }
}
```

That was the reason, why our configuration changes were not applied.
Let's see what happens with #307 issue after we correct the
`karma.conf.js`
  • Loading branch information
OptimumCode authored Jan 18, 2025
1 parent dabbc26 commit 945a606
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions karma.config.d/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
module.exports = function(config) {
config.set({
// https://karma-runner.github.io/6.4/config/configuration-file.html#capturetimeout
// default timeout 60_000, but looks like it is not enough for macOS on GitHub runner
// increasing the timeout should help to reduce number of failures
captureTimeout: 120_000,
// the default value is 20_000
// according to the doc, the socket timeout can cause similar error as captureTimeout
// https://karma-runner.github.io/6.4/config/configuration-file.html#browsersockettimeout
browserSocketTimeout: 120_000,
});
};
config.set({
// https://karma-runner.github.io/6.4/config/configuration-file.html#capturetimeout
// default timeout 60_000, but looks like it is not enough for macOS on GitHub runner
// increasing the timeout should help to reduce number of failures
captureTimeout: 120_000,
// the default value is 20_000
// according to the doc, the socket timeout can cause similar error as captureTimeout
// https://karma-runner.github.io/6.4/config/configuration-file.html#browsersockettimeout
browserSocketTimeout: 120_000,
});

// A workaround from https://android-review.googlesource.com/c/platform/frameworks/support/+/3413540
(function() {
Expand Down

0 comments on commit 945a606

Please sign in to comment.