Fix compiler tests

This commit is contained in:
Maksim 2018-03-07 12:16:40 +03:00
parent 44e02f46d6
commit e225d1005c
1 changed files with 21 additions and 1 deletions

View File

@ -426,7 +426,6 @@ describe("Compiler", () => {
compiler.outputFileSystem = new MemoryFs();
const watching = compiler.watch({}, (err, stats) => {
if (err) return done(err);
done();
});
watching.close(() => {
compiler.run((err, stats) => {
@ -435,4 +434,25 @@ describe("Compiler", () => {
});
});
});
it("should watch again correctly after first closed watch", function(done) {
const compiler = webpack({
context: __dirname,
mode: "production",
entry: "./c",
output: {
path: "/",
filename: "bundle.js"
}
});
compiler.outputFileSystem = new MemoryFs();
const watching = compiler.watch({}, (err, stats) => {
if (err) return done(err);
});
watching.close(() => {
compiler.watch({}, (err, stats) => {
if (err) return done(err);
done();
});
});
});
});