Skip to content

Commit 03a493d

Browse files
committed
fix(node-core): do not print rejection warning in strict mode
This matches the behavior of Node.js.
1 parent d75440c commit 03a493d

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

  • dev-packages/node-core-integration-tests/suites/public-api/onUnhandledRejectionIntegration
  • packages/node-core/src/integrations

dev-packages/node-core-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Error: test rejection
5252
expect(err?.code).toBe(1);
5353
expect(stdout).not.toBe("I'm alive!");
5454
expect(stderr)
55-
.toContain(`This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
56-
test rejection`);
55+
.toBe('');
5756
done();
5857
});
5958
}));

packages/node-core/src/integrations/onunhandledrejection.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ function handleRejection(reason: unknown, mode: UnhandledRejectionMode): void {
143143
console.error(reason && typeof reason === 'object' && 'stack' in reason ? reason.stack : reason);
144144
});
145145
} else if (mode === 'strict') {
146-
consoleSandbox(() => {
147-
console.warn(rejectionWarning);
148-
});
149146
logAndExitProcess(reason);
150147
}
151148
/* eslint-enable no-console */

0 commit comments

Comments
 (0)