/* eslint-disable class-methods-use-this */
'use strict';
-const sinon = require('sinon'); // eslint-disable-line node/no-unpublished-require
-
class StubDatabase {
- constructor() {
+ constructor(sinon) {
+ this._sinon = sinon;
this._implementation.forEach((fn) => {
if (!(fn in this)) {
- this[fn] = async () => { /* */ }; // eslint-disable-line security/detect-object-injection
+ this[fn] = async () => undefined; // eslint-disable-line security/detect-object-injection
}
});
}
_reset() {
this._spyFns.forEach((fn) => {
- sinon.spy(this, fn);
+ this._sinon.spy(this, fn);
});
this._stubFns.forEach((fn) => {
- sinon.stub(this, fn);
+ this._sinon.stub(this, fn);
});
}