Remove all uses of fs.exists as it is deprecated

The tests still use it in places - particular localfilesystem tests,
but those tests need to be redone with sinon stubbing in place and
not rely on real fs operations.
This commit is contained in:
Nick O'Leary
2015-11-16 11:31:55 +00:00
parent e65770a53a
commit f62b7afede
7 changed files with 79 additions and 68 deletions

View File

@@ -47,8 +47,8 @@ describe('nodes/registry/installer', function() {
registry.getModuleInfo.restore();
}
if (require('fs').existsSync.restore) {
require('fs').existsSync.restore();
if (require('fs').statSync.restore) {
require('fs').statSync.restore();
}
});
@@ -160,7 +160,7 @@ describe('nodes/registry/installer', function() {
cb(null,"","");
});
var exists = sinon.stub(fs,"existsSync", function(fn) { return true; });
sinon.stub(fs,"statSync", function(fn) { return {}; });
installer.uninstallModule("this_wont_exist").then(function(info) {
info.should.eql(nodeInfo);