From 537eeb2705786901a2b6c6484e5e512f601aa582 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Wed, 23 Feb 2022 21:16:48 +0530 Subject: [PATCH] test: add case for `open` with `server` option (#4309) * test: add case for `open` with `server` option * test: add case for `open` with `server` option --- test/server/open-option.test.js | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/server/open-option.test.js b/test/server/open-option.test.js index d811137a14..23e1cb1526 100644 --- a/test/server/open-option.test.js +++ b/test/server/open-option.test.js @@ -63,6 +63,42 @@ describe('"open" option', () => { }); }); + it("should work with the server: 'https' option", async () => { + const server = new Server( + { + open: true, + port, + server: "https", + }, + compiler + ); + + await server.start(); + await server.stop(); + + expect(open).toHaveBeenCalledWith(`https://localhost:${port}/`, { + wait: false, + }); + }); + + it("should work with the server: 'spdy' option", async () => { + const server = new Server( + { + open: true, + port, + server: "spdy", + }, + compiler + ); + + await server.start(); + await server.stop(); + + expect(open).toHaveBeenCalledWith(`https://localhost:${port}/`, { + wait: false, + }); + }); + it("should work with '0.0.0.0' host", async () => { const host = "0.0.0.0";