Skip to content

Commit

Permalink
test(remix): Test Remix SDK on Node 20.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Jul 18, 2023
1 parent cfd2149 commit 3a57479
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14, 16, 18]
node: [14, 16, 18, 20]
remix: [1, 2]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
Expand Down
14 changes: 11 additions & 3 deletions packages/node-integration-tests/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ export class TestEnv {
public constructor(public readonly server: http.Server, public readonly url: string) {
this.server = server;
this.url = url;

// We need to destroy the socket after the response has been sent
// to prevent the server.close (called inside nock interceptor) from hanging in tests.
// Otherwise the tests may timeout. (Happening on Node 20)
// See: https://github.com/nodejs/node/issues/2642
this.server.on('request', (req, res) => {
res.on('finish', () => {
req.socket.destroy();
});
});
}

/**
Expand Down Expand Up @@ -244,9 +254,7 @@ export class TestEnv {
// Ex: Remix scope bleed tests.
nock.cleanAll();

this.server.close(() => {
resolve(envelopes);
});
this.server.close();
}

resolve(envelopes);
Expand Down

0 comments on commit 3a57479

Please sign in to comment.