Removes Symbolic Link check & Fixing Mixing Callbacks and Promises (Basically the fs.link test though)

This commit is contained in:
Dragomegak 2018-10-11 20:59:09 -04:00 committed by David Humphrey
parent 0748951ca8
commit af3815c54b
1 changed files with 1 additions and 34 deletions

View File

@ -187,7 +187,7 @@ describe('fs.promises.link', function() {
fs.writeFile('/file', contents, function(err) { fs.writeFile('/file', contents, function(err) {
if(err) throw err; if(err) throw err;
fs.promises.link('/file', '/hlink', function(err) { fs.link('/file', '/hlink', function(err) {
if(err) throw err; if(err) throw err;
fs.readFile('/file', 'utf8', function(err, fileData) { fs.readFile('/file', 'utf8', function(err, fileData) {
@ -204,39 +204,6 @@ describe('fs.promises.link', function() {
}); });
}); });
it('should not follow symbolic links', function(done) {
var fs = util.fs();
fs.stat('/', function (error, result) {
if (error) throw error;
expect(result).to.exist;
fs.symlink('/', '/myfileLink', function (error) {
if (error) throw error;
fs.promises.link('/myfileLink', '/myotherfile').then(function(){
if (error) throw error;
fs.lstat('/myfileLink', function (error, result) {
var _linkstats = result;
fs.lstat('/myotherfile', function (error, result) {
expect(error).not.to.exist;
expect(result.dev).to.equal(_linkstats.dev);
expect(result.node).to.equal(_linkstats.node);
expect(result.size).to.equal(_linkstats.size);
expect(result.type).to.equal(_linkstats.type);
expect(result.nlinks).to.equal(2);
done();
});
},
function(error){throw error;}
);
});
});
});
});
it('should not allow links to a directory', function(done) { it('should not allow links to a directory', function(done) {
var fs = util.fs(); var fs = util.fs();