You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys,
I think that the conversion from tape doesn't work, because the tape t.plan(N) function and expect.assertions(N) have different behaviours; Moreover, Jest has this different way to work with callbacks https://jestjs.io/docs/en/asynchronous.html#callbacks
Expected two assertions to be called but received zero assertion calls.
1 | test('', () => {
> 2 | expect.assertions(2)
| ^
3 |
4 | setTimeout(() => {
5 | expect(true).toBeTruthy()
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
The text was updated successfully, but these errors were encountered:
I think that the problem is that Jest and Tape work in two completely different ways. Probably a conversion from Tape to Jest requires more than just a methods conversions.
In a Tape test the number of assertions is planned and it waits until all the assertions are touched or timeout.
Jest doesn't wait for callbacks completion, but uses the assertions number just as check at the end of the test. It can be forced to wait using a done() callback, but the wait logic is up to the developer.
A possible conversion could be the following, but I'm not sure that it can fit any requirements.
Hi guys,
I think that the conversion from tape doesn't work, because the tape
t.plan(N)
function andexpect.assertions(N)
have different behaviours; Moreover, Jest has this different way to work with callbacks https://jestjs.io/docs/en/asynchronous.html#callbacksTAPE TEST
TAPE LOG
JEST TEST (CONVERTED)
JEST LOG
The text was updated successfully, but these errors were encountered: