FIx E2E test util method (#2329) (#2330)

(cherry picked from commit 911c0880dd)

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2022-10-28 18:55:40 +03:00 committed by GitHub
parent ecaa3c8e2f
commit 5fc023c6ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
});