Skip to content

Commit

Permalink
Attempt to fix builds by configuring Karma listenAddress
Browse files Browse the repository at this point in the history
### Why?

```
07 08 2023 18:16:36.397:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
07 08 2023 18:16:36.398:INFO [launcher]: Launching browsers jsdom with concurrency unlimited
07 08 2023 18:16:36.402:INFO [launcher]: Starting browser jsdom
07 08 2023 18:16:36.421:ERROR [karma-server]: UnhandledRejection: Error: connect ECONNREFUSED ::1:9876
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
07 08 2023 18:16:36.422:ERROR [karma-server]: Error: connect ECONNREFUSED ::1:9876
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '::1',
  port: 9876
}
error Command failed with exit code 1.
```

> The Karma server only listens on IPv4 address (`0.0.0.0`) by default,
> but the requests are sent to `localhost` and `localhost` is resolved
> into IPv6 address (`::`) in Node 17+. So the run request is unable to
> reach the Karma server.

### References

* http://karma-runner.github.io/6.4/config/configuration-file.html#listenaddress
* karma-runner/karma#3730 (comment)
  • Loading branch information
simpleigh committed Aug 7, 2023
1 parent 08cc0d7 commit 73b3d44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -27,6 +27,8 @@ jobs:
run: yarn lint

- name: Test
env:
LISTEN_ADDR: '::'
run: yarn test --single-run

- name: Publish test coverage
Expand Down

0 comments on commit 73b3d44

Please sign in to comment.