mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix various tests due to projects rework
This commit is contained in:
@@ -136,7 +136,7 @@ describe("red/nodes/index", function() {
|
||||
|
||||
var userDir = path.join(__dirname,".testUserHome");
|
||||
before(function(done) {
|
||||
sinon.stub(log,"log");
|
||||
sinon.stub(log,"log",function(){});
|
||||
fs.remove(userDir,function(err) {
|
||||
fs.mkdir(userDir,function() {
|
||||
sinon.stub(index, 'load', function() {
|
||||
@@ -159,7 +159,7 @@ describe("red/nodes/index", function() {
|
||||
});
|
||||
|
||||
after(function(done) {
|
||||
fs.remove(userDir,function() {;
|
||||
fs.remove(userDir,function() {
|
||||
runtime.stop().then(function() {
|
||||
index.load.restore();
|
||||
localfilesystem.getCredentials.restore();
|
||||
|
@@ -26,7 +26,9 @@ describe('storage/localfilesystem', function() {
|
||||
var mockRuntime = {
|
||||
log:{
|
||||
_:function() { return "placeholder message"},
|
||||
info: function() { }
|
||||
info: function() { },
|
||||
warn: function() { },
|
||||
trace: function() {}
|
||||
}
|
||||
};
|
||||
var userDir = path.join(__dirname,".testUserHome");
|
||||
@@ -290,7 +292,7 @@ describe('storage/localfilesystem', function() {
|
||||
it('should fsync the flows file',function(done) {
|
||||
var flowFile = 'test.json';
|
||||
var flowFilePath = path.join(userDir,flowFile);
|
||||
localfilesystem.init({userDir:userDir, flowFile:flowFilePath}).then(function() {
|
||||
localfilesystem.init({userDir:userDir, flowFile:flowFilePath}, mockRuntime).then(function() {
|
||||
sinon.spy(fs,"fsync");
|
||||
localfilesystem.saveFlows(testFlow).then(function() {
|
||||
fs.fsync.callCount.should.eql(1);
|
||||
@@ -307,7 +309,7 @@ describe('storage/localfilesystem', function() {
|
||||
it('should log fsync errors and continue',function(done) {
|
||||
var flowFile = 'test.json';
|
||||
var flowFilePath = path.join(userDir,flowFile);
|
||||
localfilesystem.init({userDir:userDir, flowFile:flowFilePath}).then(function() {
|
||||
localfilesystem.init({userDir:userDir, flowFile:flowFilePath}, mockRuntime).then(function() {
|
||||
sinon.stub(fs,"fsync", function(fd, cb) {
|
||||
cb(new Error());
|
||||
});
|
||||
|
Reference in New Issue
Block a user