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

Request not matched when there are provider states being used #34

Closed
AdamPike opened this issue May 20, 2020 · 4 comments
Closed

Request not matched when there are provider states being used #34

AdamPike opened this issue May 20, 2020 · 4 comments

Comments

@AdamPike
Copy link

AdamPike commented May 20, 2020

I have 2 end points 1 has 3 tests, each with their own provider states, the second end point has a single test with no provider state.

When I start stub-server and pass the three states in with the parameter:

--provider-state "(?:store-with-full-data|store-with-empty-seo-text-spans|store-with-no-facilities)"

Then run my verification tests against it, the single test on it's own end point with no state get's returned a 404 after being compered to the 3 request types that do have states described, even though they're on a different end point path.

Is my regex wrong or is it true that the--provider-state regex checks take precedence over any other matching? In other words if you use any provider states, every test has to include one and all need to be passed into the regex.

@uglyog
Copy link
Member

uglyog commented May 21, 2020

When using the --provider-state parameter, it will filter all the interactions against that regular expression. Those without a provider state will never match, so will be excluded.

@AdamPike
Copy link
Author

Ok thank you for confirming.

@uglyog
Copy link
Member

uglyog commented Jun 12, 2020

I've added an --empty-provider-state flag to allow empty provider states when filtering with --provider-state.

@AdamPike
Copy link
Author

Thanks @uglyog, that takes care of my use case.

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

2 participants