projects
/
squeep-test-helper
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
breaking: bring your own sinon instead of bundling, to resolve leaks when versions...
[squeep-test-helper]
/
lib
/
stub-database.js
diff --git
a/lib/stub-database.js
b/lib/stub-database.js
index 41abaf7819279e19eb42fbfc8cd1641f914b86d1..7abfb396876addad4ce24bfddcdd113be6ea70d7 100644
(file)
--- a/
lib/stub-database.js
+++ b/
lib/stub-database.js
@@
-1,13
+1,12
@@
/* eslint-disable class-methods-use-this */
'use strict';
/* eslint-disable class-methods-use-this */
'use strict';
-const sinon = require('sinon'); // eslint-disable-line node/no-unpublished-require
-
class StubDatabase {
class StubDatabase {
- constructor() {
+ constructor(sinon) {
+ this._sinon = sinon;
this._implementation.forEach((fn) => {
if (!(fn in this)) {
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
}
});
}
}
});
}
@@
-35,10
+34,10
@@
class StubDatabase {
_reset() {
this._spyFns.forEach((fn) => {
_reset() {
this._spyFns.forEach((fn) => {
- sinon.spy(this, fn);
+
this._
sinon.spy(this, fn);
});
this._stubFns.forEach((fn) => {
});
this._stubFns.forEach((fn) => {
- sinon.stub(this, fn);
+
this._
sinon.stub(this, fn);
});
}
});
}