📜  开玩笑等待 x 秒 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:05.358000             🧑  作者: Mango

代码示例1
jest.setTimeout(30000);

test('some test title', async () => {
  const foo = true;
  await new Promise((r) => setTimeout(r, 2000));
  expect(foo).toBeDefined();
});