Removes Symbolic Link check & Fixing Mixing Callbacks and Promises (Basically the fs.link test though)
This commit is contained in:
parent
0748951ca8
commit
af3815c54b
|
@ -187,7 +187,7 @@ describe('fs.promises.link', function() {
|
|||
fs.writeFile('/file', contents, function(err) {
|
||||
if(err) throw err;
|
||||
|
||||
fs.promises.link('/file', '/hlink', function(err) {
|
||||
fs.link('/file', '/hlink', function(err) {
|
||||
if(err) throw err;
|
||||
|
||||
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) {
|
||||
var fs = util.fs();
|
||||
|
||||
|
|
Loading…
Reference in New Issue