From 1f8ca0ef858641b2ea6c15b2b7c1943e0973c5e1 Mon Sep 17 00:00:00 2001 From: michael-overall Date: Wed, 26 Sep 2018 10:39:03 -0400 Subject: [PATCH] fix issue #392- add test for promises.rename()--using all fs.promises --- tests/spec/fs.rename.spec.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/spec/fs.rename.spec.js b/tests/spec/fs.rename.spec.js index 01573ce..29a8068 100644 --- a/tests/spec/fs.rename.spec.js +++ b/tests/spec/fs.rename.spec.js @@ -162,12 +162,11 @@ describe('fs.rename', function () { done(); } } - //TODO: CHECK PROMISE ERRORS ARE PROPAGATED CORRECTLY (re-throw?) + Promise.all( fs.promises.open('/myfile', 'w+') .then((fd)=>fs.promises.close(fd)), fs.promises.rename('/myfile', '/myotherfile'), - //TODO: for both stat() check expect() vs assert() fs.promises.stat('/myfile') .then( (result)=> expect(result).not.to.exist, (error) => expect(error).to.exist) .finally(()=>{ @@ -180,7 +179,6 @@ describe('fs.rename', function () { complete2 = true; maybeDone(); }) - ); - //TODO: .catch() probably not necessary--we just want errors to percolate up... + ).catch((error)=> {throw error;}); }); });