minor lint cleanup
authorJustin Wind <justin.wind+git@gmail.com>
Wed, 9 Aug 2023 23:49:35 +0000 (16:49 -0700)
committerJustin Wind <justin.wind+git@gmail.com>
Wed, 9 Aug 2023 23:49:35 +0000 (16:49 -0700)
src/service.js
test/src/service.js

index 0b9147534c2962b3c6accaa99d391afe68a39bef..1445707104aa8e4a3cb6f6d9bfdc27ddfff6bc22 100644 (file)
@@ -538,7 +538,7 @@ class Service extends Dingus {
       return;
     }
 
-    super.handlerInternalServerError(req, res, ctx);
+    await super.handlerInternalServerError(req, res, ctx);
   }
 
 
index 7a5e349df4af710a90f2e18c9ee58eeebb008db3..d361df120b18b9891406f1bb7fe4e668f9124d75 100644 (file)
@@ -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