1 /* eslint-disable security/detect-object-injection */
4 const sinon
= require('sinon');
13 'authenticationUpsert',
14 'authenticationSuccess',
15 'authenticationUpdateCredential',
16 'authenticationUpdateOTPKey',
19 const stubDatabase
= {
20 _implementation: [ ...spyFns
, ...stubFns
],
22 spyFns
.forEach((fn
) => sinon
.spy(stubDatabase
, fn
));
23 stubFns
.forEach((fn
) => sinon
.stub(stubDatabase
, fn
));
25 context: async (fn
) => await
fn({}),
26 transaction: async (dbCtx
, fn
) => await
fn(dbCtx
),
29 stubFns
.forEach((fn
) => {
30 stubDatabase
[fn
] = () => undefined;
33 module
.exports
= stubDatabase
;