Skip to content

Commit

Permalink
test(useRequest): check more hasPending
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcch committed Jan 8, 2024
1 parent d349846 commit ec37509
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/useRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ec37509

Please sign in to comment.