diff --git a/lib/engine.io.js b/lib/engine.io.js index 2c1ce9d10..43f7c371b 100644 --- a/lib/engine.io.js +++ b/lib/engine.io.js @@ -26,7 +26,7 @@ exports = module.exports = function() { } // if first argument is not an http server, then just make a regular eio server - return new Server(arguments); + return new Server(...arguments); }; /** diff --git a/test/engine.io.js b/test/engine.io.js index 121754ccf..23f7034e6 100644 --- a/test/engine.io.js +++ b/test/engine.io.js @@ -25,6 +25,11 @@ describe("engine", () => { expect(engine).to.be.an(eio.Server); expect(engine.ws).to.be.ok(); }); + + it("should pass options correctly to the Server", () => { + const engine = eio({ cors: true }); + expect(engine.opts).to.have.property("cors", true); + }); }); describe("listen", () => {