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 'subscriptionDeleteExpired',
21 'subscriptionDeliveryClaim',
22 'subscriptionDeliveryClaimById',
23 'subscriptionDeliveryComplete',
24 'subscriptionDeliveryGone',
25 'subscriptionDeliveryIncomplete',
27 'subscriptionGetById',
32 'topicFetchClaimById',
34 'topicFetchIncomplete',
35 'topicFetchRequested',
39 'topicGetContentById',
45 'verificationClaimById',
46 'verificationComplete',
47 'verificationGetById',
48 'verificationIncomplete',
50 'verificationRelease',
52 'verificationValidated',
55 const stubDatabase
= {
56 _implementation: [ ...spyFns
, ...stubFns
],
58 spyFns
.forEach((fn
) => sinon
.spy(stubDatabase
, fn
));
59 stubFns
.forEach((fn
) => sinon
.stub(stubDatabase
, fn
));
61 context: async (fn
) => await
fn({}),
62 transaction: async (dbCtx
, fn
) => await
fn(dbCtx
),
65 stubFns
.forEach((fn
) => {
66 stubDatabase
[fn
] = () => {};
69 module
.exports
= stubDatabase
;