Skip to content
H1Gdev edited this page Jan 13, 2024 · 3 revisions

Jest

it('Test resolves.not.toThrow()', async () => {
  await expect(async function() {
    await test();
  }()).resolves.not.toThrow();
});

it('Test .rejects.toThrow()', async () => {
  await expect(async () => {
    await test();
  }).rejects.toThrow();
});
Clone this wiki locally