Skip to content

Commit e225d10

Browse files
committed
Fix compiler tests
1 parent 44e02f4 commit e225d10

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/Compiler.test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ describe("Compiler", () => {
426426
compiler.outputFileSystem = new MemoryFs();
427427
const watching = compiler.watch({}, (err, stats) => {
428428
if (err) return done(err);
429-
done();
430429
});
431430
watching.close(() => {
432431
compiler.run((err, stats) => {
@@ -435,4 +434,25 @@ describe("Compiler", () => {
435434
});
436435
});
437436
});
437+
it("should watch again correctly after first closed watch", function(done) {
438+
const compiler = webpack({
439+
context: __dirname,
440+
mode: "production",
441+
entry: "./c",
442+
output: {
443+
path: "/",
444+
filename: "bundle.js"
445+
}
446+
});
447+
compiler.outputFileSystem = new MemoryFs();
448+
const watching = compiler.watch({}, (err, stats) => {
449+
if (err) return done(err);
450+
});
451+
watching.close(() => {
452+
compiler.watch({}, (err, stats) => {
453+
if (err) return done(err);
454+
done();
455+
});
456+
});
457+
});
438458
});

0 commit comments

Comments
 (0)