We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5e9138 commit badd7b0Copy full SHA for badd7b0
1 file changed
test/setup.js
@@ -1,9 +1,16 @@
1
"use strict";
2
3
/**
4
- * Ensure a global XMLHttpRequest binding exists so strict-mode tests can
5
- * reassign it without throwing ReferenceError in Node.
+ * Ensure global bindings exist so strict-mode tests can reassign them
+ * without throwing ReferenceError in Node.
6
*/
7
if (typeof global.XMLHttpRequest === "undefined") {
8
global.XMLHttpRequest = undefined;
9
}
10
+
11
+// Define a writable global binding for WebSocket when Node does not provide one
12
+if (typeof WebSocket === "undefined") {
13
+ /* eslint-disable no-var */
14
+ var WebSocket = undefined; // creates the global binding
15
+ /* eslint-enable no-var */
16
+}
0 commit comments