1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add wait for writing a library entry into a file. (#1186)

This commit is contained in:
Kazuki-Nakanishi 2017-03-08 10:00:40 +00:00 committed by Nick O'Leary
parent 7a10636128
commit 3658d0e039

View File

@ -589,6 +589,7 @@ describe('LocalFileSystem', function() {
flows.should.eql([ 'C', { ghi: 'jkl', fn: 'file2.js' }, {fn:'flow.json'} ]); flows.should.eql([ 'C', { ghi: 'jkl', fn: 'file2.js' }, {fn:'flow.json'} ]);
var ft = path.join("B","D","file3.js"); var ft = path.join("B","D","file3.js");
localfilesystem.saveLibraryEntry('object',ft,{mno:'pqr'},"// another non meta line\n\n Hi There").then(function() { localfilesystem.saveLibraryEntry('object',ft,{mno:'pqr'},"// another non meta line\n\n Hi There").then(function() {
setTimeout(function() {
localfilesystem.getLibraryEntry('object',path.join("B","D")).then(function(flows) { localfilesystem.getLibraryEntry('object',path.join("B","D")).then(function(flows) {
flows.should.eql([ { mno: 'pqr', fn: 'file3.js' } ]); flows.should.eql([ { mno: 'pqr', fn: 'file3.js' } ]);
localfilesystem.getLibraryEntry('object',ft).then(function(body) { localfilesystem.getLibraryEntry('object',ft).then(function(body) {
@ -599,7 +600,8 @@ describe('LocalFileSystem', function() {
}); });
}).otherwise(function(err) { }).otherwise(function(err) {
done(err); done(err);
}); })}
, 50);
}).otherwise(function(err) { }).otherwise(function(err) {
done(err); done(err);
}); });