'use strict';
+const assert = require('node:assert');
+
class StubLogger {
constructor(sinon, verbose = false) {
+ assert.strictEqual(sinon?.constructor?.name, 'Sandbox', 'sinon dependency not recognized');
this.sinon = sinon;
const logger = (process.env.VERBOSE_TESTS || verbose) ? console : this.constructor._nullLogger;
Object.keys(this.constructor._nullLogger).forEach((level) => {
assert(logger[level][property]);
});
}
+ describe('sinon dependency', function () {
+ it('is required', function () {
+ assert.throws(() => new StubLogger(), assert.AssertionError);
+ });
+ });
describe('null logger', function () {
beforeEach(function () {
logger = new StubLogger(sinon);
assertAllLevels('notCalled');
});
}); // console logger
-}); // StubLogger
\ No newline at end of file
+}); // StubLogger