Skip to content

Commit

Permalink
test: add tests for ForexClient convert
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeep committed Dec 11, 2024
1 parent fabea4a commit 2fe09d8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/services/forex-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import { describe, expect, it } from 'vitest';
import { BASE_URL, BASE_URL_VERSION, ForexClient } from '../../src';

describe('ForexClient', () => {
const requestHeader = new Headers({
'Content-Type': 'application/json; charset=utf-8',
});

const client = new ForexClient({
headers: requestHeader,
});
const client = new ForexClient();
const prettifyClient = new ForexClient({
minified: false,
});
Expand Down Expand Up @@ -61,6 +55,9 @@ describe('ForexClient', () => {
const result = await baseCurrencyClient.convert(undefined, 'CN', 10);
const expected = createCommonExpected(expect.any(Number));
expect(result).toStrictEqual(expected);
const defaultResult = await baseCurrencyClient.convert(undefined, 'CN');
const defaultExpected = createCommonExpected(0);
expect(defaultResult).toStrictEqual(defaultExpected);
});

it('_composeDataList', async () => {
Expand Down

0 comments on commit 2fe09d8

Please sign in to comment.