From 7466029a005fe767e7635d031d7543a5ec44ec11 Mon Sep 17 00:00:00 2001 From: Jim O'Donnell Date: Sun, 10 Sep 2023 06:25:42 +0100 Subject: [PATCH] Mock Sentry in auth tests (#245) --- test/panoptes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/panoptes.js b/test/panoptes.js index aafb482..2b8d96b 100644 --- a/test/panoptes.js +++ b/test/panoptes.js @@ -1,5 +1,6 @@ const chai = require('chai'); const jwt = require('jsonwebtoken'); +const Sentry = require('@sentry/node'); const expect = chai.expect; @@ -27,6 +28,7 @@ describe('Panoptes', function() { jwt.verify = chai.spy(() => { throw new Error('invalid token'); }); + Sentry.captureException = chai.spy(); return Panoptes.authenticator(1, 'invalid_auth').then(function(response) { expect(response.status).to.equal(401); expect(response.success).to.be.false;