diff --git a/tests/useRequest.test.ts b/tests/useRequest.test.ts index b77d1a0..828cc8b 100644 --- a/tests/useRequest.test.ts +++ b/tests/useRequest.test.ts @@ -140,7 +140,10 @@ describe("useRequest", () => { expect(okFn).toBeCalledTimes(0); expect(errFn).toBeCalledTimes(0); - ready() + expect(hasPending.value).toBeFalsy(); + const promise = ready(); + expect(hasPending.value).toBeTruthy(); + promise .then(() => { // don't call expect(1).toBe(2);