Fix the error that "otherwise is not a function" (#1513)

This commit is contained in:
Hideki Nakamura 2017-12-06 22:20:38 +09:00 committed by Nick O'Leary
parent 3ca0e9c420
commit 55cd069043
1 changed files with 23 additions and 23 deletions

View File

@ -36,10 +36,10 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('object','').then(function(flows) { localfilesystemLibrary.getLibraryEntry('object','').then(function(flows) {
flows.should.eql([]); flows.should.eql([]);
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -49,10 +49,10 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('object','/').then(function(flows) { localfilesystemLibrary.getLibraryEntry('object','/').then(function(flows) {
flows.should.eql([]); flows.should.eql([]);
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -61,11 +61,11 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.init({userDir:userDir}).then(function() { localfilesystemLibrary.init({userDir:userDir}).then(function() {
localfilesystemLibrary.getLibraryEntry('object','A/B').then(function(flows) { localfilesystemLibrary.getLibraryEntry('object','A/B').then(function(flows) {
should.fail(null,null,"non-existent flow"); should.fail(null,null,"non-existent flow");
}).otherwise(function(err) { }).catch(function(err) {
should.exist(err); should.exist(err);
done(); done();
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -100,16 +100,16 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('object','B/C').then(function(flows) { localfilesystemLibrary.getLibraryEntry('object','B/C').then(function(flows) {
flows.should.eql([]); flows.should.eql([]);
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -120,7 +120,7 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('flows','B/flow').then(function(flows) { localfilesystemLibrary.getLibraryEntry('flows','B/flow').then(function(flows) {
flows.should.eql("Hi"); flows.should.eql("Hi");
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -133,10 +133,10 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('object','B/file2.js').then(function(body) { localfilesystemLibrary.getLibraryEntry('object','B/file2.js').then(function(body) {
body.should.eql("// not a metaline \n\n Hi"); body.should.eql("// not a metaline \n\n Hi");
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -154,20 +154,20 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('functions',ft).then(function(body) { localfilesystemLibrary.getLibraryEntry('functions',ft).then(function(body) {
body.should.eql("// another non meta line\n\n Hi There"); body.should.eql("// another non meta line\n\n Hi There");
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}) })
}, 50); }, 50);
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });
@ -185,20 +185,20 @@ describe('storage/localfilesystem/library', function() {
localfilesystemLibrary.getLibraryEntry('flows',ft+".json").then(function(body) { localfilesystemLibrary.getLibraryEntry('flows',ft+".json").then(function(body) {
body.should.eql("Hi"); body.should.eql("Hi");
done(); done();
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}) })
}, 50); }, 50);
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}).otherwise(function(err) { }).catch(function(err) {
done(err); done(err);
}); });
}); });