tests: add test for watching prop

This commit is contained in:
Rishabh Chawla 2020-09-19 10:22:34 +05:30
parent d23821ac70
commit ad91fc63b3
1 changed files with 17 additions and 0 deletions

View File

@ -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,