FIx E2E test util method (#2329)
This commit is contained in:
parent
ca62814ce6
commit
911c0880dd
|
@ -30,15 +30,17 @@ function dirExistsAsync(path) {
|
|||
function mkDirAsync(path) {
|
||||
return new Promise((resolve, reject) => {
|
||||
dirExistsAsync(path).then((exists) => {
|
||||
if (!exists) {
|
||||
fs.mkdir(path, {recursive: true}, (error) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
if (exists) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
fs.mkdir(path, {recursive: true}, (error) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue