You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking to do some jest tests which involve functions which prompt. I did have a read through the README and this repo's own tests but I couldn't find an example of mocking responses without first having added event handlers to a specific instance of enquirer which is then used to perform the prompting.
Can you provide any guidance on this? Apologies in advance if this was already covered in #234 but reading over that issue didn't help me.
Thanks in advance, Josh.
The text was updated successfully, but these errors were encountered:
I think we'll have a better solution for this in the next version of enquirer. Currently, it's not as easy as I'd like it to be. There was a lot of focus on getting prompts to render correctly in the terminal, so a lot of the functionality and unit tests are focused on that as well.
I know this issue is quite old, so I understand if you're no longer using enquirer or even thinking about this stuff. But for you or anyone else who is trying to achieve the same thing, it would help to know more about the use case. Examples of unit tests you'd like to be able to do would be great.
Hey @jonschlinkert no worries! We are still using enquirer and I think we tried to work around testing that involved faking the prompt inputs in the way that I was finding difficult. I'll try to find a more detailed example of what we were trying to do and update here shortly.
Hi all,
I've been looking to do some jest tests which involve functions which prompt. I did have a read through the README and this repo's own tests but I couldn't find an example of mocking responses without first having added event handlers to a specific instance of enquirer which is then used to perform the prompting.
Can you provide any guidance on this? Apologies in advance if this was already covered in #234 but reading over that issue didn't help me.
Thanks in advance, Josh.
The text was updated successfully, but these errors were encountered: