Unit testing: is it possible to override IsTerminal in a similar way to Interactive? #1870
Unanswered
barrygiles
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
When unit testing functionality that checks
Out.IsTerminal
, there is no way to override this when using theTestConsole
. This is possible with input by usingInteractive()
.The test in question relates to a pager utility, which should bypass paging if output is redirected. Otherwise, it should configure the pager according to variables.
Describe the solution you'd like
IsTerminal
andInteractive
feel like the same concept, with one related to output and one related to input. As it stands, I'm not sure how to overrideIsTerminal
like I can withInteractive
, which is preventing me from writing the tests I'd like.I'm not sure what a solution should look like and would appreciate any suggestions if there is already a way to achieve this.
Please upvote 👍 this issue if you are interested in it.
Beta Was this translation helpful? Give feedback.
All reactions