Skip to content

Instantly share code, notes, and snippets.

@pytqqq
Created February 2, 2023 13:20
Show Gist options
  • Save pytqqq/2cc52dcb516bad79bccd5cd3409da382 to your computer and use it in GitHub Desktop.
Save pytqqq/2cc52dcb516bad79bccd5cd3409da382 to your computer and use it in GitHub Desktop.
jest.mock('../hooks', () => ({
useGetGames: () => ({
data: {
pages: [
{
results: Array.from({length: 1000}, () => ({
id: Math.random() * 10000,
name: Math.random().toString(36).substring(7),
background_url: `https://i.imgur.com/${Math.random()
.toString(36)
.substring(2)}.jpg`,
})),
},
],
},
hasNextPage: true,
fetchNextPage: jest.fn(),
isFetchingNextPage: false,
}),
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment