This could not work on some situations, if so preffer to use [expectExitWith]
This could not work on some situations, if so preffer to use [expectExitWith]
Returns last process exit code or undefined if not possible. IMPORTANT: relies on $?
and echo
so most
probably only works in unix (tested on macOs and Linux).
This is useful on interactive applications that inquire some data and finally do some processing, in which
they could fail with an excepiton. no matter if the processing takes time, we enter echo $?
commands with an
identifier that will be only executed after the application exits returning its exit code.
However notice that while the app is running, althouhg not executed we are still writing to its stdin so use it when you know the app is no longer litening for relevant data, just makind final processing and exit, this is by waiting some time or in those cases where a key combination was presend to exit (q).
TODO: example with "more" command
Generated using TypeDoc
A wrapper class for Driver with high level API for testing CLI interactions with libraries like jasmine, jest, mocha (uses expect())