Fix the test cases which sometimes fails due to timing. (#1228)

This commit is contained in:
Kazuki-Nakanishi
2017-04-13 04:54:31 +09:00
committed by Nick O'Leary
parent c54cf26848
commit 05878d3176
3 changed files with 15 additions and 13 deletions

View File

@@ -134,12 +134,14 @@ describe('LocalFileSystem', function() {
fs.existsSync(flowFileBackupPath).should.be.false();
fs.writeFileSync(flowFileBackupPath,JSON.stringify(testFlow));
fs.existsSync(flowFileBackupPath).should.be.true();
localfilesystem.getFlows().then(function(flows) {
flows.should.eql(testFlow);
done();
}).otherwise(function(err) {
done(err);
});
setTimeout(function() {
localfilesystem.getFlows().then(function(flows) {
flows.should.eql(testFlow);
done();
}).otherwise(function(err) {
done(err);
});
},50);
}).otherwise(function(err) {
done(err);
});