The following is a quick and dirty bash script that runs a specific Jest test 10 times and counts how many times it failed and the number of occurences for the same error.
It uses jest-silent-reporter
to keep the output clean and only output the errors, so be sure to install it before running the script.
Example output:
Success: 6
Failed: 4
=====
Counter: 3
● MyTestName › does smothing bad
expect(received).toBeInTheDocument()
received value must be an HTMLElement or an SVGElement.
Received has value: null
=====
Counter: 1
● MyTestName › does smothing bad 2
expect(received).not.toBeInTheDocument()
received value must be an HTMLElement or an SVGElement.
Received has value: null