yarn test --maxWorkers=50% 2>&1 | grep FAIL | sort -uyarn test --testTimeout=400 2>&1 | grep FAILSome of these tests may take some time as they have user interaction.
pro tip:
- check if there are setTimeouts that can be replaced with jest fake timers.
- or network requests that can be mocked with whatwg-fetch
yarn test --maxWorkers=50% 2>&1 | grep 'act((' -B 8 | grep 'PASS\|FAIL'explain:
- grep 'act((', search for the nearest unique identifier of the warning to test name.
- -B 8, means grap 8 lines before. explanation link: stackoverflow, grep lines before/after
- grep PASS, shrink down to only show the test file-names that are passing tests.
results:
PASS yourapp/file/file1.test.tsx 
PASS yourapp/file/file2.test.tsx 
PASS yourapp/file/file3.test.tsx 
PASS yourapp/file/file4.test.tsx 
You can change to FAIL to see failing tests.
(warning), try first without | xargs code , to make sure it is still grabbing the file names at this point. You can debug these commands and adjust them by removing the pipes | to get more info and making adjustments as you add the pipes back.
<previous command> | grep 'PASS\|FAIL' | awk '{print $2}' | xargs code
example without xargs:
yarn test --maxWorkers=50% 2>&1 | grep 'act((' -B 8 | grep 'PASS\|FAIL' | awk '{print $2}'example:
yarn test --maxWorkers=50% 2>&1 | grep 'act((' -B 8 | grep 'PASS\|FAIL' | awk '{print $2}' | xargs codeMacintosh Computer