📜  开玩笑总是通过异步等待 - Javascript 代码示例

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

代码示例1
test.only("should not pass", async (done) => {
    try {
      const a = await getAsync()
      expect(a).toEqual(2)
      done()
    } catch (e) {
      // have to manually handle the failed test with "done.fail"
      done.fail(e)
    }
  })