mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
615 B
20 lines
615 B
import * as networkUtils from '../networkUtils';
|
|
|
|
describe('network utils', () => {
|
|
beforeEach(() => {
|
|
fetch.resetMocks();
|
|
});
|
|
|
|
it('httpRequest json ok response', async () => {
|
|
fetch.mockResponse(JSON.stringify({ test_json: '12345' }));
|
|
const result = await networkUtils.httpRequest('/test/', 'json');
|
|
expect(result).toMatchSnapshot();
|
|
});
|
|
|
|
it('JSONRequest ok', async () => {
|
|
fetch.mockResponse(JSON.stringify({ test_json: '01234' }));
|
|
const result = await networkUtils.JSONRequest('/test/');
|
|
expect(result).toMatchSnapshot();
|
|
});
|
|
});
|