From ad91fc63b3b09297eb1b0a410a1f63c75db63fa0 Mon Sep 17 00:00:00 2001 From: Rishabh Chawla Date: Sat, 19 Sep 2020 10:22:34 +0530 Subject: [PATCH] tests: add test for watching prop --- test/Compiler.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/Compiler.test.js b/test/Compiler.test.js index 59b1db33c..f12f70944 100644 --- a/test/Compiler.test.js +++ b/test/Compiler.test.js @@ -517,6 +517,23 @@ describe("Compiler", () => { }); }); }); + it("should set compiler.watching correctly", function (done) { + const compiler = webpack({ + context: __dirname, + mode: "production", + entry: "./c", + output: { + path: "/directory", + filename: "bundle.js" + } + }); + compiler.outputFileSystem = createFsFromVolume(new Volume()); + const watching = compiler.watch({}, (err, stats) => { + if (err) return done(err); + done(); + }); + expect(compiler.watching).toBe(watching); + }); it("should watch again correctly after first closed watch", function (done) { const compiler = webpack({ context: __dirname,