From a2000cb171ccf2ffbb752980b65b11bc416f67b8 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 25 Feb 2021 12:24:22 +0000 Subject: [PATCH] Merge pull request #3703 from overleaf/jpa-spd-mocks-reset-is-optional [tests] mocks: .reset() is optional GitOrigin-RevId: ad2db1ecc69f57fa9deea0ff124e3f0be212f0ee --- .../web/test/acceptance/src/mocks/AbstractMockApi.js | 9 ++------- services/web/test/acceptance/src/mocks/MockClsiApi.js | 2 -- .../test/acceptance/src/mocks/MockNotificationsApi.js | 2 -- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/services/web/test/acceptance/src/mocks/AbstractMockApi.js b/services/web/test/acceptance/src/mocks/AbstractMockApi.js index 9f4d00beae..b24b027232 100644 --- a/services/web/test/acceptance/src/mocks/AbstractMockApi.js +++ b/services/web/test/acceptance/src/mocks/AbstractMockApi.js @@ -100,14 +100,9 @@ class AbstractMockApi { /** * Resets member data and restores the API to a clean state for the next test run - * - should be overridden in derived classes - * @abstract + * - may be overridden in derived classes */ - reset() { - throw new OError( - 'AbstractMockApi base class implementation should not be called' - ) - } + reset() {} /** * Applies mocha hooks to start and stop the API at the beginning/end of diff --git a/services/web/test/acceptance/src/mocks/MockClsiApi.js b/services/web/test/acceptance/src/mocks/MockClsiApi.js index 5be8633224..55186c5458 100644 --- a/services/web/test/acceptance/src/mocks/MockClsiApi.js +++ b/services/web/test/acceptance/src/mocks/MockClsiApi.js @@ -1,8 +1,6 @@ const AbstractMockApi = require('./AbstractMockApi') class MockClsiApi extends AbstractMockApi { - reset() {} - static compile(req, res) { res.status(200).send({ compile: { diff --git a/services/web/test/acceptance/src/mocks/MockNotificationsApi.js b/services/web/test/acceptance/src/mocks/MockNotificationsApi.js index dbfb9fe67e..8f65f81912 100644 --- a/services/web/test/acceptance/src/mocks/MockNotificationsApi.js +++ b/services/web/test/acceptance/src/mocks/MockNotificationsApi.js @@ -5,8 +5,6 @@ const AbstractMockApi = require('./AbstractMockApi') // output when the acceptance tests try to connect. class MockNotificationsApi extends AbstractMockApi { - reset() {} - applyRoutes() { this.app.get('/*', (req, res) => res.sendStatus(200)) this.app.post('/*', (req, res) => res.sendStatus(200))