mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user