Skip to content

Commit d1f284c

Browse files
paullinatorpeachbits
authored andcommitted
Fix failing test
v2 requests into converter MUST have dates
1 parent 13333e7 commit d1f284c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/v2converter.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ describe('convertV3ToV2', () => {
397397
assert.strictEqual(result[1].exchangeRate, '51000')
398398
})
399399

400-
it('should not match when request has no date but response has date', () => {
400+
it('should throw error when request has no date', () => {
401401
const v2Requests = [
402402
{ currency_pair: 'BTC_iso:USD' } // No date specified
403403
]
@@ -413,12 +413,10 @@ describe('convertV3ToV2', () => {
413413
fiat: []
414414
}
415415

416-
const result = convertV3ToV2(v2Requests, v3Response, currencyCodeMap)
417-
418-
assert.strictEqual(result.length, 1)
419-
// Should not match since request has no date but response has a date
420-
assert.isNull(result[0].exchangeRate)
421-
assert.match(result[0].error ?? '', /No rate found/)
416+
// Should throw error since all V2 requests must have dates
417+
assert.throws(() => {
418+
convertV3ToV2(v2Requests, v3Response, currencyCodeMap)
419+
}, /No date found for BTC_iso:USD/)
422420
})
423421

424422
it('should match correct date for crypto_crypto pairs', () => {

0 commit comments

Comments
 (0)