Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piecyk committed Oct 22, 2020
1 parent 02337bc commit 552b28c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lib/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ ((
try {
const { compiler, watch, watchOptions } = create();
process.nextTick(() => {
if (compiler.running) {
return;
}
if (watch) {
compiler.watch(watchOptions, callback);
} else {
Expand Down
9 changes: 3 additions & 6 deletions test/Compiler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,7 @@ describe("Compiler", () => {
}
});
compiler.outputFileSystem = createFsFromVolume(new Volume());
compiler.run((err, stats) => {
if (err) return done(err);
});
compiler.run((err, stats) => {});
compiler.run((err, stats) => {
if (err) return done();
});
Expand All @@ -395,9 +393,7 @@ describe("Compiler", () => {
}
});
compiler.outputFileSystem = createFsFromVolume(new Volume());
compiler.watch({}, (err, stats) => {
if (err) return done(err);
});
compiler.watch({}, (err, stats) => {});
compiler.watch({}, (err, stats) => {
if (err) return done();
});
Expand Down Expand Up @@ -452,6 +448,7 @@ describe("Compiler", () => {
() => {}
);
compiler.outputFileSystem = createFsFromVolume(new Volume());
compiler.run((err, stats) => {});
compiler.run((err, stats) => {
if (err) return done();
});
Expand Down
1 change: 1 addition & 0 deletions test/MultiCompiler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ describe("MultiCompiler", function () {
() => {}
);
compiler.outputFileSystem = createFsFromVolume(new Volume());
compiler.run((err, stats) => {});
compiler.run((err, stats) => {
if (err) return done();
});
Expand Down

0 comments on commit 552b28c

Please sign in to comment.