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