When jest-preview's autoPreview: true:
Using Jest's done callback syntax to write an asynchronous test (Jest documentation), the test fails because done is undefined.
With autoPreview: false, there is no issue.
Screenshots
Reproduce
Forked the official jest-preview stackblitz demo, then used the done async syntax in App.test.tsx, and the bug appears.
Describe the bug
When
jest-preview
'sautoPreview: true
: Using Jest'sdone
callback syntax to write an asynchronous test (Jest documentation), the test fails becausedone
isundefined
.With
autoPreview: false
, there is no issue.Screenshots
Reproduce
Forked the official jest-preview stackblitz demo, then used the
done
async syntax inApp.test.tsx
, and the bug appears.Repro: https://stackblitz.com/edit/jest-preview-zfv89j?file=src%2FApp.test.tsx
Expected behavior
With
autoPreview: true
,done
callback should be defined, and will end the test when called.Environment (please complete the following information)
Additional context
The issue feels like it's around where the Jest
it
function is patched forautoPreview
, here: https://github.com/nvh95/jest-preview/blob/880630f4165a55a7e2cced981b1275e32416e5ee/src/configure.ts#L80-L102