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

Show unmatched stubs in VerifyStubs error output #22

Open
twelvelabs opened this issue Dec 18, 2022 · 1 comment
Open

Show unmatched stubs in VerifyStubs error output #22

twelvelabs opened this issue Dec 18, 2022 · 1 comment

Comments

@twelvelabs
Copy link
Owner

The VerifyStubs methods in the api and run packages just list the number of unmatched stubs. It would be a better UX if they actually listed the match strings. Something like:

found 2 unmatched stub(s):
- MatchPost: /api/v1/users 
- MatchGet: /api/v1/users/123

// or...

found 2 unmatched stub(s):
- MatchString: /bin/echo foo
- MatchString: /bin/echo bar
@twelvelabs
Copy link
Owner Author

Unfortunately stubs don't have access to any of this data due to the way matchers are created. Typically we use a factory function (for example, MatchPost) to create an anonymous Matcher function that gets passed to the stub, so even if we tried to use reflection shenanigans we wouldn't get anything useful to show users.

Going to keep this open for a bit in case we ever redo how matchers work.

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