Skip to content

Commit

Permalink
fix tests hanging in MultiCompiler
Browse files Browse the repository at this point in the history
fix lint
  • Loading branch information
niieani committed Apr 19, 2018
1 parent b024a46 commit 0995830
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/MultiCompiler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ describe("MultiCompiler", function() {
});
it("should not be run twice at a time (watch)", function(done) {
const compiler = createMultiCompiler();
compiler.watch({}, (err, stats) => {
const watcher = compiler.watch({}, (err, stats) => {
if (err) return done(err);
});
compiler.watch({}, (err, stats) => {
if (err) return done();
if (err) return watcher.close(done);
});
});
it("should not be run twice at a time (run - watch)", function(done) {
Expand All @@ -81,11 +81,12 @@ describe("MultiCompiler", function() {
});
it("should not be run twice at a time (watch - run)", function(done) {
const compiler = createMultiCompiler();
compiler.watch({}, (err, stats) => {
let watcher;
watcher = compiler.watch({}, (err, stats) => {
if (err) return done(err);
});
compiler.run((err, stats) => {
if (err) return done();
if (err) return watcher.close(done);
});
});
it("should not be run twice at a time (instance cb)", function(done) {
Expand Down Expand Up @@ -122,9 +123,10 @@ describe("MultiCompiler", function() {
compiler.run((err, stats) => {
if (err) return done(err);

compiler.watch({}, (err, stats) => {
let watcher;
watcher = compiler.watch({}, (err, stats) => {
if (err) return done(err);
done();
watcher.close(done);
});
});
});
Expand All @@ -146,9 +148,10 @@ describe("MultiCompiler", function() {
if (err) return done(err);
});
watching.close(() => {
compiler.watch({}, (err, stats) => {
let watcher;
watcher = compiler.watch({}, (err, stats) => {
if (err) return done(err);
done();
watcher.close(done);
});
});
});
Expand Down

0 comments on commit 0995830

Please sign in to comment.