DRFR0ST / bun-bagel

🥯 The Bun fetch mocker with a hole lot of flavor.
MIT License
17 stars 5 forks source link

`fetch().then()` is undefined #4

Closed SpeCT closed 3 months ago

SpeCT commented 3 months ago
test('GET foo', async () => {
  mock('https://example.com/', { data: { name: 'Foo' } })
  const res = await fetch('https://example.com/).then(r => r.json()) // <<- crash
  expect(res.name).toBe('Foo') // <<- never
})
DRFR0ST commented 3 months ago

Thanks for the contribution @SpeCT 🚀 Your PRs has been merged and are included in the 1.0.9 release.