Skip to content

Commit 69951c1

Browse files
committed
fix: last test
1 parent 783f29d commit 69951c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/core/src/react-integration/__tests__/endpoint-types.web.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ describe('endpoint types', () => {
9999
});
100100

101101
it('should work with everything correct', async () => {
102-
const { result, waitForNextUpdate } = renderRestHook(() => {
102+
const { result } = renderRestHook(() => {
103103
return useFetcher(TypedArticleResource.update());
104104
});
105105
const a = await result.current({ id: payload.id }, { title: 'hi' });
106106
});
107107
it('should error on invalid payload', async () => {
108-
const { result, waitForNextUpdate } = renderRestHook(() => {
108+
const { result } = renderRestHook(() => {
109109
return useFetcher(TypedArticleResource.update());
110110
});
111111
// @ts-expect-error
@@ -119,11 +119,11 @@ describe('endpoint types', () => {
119119
const { result, waitForNextUpdate } = renderRestHook(() => {
120120
return useFetcher(TypedArticleResource.update());
121121
});
122-
// @ts-expect-error
123-
await expect(result.current({ id: 'hi' }, { title: 'hi' })).rejects;
124-
console.log('post reject');
125-
await waitForNextUpdate();
126-
console.log('post update');
122+
123+
await expect(
124+
// @ts-expect-error
125+
result.current({ id: 'hi' }, { title: 'hi' }),
126+
).rejects.toEqual(expect.any(Error));
127127
});
128128
});
129129
}

0 commit comments

Comments
 (0)