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