Alex
0
Q:

jest expect error to be thrown

test("Test description", () => {
  const t = () => {
    throw new TypeError();
  };
  expect(t).toThrow(TypeError);
});
0

New to Communities?

Join the community