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 af8f8bd
Show file tree
Hide file tree
Showing 4 changed files with 14 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.end();
});
});
}

/**
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
1 change: 1 addition & 0 deletions packages/remix/test/integration/test/server/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { assertSentryTransaction, assertSentryEvent, RemixTestEnv } from './util
const useV2 = process.env.REMIX_VERSION === '2';

jest.spyOn(console, 'error').mockImplementation();
jest.setTimeout(10000);

// Repeat tests for each adapter
describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', adapter => {
Expand Down
1 change: 1 addition & 0 deletions packages/remix/test/integration/test/server/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Event } from '@sentry/types';
const useV2 = process.env.REMIX_VERSION === '2';

jest.spyOn(console, 'error').mockImplementation();
jest.setTimeout(10000);

// Repeat tests for each adapter
describe.each(['builtin', 'express'])('Remix API Loaders with adapter = %s', adapter => {
Expand Down

0 comments on commit af8f8bd

Please sign in to comment.