fetch-mock-jest
fetch-mock-jest copied to clipboard
`headers` are not matched strictly
Hello I noticed that when using toHaveFetched(url, { headers: {} })
, it will always pass no matter what headers are passed but it should pass only if no headers are passed
fetchMock.get('/api', { body: {} })
// custom wrapper around fetch
await api.get('2')
expect(fetchMock).toHaveFetched('/api/2', {
headers: {
// no Accept
Accept: 'application/json'
// 'Content-Type': 'application/json',
},
})