Not perfect but in the meantime this small script can be used to wrap Jest and Playwright scripts and capture these errors to later remove the package + task prefix.
#!/bin/bash
$@ |& tee output.txt
cat output.txt | grep " ::error " | sed -e "s/^.*:.*:\s::error/::error/"
failed=$(cat output.txt | grep " ::error " | wc -l)
if [ $failed -gt "0" ]
then
exit 1
fi
exit 0
Then change your jobs steps, Ie:
# - run: yarn run e2e
- run: >
bash -e ./.github/error_trap.sh
yarn run e2e