1 /* eslint-disable security/detect-object-injection */
4 const sinon
= require('sinon'); // eslint-disable-line node/no-unpublished-require
12 'authenticationSuccess',
14 'authenticationUpsert',
17 'subscriptionsByTopicId',
18 'subscriptionCountByTopicUrl',
20 'subscriptionDeliveryClaim',
21 'subscriptionDeliveryClaimById',
22 'subscriptionDeliveryComplete',
23 'subscriptionDeliveryGone',
24 'subscriptionDeliveryIncomplete',
26 'subscriptionGetById',
31 'topicFetchClaimById',
33 'topicFetchIncomplete',
34 'topicFetchRequested',
38 'topicGetContentById',
43 'verificationClaimById',
44 'verificationComplete',
45 'verificationGetById',
46 'verificationIncomplete',
48 'verificationRelease',
50 'verificationValidated',
53 const stubDatabase
= {
54 _implementation: [ ...spyFns
, ...stubFns
],
56 spyFns
.forEach((fn
) => sinon
.spy(stubDatabase
, fn
));
57 stubFns
.forEach((fn
) => sinon
.stub(stubDatabase
, fn
));
59 context: async (fn
) => await
fn({}),
60 transaction: async (dbCtx
, fn
) => await
fn(dbCtx
),
63 stubFns
.forEach((fn
) => {
64 stubDatabase
[fn
] = () => {};
67 module
.exports
= stubDatabase
;