Answers for "jest expect error to be thrown"

0

jest expect error to be thrown

test("Test description", () => {
  const t = () => {
    throw new TypeError();
  };
  expect(t).toThrow(TypeError);
});
Posted by: Guest on September-28-2020

Code answers related to "jest expect error to be thrown"

Code answers related to "Javascript"

Browse Popular Code Answers by Language