httpRemoteAddr = '127.0.0.1';
httpFrom = 'user@example.com';
wanted = 5;
-});
+ });
afterEach(function () {
sinon.restore();
});
const expected = new Error();
sinon.stub(db.db, 'manyOrNone').throws(expected);
try {
- await db.subscriptionDeliveryClaim(dbCtx, wanted, claimTimeoutSeconds, claimant );
+ await db.subscriptionDeliveryClaim(dbCtx, wanted, claimTimeoutSeconds, claimant);
assert.fail(noExpectedException);
} catch (e) {
assert.deepStrictEqual(e, expected);
changes: 1,
lastInsertRowid: 'c2e254c5-aa6e-4a8f-b1a1-e474b07392bb',
duration: 11,
- }
+ };
sinon.stub(db.db, 'result').resolves(dbResult);
const result = await db.subscriptionDeliveryClaimById(dbCtx, subscriptionId, claimTimeoutSeconds, claimant);
assert.deepStrictEqual(result, expected);
rowCount: 1,
rows: [],
duration: 10,
- }
+ };
const expected = {
changes: 1,
lastInsertRowid: undefined,
rowCount: 1,
rows: [],
duration: 10,
- }
+ };
const expected = {
changes: 1,
lastInsertRowid: undefined,
rowCount: 0,
rows: [],
duration: 10,
- }
+ };
sinon.stub(db.db, 'one').resolves(dbOne);
sinon.stub(db.db, 'result').onCall(0).resolves(dbResult0).onCall(1).resolves(dbResult1);
try {
rowCount: 0,
rows: [],
duration: 10,
- }
+ };
sinon.stub(db.db, 'one').resolves(dbOne);
sinon.stub(db.db, 'result').onCall(0).resolves(dbResult0).onCall(1).resolves(dbResult1);
try {
rowCount: 0,
rows: [],
duration: 10,
- }
+ };
sinon.stub(db.db, 'result').resolves(dbResult);
try {
await db.verificationUpdate(dbCtx, verificationId, data);
rowCount: 1,
rows: [],
duration: 10,
- }
+ };
sinon.stub(db.db, 'result').resolves(dbResult);
await db.verificationValidated(dbCtx, verificationId);
});
rowCount: 0,
rows: [],
duration: 10,
- }
+ };
sinon.stub(db.db, 'result').resolves(dbResult);
try {
await db.verificationValidated(dbCtx, verificationId);