Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 130a318

Browse files
authored
Merge pull request #382 from Jyyjy/event_type
Changed event constructor for node.js 19+
2 parents 4a27337 + 35326f9 commit 130a318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/sendLogs_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('sendLogs', () => {
9797
};
9898
sendOnClose([], {on: true, url: 'test'})
9999
sendOnClose([{foo: 'bar'}], {on: true, url: 'test'});
100-
global.window.dispatchEvent(new CustomEvent('pagehide'))
100+
global.window.dispatchEvent(new window.CustomEvent('pagehide'))
101101
sinon.assert.calledOnce(sendBeaconSpy)
102102
});
103103

@@ -107,7 +107,7 @@ describe('sendLogs', () => {
107107
sendBeacon: sendBeaconSpy
108108
};
109109
sendOnClose([{foo: 'bar'}], {on: false, url: 'test'});
110-
global.window.dispatchEvent(new CustomEvent('pagehide'))
110+
global.window.dispatchEvent(new window.CustomEvent('pagehide'))
111111
sinon.assert.notCalled(sendBeaconSpy)
112112
});
113113
});

0 commit comments

Comments
 (0)