This gist provides commands for capturing and analyzing the output of your JavaScript testing process using yarn test. The first command saves all output from the test run, including both standard output and error messages, to a file named test_output.txt. This is useful for reviewing all feedback from the test process. The second command filters this output to count how many lines contain either console.error or console.warn, helping you quickly assess the number of errors or warnings generated during your tests. This approach is valuable for identifying potential issues in your codebase by focusing on explicit error and warning logs.
yarn test >test_output.txt 2>&1
grep -E "console.error|console.warn" test_output.txt | wc -l