For anyone who's unfamiliar with the term TTY, its essentially what makes a terminal a terminal (as opposed to a file that's just read/written from/to). Generally speaking, we want TTYs since they're what handle colors and terminal escapes. However for machine-read input/output, we don't want TTYs as we don't want the program we're running to send us escapes (as a result of believing its talking to a TTY).
Ran into two issues with nodejs w/ IO testing.
We print a bunch of extra things (eg, a "hint" to hit ctrl+c to exit) that we don't want w/ io tests.
confirm and prompt (functions we define) use readline-sync which doesn't support running without a TTY, meaning neither would work with IO testing.
For anyone who's unfamiliar with the term TTY, its essentially what makes a terminal a terminal (as opposed to a file that's just read/written from/to). Generally speaking, we want TTYs since they're what handle colors and terminal escapes. However for machine-read input/output, we don't want TTYs as we don't want the program we're running to send us escapes (as a result of believing its talking to a TTY).
Ran into two issues with nodejs w/ IO testing.
confirm
andprompt
(functions we define) usereadline-sync
which doesn't support running without a TTY, meaning neither would work with IO testing.