mirror of
https://github.com/trezor/trezor-wallet
synced 2025-07-13 18:18:09 +00:00
20 lines
615 B
JavaScript
20 lines
615 B
JavaScript
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();
|
|
});
|
|
});
|