From: Justin Wind Date: Wed, 9 Aug 2023 23:49:35 +0000 (-0700) Subject: minor lint cleanup X-Git-Tag: v1.0.3~2 X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=commitdiff_plain;h=6f9af8204a725b70fa65728cb0d627d8a5e5b348 minor lint cleanup --- diff --git a/src/service.js b/src/service.js index 0b91475..1445707 100644 --- a/src/service.js +++ b/src/service.js @@ -538,7 +538,7 @@ class Service extends Dingus { return; } - super.handlerInternalServerError(req, res, ctx); + await super.handlerInternalServerError(req, res, ctx); } diff --git a/test/src/service.js b/test/src/service.js index 7a5e349..d361df1 100644 --- a/test/src/service.js +++ b/test/src/service.js @@ -187,21 +187,27 @@ describe('Service', function () { }); // handlerGetHealthcheck describe('handlerInternalServerError', function () { + let ServiceClass, DingusClass; + before(function () { + ServiceClass = Object.getPrototypeOf(service); + DingusClass = Object.getPrototypeOf(ServiceClass); + }); it('covers no redirect', async function () { - sinon.stub(service.__proto__.__proto__, 'handlerInternalServerError'); + sinon.stub(DingusClass, 'handlerInternalServerError'); await service.handlerInternalServerError(req, res, ctx); - assert(service.__proto__.__proto__.handlerInternalServerError.called); + assert(DingusClass.handlerInternalServerError.called); }); it('covers redirect', async function () { - sinon.stub(service.__proto__.__proto__, 'handlerInternalServerError'); + sinon.stub(DingusClass, 'handlerInternalServerError'); ctx.session = { redirectUri: new URL('https://client.example.com/app'), clientIdentifier: new URL('https://client.exmaple.com/'), state: '123456', }; await service.handlerInternalServerError(req, res, ctx); - assert(!service.__proto__.__proto__.handlerInternalServerError.called); - assert(res.setHeader); + assert(!DingusClass.handlerInternalServerError.called); + assert(res.setHeader.called); + assert.strictEqual(res.statusCode, 302); }); }); // handlerInternalServerError