Open blueyed opened 5 years ago
@Tieske wrote some tests in https://github.com/Olivine-Labs/busted/pull/583 that show that not working. It's on my list to go in and fix that =)
As long as you have test insulation enabled that will work fine. iirc you can replace describe with pending as well, but I may be mis-remembering.
While the it = pending
trick works (but should rather be local it = pending(" (reason)")
, it is different from calling pending
in it
still, which would add the location for the pending call.
This works quite good:
local function pending_it(reason, it)
return function(desc)
it(desc, function()
pending(desc.." ("..reason..")")
end)
end
end
local it = pending_it("reason!", it)
I think it would be good if using pending("reason")
in a describe
block would internally turn all it
blocks into pending ones like the above, but that would break the existing behavior, where local it = pending("…")
would be used.
The above pending_it
function would benefit from pending
therein (which is busted.pending
) would be abled to handle level
, similar to how busted.error
does it, so that the location would be reported properly.
I think for me local it = pending(…)
is better then the wrapper (pending_it
), mainly because of the missing level
, and that it would add additional lines for the location after all (even with adjusted level
not really that useful).
after #636 was merged, this should now work. Can you confirm @blueyed ? and if so, close this issue?
http://olivinelabs.com/busted/ has this section:
However, according to https://github.com/Olivine-Labs/busted/issues/551#issuecomment-305960557 this does not work.
Usually you would use
pending
instead ofit
then. So the docs need to be fixed in this regard (I could not find them in some git repo).Is this a good pattern to make all tests in a describe block pending then?
(in https://github.com/neovim/neovim/pull/10701/commits/f6c94124368bd14a83e83d4f172b8939d0503daf
return
was used, but that does not really make the tests pending, but only skips them)