I\'m working with some code where I need to test the type of an exception thrown by a function (is it TypeError, ReferenceError, etc.?).
My current testing framework
In case you are working with Promises:
Promise
await expect(Promise.reject(new HttpException('Error message', 402))) .rejects.toThrowError(HttpException);