I am running npm test
on a react project, that runs unit tests using jest
and react testing library
. The log of tests (including console log lines that I added to debug) is printed and then deleted after running the tests (probably being deleted after each test or at some limit). finally a summary of the run is shown but it does not help understand the issue.
how can I stop my npm test output being deleted?
CodePudding user response:
nevermind, it was the default terminal (iterm) scrollback buffer limit, which is 1000 lines. apparently, after a fresh setup, the first time I hit the limit was the tests.
here is how to make it unlimited.
CodePudding user response:
You can also pipe the output of the terminal to a file eg
npm run test >> mytest.txt