X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fstub-database.js;h=7abfb396876addad4ce24bfddcdd113be6ea70d7;hb=c8c6b02b5bd58314dad61cc17d0cfd6e4cb764f9;hp=92f3a84ef9910418da86e7ccc5b5377835effc93;hpb=008717082248dbb9caff2546512932594d7ef62f;p=squeep-test-helper diff --git a/lib/stub-database.js b/lib/stub-database.js index 92f3a84..7abfb39 100644 --- a/lib/stub-database.js +++ b/lib/stub-database.js @@ -1,10 +1,9 @@ /* eslint-disable class-methods-use-this */ 'use strict'; -const sinon = require('sinon'); - class StubDatabase { - constructor() { + constructor(sinon) { + this._sinon = sinon; this._implementation.forEach((fn) => { if (!(fn in this)) { this[fn] = async () => undefined; // eslint-disable-line security/detect-object-injection @@ -35,10 +34,10 @@ class StubDatabase { _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); }); }