fix issue #392- add test for promises.rename()--using all fs.promises
This commit is contained in:
parent
5abefb6c6a
commit
1f8ca0ef85
|
@ -162,12 +162,11 @@ describe('fs.rename', function () {
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO: CHECK PROMISE ERRORS ARE PROPAGATED CORRECTLY (re-throw?)
|
|
||||||
Promise.all(
|
Promise.all(
|
||||||
fs.promises.open('/myfile', 'w+')
|
fs.promises.open('/myfile', 'w+')
|
||||||
.then((fd)=>fs.promises.close(fd)),
|
.then((fd)=>fs.promises.close(fd)),
|
||||||
fs.promises.rename('/myfile', '/myotherfile'),
|
fs.promises.rename('/myfile', '/myotherfile'),
|
||||||
//TODO: for both stat() check expect() vs assert()
|
|
||||||
fs.promises.stat('/myfile')
|
fs.promises.stat('/myfile')
|
||||||
.then( (result)=> expect(result).not.to.exist, (error) => expect(error).to.exist)
|
.then( (result)=> expect(result).not.to.exist, (error) => expect(error).to.exist)
|
||||||
.finally(()=>{
|
.finally(()=>{
|
||||||
|
@ -180,7 +179,6 @@ describe('fs.rename', function () {
|
||||||
complete2 = true;
|
complete2 = true;
|
||||||
maybeDone();
|
maybeDone();
|
||||||
})
|
})
|
||||||
);
|
).catch((error)=> {throw error;});
|
||||||
//TODO: .catch() probably not necessary--we just want errors to percolate up...
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue