Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support wildcard urls #43

Closed
simondel opened this issue Oct 23, 2019 · 1 comment
Closed

Support wildcard urls #43

simondel opened this issue Oct 23, 2019 · 1 comment

Comments

@simondel
Copy link

Is your feature request related to a problem? Please describe.
I want to have a fallback for all URL's to they return a statuscode 404 unless they are specifiek in the scenario.

Describe the solution you'd like
An example on how to do this.

Describe alternatives you've considered
I've tried a wildcard regex:

const scenarios: Scenarios = {
    default: [
      {
        url: /(.*?)/,
        method: 'GET',
        response: {},
        responseCode: 404
      }
    ]
  }
injectMocks(scenarios);
@simondel
Copy link
Author

Wildcard urls work, I was just being an idiot in my code because I didn't catch the 404 not found error.. 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant