Fix #431: add test for fsPromises.unlink
add newline at end implemented suggestions formatting fixes
This commit is contained in:
parent
d1dd5fef61
commit
1abcb0369b
|
@ -123,4 +123,20 @@ describe('fs.promises.unlink', function () {
|
|||
expect(error.code).to.equal('ENOENT');
|
||||
});
|
||||
});
|
||||
|
||||
it('should not unlink directories', () => {
|
||||
var fs = util.fs().promises;
|
||||
|
||||
return fs.mkdir('/mydir')
|
||||
.then(() => fs.unlink('/mydir'))
|
||||
.catch(error => {
|
||||
expect(error).to.exist;
|
||||
expect(error.code).to.equal('EPERM');
|
||||
})
|
||||
.then(() => fs.stat('/mydir'))
|
||||
.then(stats => {
|
||||
expect(stats).to.exist;
|
||||
expect(stats.type).to.equal('DIRECTORY');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue