Skip to content

Commit dd46c49

Browse files
committed
add note for jest test
1 parent 99a038a commit dd46c49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/useAsync.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ describe('useAync', () => {
4646
expect(onError).not.toHaveBeenCalled();
4747
});
4848

49+
// Test added because Jest mocks can return promises that arre not instances of Promises
50+
// This test ensures better testability of user code
51+
// See https://github.com/slorber/react-async-hook/issues/24
4952
it('should resolve a successful Jest mocked resolved value', async () => {
5053
const onSuccess = jest.fn();
5154
const onError = jest.fn();

0 commit comments

Comments
 (0)