question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello.

I am trying since a while to determine how I am supposed to create tests for the prompts. Using Enquirer directly, I can use its events, but using Listr, I don’t have access to the underlying Enquirer object.

Is there currently any way to test prompts? Thanks!

EDIT - I think the ability to pass an instance of Enquirer, the same as logger, to a Listr object, would solve the issue, because we would be able to pass a fake Enquirer object, hence, to test it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cenk1cenk2commented, Jul 22, 2020

Can you try the latest beta from listr2@beta. I was also writing something basing this as a dependency had to do some minor fixes, so hopefully added your functionality before weekend as well, weeee.

1reaction
cenk1cenk2commented, Jul 22, 2020

Hi Mr. Innocenzi,

I think that idea is feasible and doable. I will have a look at that this weekend because at last, I was also planning to add tests for renderers. I was planning to that with jest-mock-process. Maybe that can be the answer since you can manipulate stdout as well as stdin. But you are right, unfortunately, at the moment there is no easy way to spy on the instance of enquirer since I converted it to be a dynamic import.

Read more comments on GitHub >

github_iconTop Results From Across the Web

User & Usability Testing Questions: Ultimate Guide
The right user experience testing questions help you gather unbiased user opinions, which ultimately leads to better user experiences.
Read more >
Usability Testing Questions: Asking the Right Questions - Hotjar
20+ questions to ask in usability tests—and when to ask them. Usability testing has at least four different stages—screening, pre-test, test, ...
Read more >
How To Write Good Usability Testing Questions [2023 Guide]
Post-Testing Questions · How would you describe your overall experience with the product? · What did you like the most about using this...
Read more >
Usability Testing Questions: 7 Rules & 25 Examples
7 rules of asking usability testing questions · 1. Ask qualifying questions · 2. Don't ask leading questions · 3. Ask open-ended usability...
Read more >
Usability Testing Questions: How to Ask Insightful UX Questions
Ask the right usability testing questions to get the most from your next round of testing, and create products with a truly human-centric...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found