소스 검색

Merge pull request #3703 from overleaf/jpa-spd-mocks-reset-is-optional

[tests] mocks: .reset() is optional

GitOrigin-RevId: ad2db1ecc69f57fa9deea0ff124e3f0be212f0ee
Jakob Ackermann 5 년 전
부모
커밋
a2000cb171

+ 2 - 7
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

+ 0 - 2
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: {

+ 0 - 2
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))