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

preserveDescribeNesting nests incorrectly #30

Open
jesperronn opened this issue Nov 16, 2015 · 7 comments
Open

preserveDescribeNesting nests incorrectly #30

jesperronn opened this issue Nov 16, 2015 · 7 comments

Comments

@jesperronn
Copy link

Hi

I am getting an incorrectly nesting if I have two test files where only one has deeply nested describe.

Here is the output from my text console when running:

  Group 1 - No nesting
    ✔ displays correctly
  Group 2 - No nesting
    ✔ Displays correctly
  Group with nesting
    Nested "describe" block
      ✔ should display inside "group with nesting" (skipped)
      ✔ should still display inside "group with nesting" (skipped)

I extracted this example from a private repository.

The above structure is what I expect. However, the HTML report incorrectly displays the nested describe block as being below Group 2. And the heading Group with nesting disappears!

something like this is displayed:

  Group 1 - No nesting
    ✔ displays correctly
  Group 2 - No nesting
    ✔ Displays correctly
    Nested "describe" block #UH OH! NESTED BELOW WRONG GROUP!!!
      ✔ should display inside "group with nesting" (skipped)
      ✔ should still display inside "group with nesting" (skipped)

It appears as if Nested "describe" block were added directly below Group 2, which is incorrect.

Can you help me debugging this strange thing? Or, can you help me with a test that can show this error in the source code.

@fkereki
Copy link

fkereki commented Nov 26, 2015

Hi! I'm facing the same kind of problem -- some tests appear nested below others.

@fkereki
Copy link

fkereki commented Nov 27, 2015

I can add: even with preserveDescribeNesting and foldAll set to false, the problem keeps occuring.

@fkereki
Copy link

fkereki commented Nov 27, 2015

If you avoid having nested or multiple describe(...) blocks, everything works fine.

@jesperronn
Copy link
Author

@fkereki, the feature preserveDescribeNesting is all about nesting
multiple describe blocks. It's not about avoiding them. If someone can
help writing some tests for this plugin, the error is probably easy to fix
without introducing regressions.

On Fri, Nov 27, 2015 at 4:00 PM, fkereki [email protected] wrote:

If you avoid having nested or multiple describe(...) blocks, everything
works fine.


Reply to this email directly or view it on GitHub
#30 (comment)
.

Jesper Rønn-Jensen
Nine A/S
Mobile: +45 2989 1822
Blog http://justaddwater.dk/
[email protected] (Private e-mail and Google Talk IM)

@mathume
Copy link

mathume commented Oct 7, 2016

I also noticed that with both options to true and the following structure:
describe("A",
describe("B",
it("b"
...
describe("C",
it("c"
...
"C" is missing though "c" is displayed, so the report will contain sth. like

A
-B
--b
...
--c
...

@dinvlad
Copy link

dinvlad commented Oct 20, 2016

is there a plan to fix these? thanks

@balv82
Copy link

balv82 commented Oct 28, 2016

One temporary fix for this is to add dummy tests before any nested describe blocks, but that's just ugly !

describe('A', function() {
   it('dummy', function() {});
   describe('B', function() {
     it('dummy again')
   });
   describe('C', function() {
   });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants