Answers for "jest test pause for 10 seconds"

0

jest wait for x seconds

jest.setTimeout(30000);

test('some test title', async () => {
  const foo = true;
  await new Promise((r) => setTimeout(r, 2000));
  expect(foo).toBeDefined();
});
Posted by: Guest on November-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language