mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #3703 from overleaf/jpa-spd-mocks-reset-is-optional
[tests] mocks: .reset() is optional GitOrigin-RevId: ad2db1ecc69f57fa9deea0ff124e3f0be212f0ee
This commit is contained in:
@@ -100,14 +100,9 @@ class AbstractMockApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets member data and restores the API to a clean state for the next test run
|
* Resets member data and restores the API to a clean state for the next test run
|
||||||
* - should be overridden in derived classes
|
* - may be overridden in derived classes
|
||||||
* @abstract
|
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset() {}
|
||||||
throw new OError(
|
|
||||||
'AbstractMockApi base class implementation should not be called'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies mocha hooks to start and stop the API at the beginning/end of
|
* Applies mocha hooks to start and stop the API at the beginning/end of
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
const AbstractMockApi = require('./AbstractMockApi')
|
const AbstractMockApi = require('./AbstractMockApi')
|
||||||
|
|
||||||
class MockClsiApi extends AbstractMockApi {
|
class MockClsiApi extends AbstractMockApi {
|
||||||
reset() {}
|
|
||||||
|
|
||||||
static compile(req, res) {
|
static compile(req, res) {
|
||||||
res.status(200).send({
|
res.status(200).send({
|
||||||
compile: {
|
compile: {
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ const AbstractMockApi = require('./AbstractMockApi')
|
|||||||
// output when the acceptance tests try to connect.
|
// output when the acceptance tests try to connect.
|
||||||
|
|
||||||
class MockNotificationsApi extends AbstractMockApi {
|
class MockNotificationsApi extends AbstractMockApi {
|
||||||
reset() {}
|
|
||||||
|
|
||||||
applyRoutes() {
|
applyRoutes() {
|
||||||
this.app.get('/*', (req, res) => res.sendStatus(200))
|
this.app.get('/*', (req, res) => res.sendStatus(200))
|
||||||
this.app.post('/*', (req, res) => res.sendStatus(200))
|
this.app.post('/*', (req, res) => res.sendStatus(200))
|
||||||
|
|||||||
Reference in New Issue
Block a user