'stop npm test clear output

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?



Solution 1:[1]

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.

enter image description here

Solution 2:[2]

You can also pipe the output of the terminal to a file eg

npm run test >> mytest.txt

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mcvkr
Solution 2 JmRag