1 /* eslint-disable security/detect-object-injection */
4 const assert
= require('node:assert');
5 const sinon
= require('sinon');
6 const StubDatabase
= require('../../lib/stub-database');
8 describe('StubDatabase', function () {
10 async
function invokeAllImplementation() {
11 Promise
.all(db
._implementation
.map(async (fn
) => {
13 assert(db
[fn
].called
, fn
);
17 describe('Base', function () {
18 beforeEach(function () {
19 db
= new StubDatabase(sinon
);
22 it('covers implementation', invokeAllImplementation
);
25 describe('Extended', function () {
26 class DB
extends StubDatabase
{
41 beforeEach(function () {
45 it('covers implementation', invokeAllImplementation
);
46 it('covers missing methods', async
function () {