Closed aral closed 3 years ago
Wow, great find :-) will fix asap
@ljharb Thanks, Jordan, appreciate it :)
hmm - oddly enough in my test, i'm able to reproduce this example as calling it zero times (which is still a bug), but not twice. When I add your example as a lone file, it calls it twice. Also, even in your test case, when t.end()
is added but t.plan(1)
remains, it still calls it twice, but i can reproduce that it calls it once when t.plan
is used but t.end
is not. This is clearly a fun one.
Update: i was able to pretty quickly fix your issue (but not yet create a test for it) but my own issue still occurs.
Update again: i was able to reproduce your issue in tests.
Released in v5.2.1.
Thanks so much, Jordan. It’s working like a charm :)
Summary
The teardown function is called twice when test is async and
t.plan()
is used. (Tape version: 5.2.0.)To reproduce
What should happen
The teardown function should be called just once.
What actually happens
The teardown function is called twice.
Notes
This issue does not trigger when the test is synchronous or when
t.end()
is used.