Skip to content

Commit 741c1bd

Browse files
committed
fix: detach mocha from webpack stack
1 parent b1ded14 commit 741c1bd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/instant-mocha.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,17 @@ export default async function instantMocha(
7272
}
7373

7474
/**
75-
* Seems Webpack's watch callback can't be async.
76-
*
7775
* Had issues with Webpackbar and a multi-page test report.
7876
* It wasn't possible to clear the previous report output
7977
* because it seemed like Webpackbar was storing it and
8078
* re-printing.
8179
*
82-
* This method is async but it's fine.
80+
* Running mocha detached from this stack seems to escape
81+
* the stdout caching.
8382
*/
84-
runMocha(options);
83+
setImmediate(() => {
84+
runMocha(options);
85+
});
8586
});
8687
} else {
8788
await webpackCompiler.$run();

0 commit comments

Comments
 (0)