use async rimraf

This commit is contained in:
Tobias Koppers 2019-10-22 10:22:15 +02:00
parent 2d21828633
commit 5bcafa64e2
1 changed files with 9 additions and 8 deletions

View File

@ -35,8 +35,8 @@ const onceDone = (compiler, action) => {
});
};
function cleanup() {
rimraf.sync(tempFolderPath);
function cleanup(callback) {
rimraf(tempFolderPath, callback);
}
function createFiles() {
@ -67,13 +67,14 @@ describe("ChangesAndRemovals", () => {
jest.setTimeout(10000);
beforeEach(() => {
cleanup();
createFiles();
});
afterEach(() => {
cleanup();
beforeEach(done => {
cleanup(err => {
if (err) return done(err);
createFiles();
done();
});
});
afterEach(cleanup);
it("should track modified files when they've been modified in watchRun", done => {
const compiler = createSingleCompiler();