Closed Krinkle closed 8 months ago
Interesting. I'd certainly expect all of the 4 skip mechanisms to behave the same.
It'd be worth exploring a PR that makes them do so.
It's worth noting that t.skip()
doesn't take a callback function - it takes a string message, and an "extra" object that will be available on the dispatched event (for things that listen for that). The readme also says "Generate an assertion that will be skipped over.", so I think this is by design.
Based on the documentation, I assumed that
t.test()
andt.skip()
would both behave similar totape.test()
andtape.skip()
, and that in both casest.skip()
would "Generate a new test that will be skipped over.".I noticed as part of preparing an integration test for js-reporters (by creating a test somewhat similar in results to this mocha example), that the above example does not result in a "test" object being emitted on the stream. Instead, it produces an "assert" object.
I checked all four ways to create skipped tests, and found that 3/4 create a test, but the above one creates an assert instead.
This relates to issue https://github.com/substack/tape/issues/251, which asked for skipped tests to be reported in TAP as a test with a
# SKIP
directive as specified in TAP 13. This was resolved for thet.skip()
method, but not yet for the three other ways of creating skipped tests.Somewhat counter-intuitively, while
t.skip()
is the only one of four methods that is reported to TAP as a test, it is only the only one internally reported as an assert. I don't yet know if that's significant, but it might be relevant for compat.