This commit is contained in:
@@ -62,3 +62,17 @@ test('persists completed and failed outcomes through the job repository', async
|
||||
|
||||
assert.deepEqual(calls, [['complete', 'job-3', [{ id: 'observation-1' }], { valueMinor: 2500 }]]);
|
||||
});
|
||||
|
||||
test('persists failed pricing refresh outcomes through the repository', async () => {
|
||||
const calls = [];
|
||||
await processNextPersistentPricingRefreshJob({
|
||||
jobRepository: {
|
||||
async claimNext() { return { id: 'job-4' }; },
|
||||
async complete() { throw new Error('not expected'); },
|
||||
async fail(id, error) { calls.push([id, error]); },
|
||||
},
|
||||
async pricingRefreshJob() { return { status: 'FAILED', error: 'Provider unavailable.' }; },
|
||||
});
|
||||
|
||||
assert.deepEqual(calls, [['job-4', 'Provider unavailable.']]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user