Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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();
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jest #wait #seconds
ADD COMMENT
Topic
Name
1+8 =