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

Unable to nest describe blocks correctly #86

Open
monkpit opened this issue Sep 14, 2022 · 1 comment
Open

Unable to nest describe blocks correctly #86

monkpit opened this issue Sep 14, 2022 · 1 comment

Comments

@monkpit
Copy link

monkpit commented Sep 14, 2022

When I write describe() within another describe() in order to create nested test suites, the title from one describe() gets concatenated with the title from the other describe(), and the test suites are displayed all in one level - no nesting.

const testMyFunc = (input) =>  describe(`with ${input}`, () => {
    it('blah', () => { /* ... */ });
    it('foo', () => { /* ... */ });
    it('bar', () => { /* ... */ });
  });

describe('myFunc', () => {
  ['1', '2', '3'].forEach(testMyFunc);
});

Within the generated Allure report, I have 3 separate myFunc top-level suites, but I only want 1.

I get something like this:
> myFunc with 1
  > blah
  > foo
  > bar
> myFunc with 2
  > blah
  > foo
  > bar
> myFunc with 3
  > blah
  > foo
  > bar

But I would like something like this (it works with other Allure reporters):
> myFunc
  > with 1
    > blah
    > foo
    > bar
  > with 2
    > blah
    > foo
    > bar
  > with 3
    > blah
    > foo
    > bar

I know this is possible with Allure, I have seen it work with other report generators. But I am having this issue specifically with jest-allure.

This similar issue was raised on the allure-js repo, but I think it may be more appropriate to file it here.

@epszaw
Copy link

epszaw commented Nov 23, 2023

Use the official integration for jest. More details can be found in the linked issue.

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

2 participants