Don't remove existing unhandled exception and promise rejection handlers in Node

This commit is contained in:
Steve Gravrock
2025-09-14 14:49:55 -07:00
parent 2c6ce35ccc
commit 5439c8c9cd
3 changed files with 25 additions and 75 deletions
+3 -9
View File
@@ -142,11 +142,9 @@ describe('GlobalErrors', function() {
errors.install();
expect(globals.listeners.uncaughtException).toEqual([
originalHandler,
jasmine.any(Function)
]);
expect(globals.listeners.uncaughtException).not.toEqual([
originalHandler()
]);
errors.pushListener(handler);
@@ -175,11 +173,9 @@ describe('GlobalErrors', function() {
errors.install();
expect(globals.listeners.unhandledRejection).toEqual([
originalHandler,
jasmine.any(Function)
]);
expect(globals.listeners.unhandledRejection).not.toEqual([
originalHandler()
]);
errors.pushListener(handler);
@@ -257,11 +253,9 @@ describe('GlobalErrors', function() {
errors.install();
expect(globals.listeners.rejectionHandled).toEqual([
originalHandler,
jasmine.any(Function)
]);
expect(globals.listeners.rejectionHandled).not.toEqual([
originalHandler
]);
errors.uninstall();
expect(globals.listeners.rejectionHandled).toEqual([originalHandler]);