Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nvtaveras committed Dec 18, 2024
1 parent fe5a347 commit f62560d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/exchange_adapters/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ describe('BaseExchangeAdapter', () => {
it('throws if the json cannot be parsed', async () => {
// @ts-ignore - mockReturnValue is added by jest and is not in the fetch type signature
fetch.mockReturnValue(
Promise.resolve(new Response('<html>blah blah not json</html>', { status: 200 }))
Promise.resolve(new Response('not json', { status: 200 }))
)
await expect(async () =>
adapter.fetchFromApi(ExchangeDataType.TICKER, mockTickerEndpoint)
).rejects.toThrowError(
'Failed to parse JSON response: FetchError: invalid json response body at reason: Unexpected token < in JSON at position 0'
'Failed to parse JSON response: FetchError: invalid json response body at reason: Unexpected token \'o\', "not json"'
)
expect(metricCollector.exchangeApiRequestError).toBeCalledWith(
...metricArgs,
Expand Down

0 comments on commit f62560d

Please sign in to comment.