jest try catch example Example: jest test try catch expect(() => { const model = new Sample(resolvedSample) }).toThrow(TypeError);