lundi 4 février 2019

Expect a jest test to resolve, but don't care about the value

Let's say I have the following fn that I want to test:

const foo = async () => {}

This resolves of course, but how do I test that with Jest?

it('resolves', async () => {
  expect(await foo()).???
});

All of the examples I can find require values, e.g. expect(await foo()).resolves.toBe(42)

Aucun commentaire:

Enregistrer un commentaire