How to test the type of a thrown exception in Jest