mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 09:26:45 +00:00
[Search] Style
Removed use of the keyword 'catch' when dealing with promises, and instead used the second parameter of then.
This commit is contained in:
parent
eb0bdba666
commit
d0bad46627
@ -166,7 +166,7 @@ define(
|
||||
}).then(function (rawResults) {
|
||||
// ...then process the data
|
||||
return processResults(rawResults, timestamp);
|
||||
})['catch'](function (err) {
|
||||
}, function (err) {
|
||||
// In case of error, return nothing. (To prevent
|
||||
// infinite loading time.)
|
||||
return {hits: [], total: 0};
|
||||
|
@ -47,7 +47,7 @@ define(
|
||||
mockHttp = jasmine.createSpy("$http");
|
||||
mockHttpPromise = jasmine.createSpyObj(
|
||||
"promise",
|
||||
[ "then", "catch" ]
|
||||
[ "then" ]
|
||||
);
|
||||
mockHttp.andReturn(mockHttpPromise);
|
||||
// allow chaining of promise.then().catch();
|
||||
@ -59,7 +59,7 @@ define(
|
||||
);
|
||||
mockObjectPromise = jasmine.createSpyObj(
|
||||
"promise",
|
||||
[ "then", "catch" ]
|
||||
[ "then" ]
|
||||
);
|
||||
mockObjectService.getObjects.andReturn(mockObjectPromise);
|
||||
|
||||
@ -107,7 +107,7 @@ define(
|
||||
});
|
||||
|
||||
it("returns something when there is an ElasticSearch error", function () {
|
||||
mockProviderResults = mockHttpPromise['catch'].mostRecentCall.args[0]();
|
||||
mockProviderResults = mockHttpPromise.then.mostRecentCall.args[1]();
|
||||
expect(mockProviderResults).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user