jest-allure
jest-allure copied to clipboard
Unable to nest `describe` blocks correctly
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.
Use the official integration for jest. More details can be found in the linked issue.