Fix issue #475 - Add test for fs.exits() when resulting path of a symbolic link is not found (#519)

* add test for exits when resulting path of a symbolic link is not found

* fixed style nit
This commit is contained in:
Ruihui Yan 2018-10-09 14:31:15 -04:00 committed by David Humphrey
parent 009821290f
commit c7ea45a18b
1 changed files with 25 additions and 0 deletions

View File

@ -56,4 +56,29 @@ describe('fs.exists', function() {
});
});
});
it('should follow symbolic links and return false if for the resulting path does not exist', function(done) {
var fs = util.fs();
fs.open('/myfile', 'w', function(error, fd) {
if(error) throw error;
fs.close(fd, function(error) {
if(error) throw error;
fs.symlink('/myfile', '/myfilelink', function(error) {
if(error) throw error;
fs.unlink('/myfile', function(err) {
if(err) throw err;
fs.exists('/myfilelink', function(result) {
expect(result).to.be.false;
done();
});
});
});
});
});
});
});