I am using the xhr-mock library for my tests. I asked on their issues board, but got no answer so I am reposting here.
If I have a test suite where my beforeEach mocks a default response, how can I make it such that one test can overwrite the current mock?
I tried this but it did not overwrite:
mock.get('https://www.example.com/url', {
status: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ a: 1 }),
});
mock.get('https://www.example.com/url', {
status: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ a: 2 }),
});