Tidy up unhandledRejection warning from context unit tests

pull/2590/head
Nick O'Leary 2020-06-01 13:46:07 +01:00
parent d7505da997
commit dc412b305c
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 6 additions and 2 deletions

View File

@ -127,7 +127,9 @@ describe("api/admin/context", function () {
});
it('should handle error which context.getValue causes', function (done) {
stub.returns(Promise.reject('error'));
var stubbedResult = Promise.reject('error');
stubbedResult.catch(function() {});
stub.returns(stubbedResult);
request(app)
.get('/context/global')
.set('Accept', 'application/json')
@ -213,7 +215,9 @@ describe("api/admin/context", function () {
});
it('should handle error which context.delete causes', function (done) {
stub.returns(Promise.reject('error'));
var stubbedResult = Promise.reject('error');
stubbedResult.catch(function() {});
stub.returns(stubbedResult);
request(app)
.delete('/context/global/abc?store=default')
.expect(400)