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