'Jest obsolete snapshot warning causes test failure: ignore warnings when exiting Jest

I have a test suite/file that I have disabled. It has an associated snapshot file. For my particular situation I do not want to delete or update the snapshot file (long-story-short: it is used elsewhere).

So, Jest logs out just a warning, rather than a failure, for the obsolete snapshot. However Jest then exits with code 1 and my build fails. This happens despite no test actually failing.

Can I tweek the config to ignore obsolete snapshots? Or is there some other way to have Jest exit with code 0 after only a warning?

enter image description here



Solution 1:[1]

Add --silent to your test-ui script in the projects package.json

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 Mario Perez