diff --git a/tests/spec/fs.rename.spec.js b/tests/spec/fs.rename.spec.js index 2f833f8..9fd5eb9 100644 --- a/tests/spec/fs.rename.spec.js +++ b/tests/spec/fs.rename.spec.js @@ -163,11 +163,11 @@ describe('fs.rename', function() { } } - Promise.all( - fs.promises.open('/myfile', 'w+') - .then((fd)=>fs.promises.close(fd)), - fs.promises.rename('/myfile', '/myotherfile'), - fs.promises.stat('/myfile') + + fs.promises.open('/myfile', 'w+') + .then((fd)=>fs.promises.close(fd)) + .then(fs.promises.rename('/myfile', '/myotherfile')) + .then(Promise.all(fs.promises.stat('/myfile') .then( (result)=> expect(result).not.to.exist, (error) => expect(error).to.exist) .finally(()=>{ complete1 = true; @@ -178,7 +178,8 @@ describe('fs.rename', function() { .finally(()=>{ complete2 = true; maybeDone(); - }) - ).catch((error)=> {throw error;}); + }))) + + .catch((error)=> {throw error;}); }); });