Answers for "jest always pass async await"

-1

jest always pass async await

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)
    }
  })
Posted by: Guest on May-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language