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',
41 'topicPublishHistory',
46 'verificationClaimById',
47 'verificationComplete',
48 'verificationGetById',
49 'verificationIncomplete',
51 'verificationRelease',
53 'verificationValidated',
56 const stubDatabase
= {
57 _implementation: [ ...spyFns
, ...stubFns
],
59 spyFns
.forEach((fn
) => sinon
.spy(stubDatabase
, fn
));
60 stubFns
.forEach((fn
) => sinon
.stub(stubDatabase
, fn
));
62 context: async (fn
) => await
fn({}),
63 transaction: async (dbCtx
, fn
) => await
fn(dbCtx
),
66 stubFns
.forEach((fn
) => {
67 stubDatabase
[fn
] = () => {};
70 module
.exports
= stubDatabase
;