From 7be671f0f72b91b1433cf4a3d33f946a151c151b Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 5 Dec 2018 16:26:38 +0100 Subject: [PATCH] chore(fs/test): ensure test dir exists --- @xen-orchestra/fs/src/fs.spec.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/@xen-orchestra/fs/src/fs.spec.js b/@xen-orchestra/fs/src/fs.spec.js index e4a1c1257..1c9e0ea11 100644 --- a/@xen-orchestra/fs/src/fs.spec.js +++ b/@xen-orchestra/fs/src/fs.spec.js @@ -51,17 +51,19 @@ handlers.forEach(url => { handler = undefined }) + beforeEach(async () => { + // ensure test dir exists + // TODO: replace with mkdir + await handler.outputFile('file', '') + await handler.unlink('file') + }) afterEach(async () => { // don't use the prefix feature for the final clean to avoid deleting // everything on the remote if it's broken const { prefix } = handler expect(prefix).not.toBe('/') handler.prefix = '/' - await handler.rmtree(prefix).catch(error => { - if (error.code !== 'ENOENT') { - throw error - } - }) + await handler.rmtree(prefix) handler.prefix = prefix })