Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report output misses last pending in each nested describe? #108

Open
JustATrick opened this issue Aug 30, 2020 · 1 comment
Open

Report output misses last pending in each nested describe? #108

JustATrick opened this issue Aug 30, 2020 · 1 comment
Labels

Comments

@JustATrick
Copy link

I noticed that, in a spec tree with nested describes, and only pending entries, the last pending entry in each describe isn't reported in the output. Here's the simplest example I could make:

demoSpec :: Spec Unit
demoSpec = do
  describe "outer" do
    describe "a ~ should show 2 pending" do
      pending "a1"
      pending "a2"
    describe "b ~ should show 1 pending" do
      pending "b1"

This gives the following output:

outer » a ~ should show 2 pending
  ~ a1
outer » b ~ should show 1 pending
  ~ b1

Summary
0/0 tests passed
3 tests pending

Notice that ~ a2 is missing from the report. Despite the summary saying there are 3 tests pending, only 2 are shown.

If I add extra pending entries to the leaf describes (e.g. a pending "b2") then the last pending in each describe (unless it's the only entry in that describe) is missing. If I replace any of the pending entries with an it (e.g. it "b1" $ pure unit), then all of the expected pending entries appear. If I remove the describe "outer", then all the expected pending entries appear.

I appreciate that a tree with all pending tests is an edge case. I'm very new to PureScript and came across it while experimenting with ways to generate tests (pending "blah" is less typing than it "blah" $ pure unit). I'd assume the error was all mine (maybe I'm misunderstanding something about do notation?), but the mismatch with the summary's count of pending tests suggests that there might be an error in purescript-spec. What do you think?

@JordanMartinez
Copy link
Contributor

I'm quite certain that this is a bug in this library.

@safareli safareli added the bug label Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants