jestjs

Can’t mock fetch() with jest

I hit a wall trying to mock fetch() with jest.
I’ve tried 2 approaches:
Approach 1: doing it manually as follows:
const pokemon = {
id: 1,
name: ‘fake1’,
sprites: {other: {‘official-artwork’: {front_default: ‘picture’}}},
t…

Can’t mock fetch() with jest

I hit a wall trying to mock fetch() with jest.
I’ve tried 2 approaches:
Approach 1: doing it manually as follows:
const pokemon = {
id: 1,
name: ‘fake1’,
sprites: {other: {‘official-artwork’: {front_default: ‘picture’}}},
t…