mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Tidy up unhandledRejection warning from context unit tests
This commit is contained in:
parent
d7505da997
commit
dc412b305c
@ -127,7 +127,9 @@ describe("api/admin/context", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle error which context.getValue causes', function (done) {
|
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)
|
request(app)
|
||||||
.get('/context/global')
|
.get('/context/global')
|
||||||
.set('Accept', 'application/json')
|
.set('Accept', 'application/json')
|
||||||
@ -213,7 +215,9 @@ describe("api/admin/context", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle error which context.delete causes', function (done) {
|
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)
|
request(app)
|
||||||
.delete('/context/global/abc?store=default')
|
.delete('/context/global/abc?store=default')
|
||||||
.expect(400)
|
.expect(400)
|
||||||
|
Loading…
Reference in New Issue
Block a user