I would like to somehow block all outgoing traffic when running unit tests with jest. Ideally you mock all the modules (or functions that send http requests) including 3rd party ones, but when you are in the process of development you may not be able to mock everything from the start and may accidentally send some data.
If that's not possible with jest, what would then be the best practice to do so? iptables maybe?