zaqqaz / jest-allure

Generate Allure Report for jest. Allure Report, a flexible lightweight multi-language test report tool with the possibility to add steps, attachments, parameters and so on.
MIT License
113 stars 38 forks source link

[feature request] Add 'it.concurrent' async support? #72

Open ccckblaze opened 3 years ago

ccckblaze commented 3 years ago

I am trying to use both concurrent and reporter methods, then it throws an exception After some research, found out that the specStarted method executed after the async function.

so, I have to use concurrent without reporter invoked, or quit using concurrent.

Help needed, thanks

code example:

it.concurrent("create api", async () => {
    reporter.description("create api");

    reporter.startStep("check");
    expect(true).toBeTruthy();
    report.endStep();
});
    TypeError: Cannot read property 'currentTest' of undefined

      3 |
      4 | it.concurrent("create api", async () => {
    > 5 |     reporter.description("create api");
        |              ^
      6 |
      7 |     reporter.startStep("check");
      8 |     expect(true).toBeTruthy();

      at Allure.Object.<anonymous>.Allure.getCurrentTest (node_modules/allure-js-commons/index.js:25:34)
      at Allure.Object.<anonymous>.Allure.setDescription (node_modules/allure-js-commons/index.js:79:10)
      at Reporter.description (node_modules/jest-allure/dist/Reporter.js:24:21)
c4lifa commented 2 years ago

@ccckblaze https://www.npmjs.com/package/jest-allure-circus implemented here