Skip to content

Commit 0995830

Browse files
committed
fix tests hanging in MultiCompiler
fix lint
1 parent b024a46 commit 0995830

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/MultiCompiler.test.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ describe("MultiCompiler", function() {
6363
});
6464
it("should not be run twice at a time (watch)", function(done) {
6565
const compiler = createMultiCompiler();
66-
compiler.watch({}, (err, stats) => {
66+
const watcher = compiler.watch({}, (err, stats) => {
6767
if (err) return done(err);
6868
});
6969
compiler.watch({}, (err, stats) => {
70-
if (err) return done();
70+
if (err) return watcher.close(done);
7171
});
7272
});
7373
it("should not be run twice at a time (run - watch)", function(done) {
@@ -81,11 +81,12 @@ describe("MultiCompiler", function() {
8181
});
8282
it("should not be run twice at a time (watch - run)", function(done) {
8383
const compiler = createMultiCompiler();
84-
compiler.watch({}, (err, stats) => {
84+
let watcher;
85+
watcher = compiler.watch({}, (err, stats) => {
8586
if (err) return done(err);
8687
});
8788
compiler.run((err, stats) => {
88-
if (err) return done();
89+
if (err) return watcher.close(done);
8990
});
9091
});
9192
it("should not be run twice at a time (instance cb)", function(done) {
@@ -122,9 +123,10 @@ describe("MultiCompiler", function() {
122123
compiler.run((err, stats) => {
123124
if (err) return done(err);
124125

125-
compiler.watch({}, (err, stats) => {
126+
let watcher;
127+
watcher = compiler.watch({}, (err, stats) => {
126128
if (err) return done(err);
127-
done();
129+
watcher.close(done);
128130
});
129131
});
130132
});
@@ -146,9 +148,10 @@ describe("MultiCompiler", function() {
146148
if (err) return done(err);
147149
});
148150
watching.close(() => {
149-
compiler.watch({}, (err, stats) => {
151+
let watcher;
152+
watcher = compiler.watch({}, (err, stats) => {
150153
if (err) return done(err);
151-
done();
154+
watcher.close(done);
152155
});
153156
});
154157
});

0 commit comments

Comments
 (0)