diff --git a/packages/vhd-lib/tests/utils.js b/packages/vhd-lib/tests/utils.js index aab85baa68..df61b7b6b0 100644 --- a/packages/vhd-lib/tests/utils.js +++ b/packages/vhd-lib/tests/utils.js @@ -32,7 +32,9 @@ async function checkFile(vhdName) { try { await fsPromise.unlink(target) } catch (err) { - console.warn(err) + if (err.code !== 'ENOENT') { + console.warn(err) + } } } } @@ -71,7 +73,7 @@ exports.recoverRawContent = async function recoverRawContent(vhdName, rawName, o // @ todo how can I call vhd-cli copy from here async function convertToVhdDirectory(rawFileName, vhdFileName, path) { - fs.mkdirp(path) + await fs.mkdirp(path) const srcVhd = await fs.open(vhdFileName, 'r') @@ -108,7 +110,7 @@ async function convertToVhdDirectory(rawFileName, vhdFileName, path) { exports.convertToVhdDirectory = convertToVhdDirectory exports.createRandomVhdDirectory = async function createRandomVhdDirectory(path, sizeMB) { - fs.mkdirp(path) + await fs.mkdirp(path) const rawFileName = `${path}/temp.raw` await createRandomFile(rawFileName, sizeMB) const vhdFileName = `${path}/temp.vhd`