mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
bd98be05c6
* squash prev commits * remove unneeded axios mock * set maxWorkers=2 * run with a slow test reporter * revert: run with a slow test reporter * Add url check to mock and further reading and alternatives * use MSW for all API calls in cookbook test suits * Comments with implem. explanation * Arrange docs initially to reflect new scenario and remove jest.setTimeout * updating docs (1) * updating docs (2) * updating docs with global guarding and conclusion --------- Co-authored-by: stevegalili <steve.galili@mywheels.nl>
11 lines
276 B
TypeScript
11 lines
276 B
TypeScript
import { User } from '../types';
|
|
|
|
export default async (): Promise<User[]> => {
|
|
const res = await fetch('https://randomuser.me/api/?results=25');
|
|
if (!res.ok) {
|
|
throw new Error(`Error fetching contacts`);
|
|
}
|
|
const json = await res.json();
|
|
return json.results;
|
|
};
|