Skip to content

Is there a way to overwrite a request again? #114

@DaveStein

Description

@DaveStein

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.mysite.com/url', {
  status: 200,
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ a: 1 }),
});

mock.get('https://www.mysite.com/url', {
  status: 200,
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ a: 2 }),
});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions