Files
socket.io/test/support/env.js
Damien Arrachequesne 61afc5d8cb fix: remove polyfill for process in the bundle
A polyfill for Node.js "process" was included in the final bundle.

Reference: https://webpack.js.org/configuration/node/
2021-02-02 12:08:26 +01:00

16 lines
409 B
JavaScript

// WARNING this is bad practice
// we only do this in our tests because we need to test engine.io-client
// support in browsers and in node.js
// some tests do not yet work in both
exports.browser = typeof window !== "undefined";
exports.node = !exports.browser;
if (exports.node) {
global.location = {
protocol: "http:",
host: "localhost:3210",
hostname: "localhost",
port: "3210",
};
}