From 73b3d4436bbca591b4223810ea5d532b76775e86 Mon Sep 17 00:00:00 2001 From: Leigh Simpson Date: Mon, 7 Aug 2023 19:21:14 +0100 Subject: [PATCH] Attempt to fix builds by configuring Karma `listenAddress` ### 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 * https://github.com/karma-runner/karma/issues/3730#issuecomment-1122075632 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0b3f836..0cc35d3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,8 @@ jobs: run: yarn lint - name: Test + env: + LISTEN_ADDR: '::' run: yarn test --single-run - name: Publish test coverage