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

How do I stop mocking in one session? #9

Closed
t-nuriakhmetov opened this issue Aug 17, 2020 · 3 comments
Closed

How do I stop mocking in one session? #9

t-nuriakhmetov opened this issue Aug 17, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request released

Comments

@t-nuriakhmetov
Copy link

t-nuriakhmetov commented Aug 17, 2020

Hi!
If i need to mock a request and then use a real one, then if there is any way to do this, other than once?
My workaround for Puppeteer: page.setRequestInterception(false)

@lukaszfiszer
Copy link
Member

Sorry for taking such much time to respond - missed the notification about this issue.

Indeed, this is not possible with existing API. But we should be able to add a method like mockiaveli.disable() pretty easily.

@lukaszfiszer lukaszfiszer added the enhancement New feature or request label Sep 11, 2020
@lukaszfiszer
Copy link
Member

Actually, we may want to add 2 new public methods:

mockiaveli.enable(); // starts requests mocking
mockiaveli.disable(); // stops requests mocking

This will cover the scenario when you want to resume mocking after you stopped it. mockiaveli.enable() would be called when creating new instance with Mockiavelli.setup to keep the current behavior unchanged

@Fiszcz Fiszcz self-assigned this Sep 13, 2020
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Oct 31, 2020
@Fiszcz Fiszcz linked a pull request Oct 31, 2020 that will close this issue
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Nov 1, 2020
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Nov 1, 2020
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Nov 1, 2020
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Mar 29, 2021
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Mar 29, 2021
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Mar 29, 2021
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Mar 29, 2021
Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Apr 6, 2021
@github-actions
Copy link

github-actions bot commented May 7, 2021

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants