[Vuejs]-Testing a component that disappears after a short time

0👍

You need to make the it test asynchronous:

it('should detect an asynchronous thing', async () => {

  await waitFor(() => {
    const something = myFunction();
    expect(something).toBe(true);
  }, 3500);

});

See JEST > Testing Asynchronous Code > Async/Await

Leave a comment