--- /dev/null
+/* eslint-env mocha */
+/* eslint-disable security/detect-object-injection */
+'use strict';
+
+const assert = require('assert');
+const StubDatabase = require('../../lib/stub-database');
+
+describe('StubDatabase', function () {
+ let db;
+ async function invokeAllImplementation() {
+ Promise.all(db._implementation.map(async (fn) => {
+ await db[fn]();
+ assert(db[fn].called, fn);
+ }));
+ }
+
+ describe('Base', function () {
+ beforeEach(function () {
+ db = new StubDatabase();
+ db._reset();
+ });
+ it('covers implementation', invokeAllImplementation);
+ }); // Base
+
+ describe('Extended', function () {
+ class DB extends StubDatabase {
+ get _stubFns() {
+ return [
+ ...super._stubFns,
+ 'valueGet',
+ 'valueSet',
+ ];
+ }
+ async valueSet() {
+ return this;
+ }
+ }
+ beforeEach(function () {
+ db = new DB();
+ db._reset();
+ });
+ it('covers implementation', invokeAllImplementation);
+ }); // Extended
+}); // StubDatabase