FIx E2E test util method (#2329)

This commit is contained in:
Devin Binnie
2022-10-28 11:55:11 -04:00
committed by GitHub
parent ca62814ce6
commit 911c0880dd

View File

@@ -30,7 +30,10 @@ function dirExistsAsync(path) {
function mkDirAsync(path) {
return new Promise((resolve, reject) => {
dirExistsAsync(path).then((exists) => {
if (!exists) {
if (exists) {
resolve();
return;
}
fs.mkdir(path, {recursive: true}, (error) => {
if (error) {
reject(error);
@@ -38,7 +41,6 @@ function mkDirAsync(path) {
}
resolve();
});
}
}).catch((err) => {
reject(err);
});