Skip to content

Enhancement Request: onNoMatch function callback #404

@codymikol

Description

@codymikol

Hello, I'm wondering if you'd accept a PR to add the ability for the onNoMatch option to accept a function callback.
This could be very helpful for making integrations with test frameworks.

For example, if I am writing a vitest test and I want to raise a test error that fails the suite given some http requests are not mocked.

const axiosMock = new AxiosMockAdapter(myAxiosInstance, 
  { onNoMatch: (request) => expect.fail("Unexpectedly received unhandled http ${request.verb} request: ${request.url}") }
)

I'm willing to put in the legwork for my use case, just let me know if this work would be accepted, thanks!

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