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

How to set the resultsDir ? #71

Closed WarleyGabriel closed 3 years ago

WarleyGabriel commented 3 years ago

Hi, is there any way to replace resultsDir?

I'm using this configuration on my package.json, and I don't know how to set the resultsDir here:

"jest": {
    "reporters": [
      "default"
    ],
    "setupFilesAfterEnv": [
      "jest-allure/dist/setup"
    ]
  },

I would like to save the result files in another directory.

WarleyGabriel commented 3 years ago

I've found a solution here: https://stackoverflow.com/questions/65125342/javascript-allure-results-for-jest-allure-specify-the-out-directory

Add "<rootDir>/jest-allure-config.js" on package.json:

"setupFilesAfterEnv": [
      "jest-allure/dist/setup",
      "<rootDir>/jest-allure-config.js"
    ]

Create jest-allure-config.js file:


reporter.allure.setOptions({ targetDir: 'test-report/allure-result' });
zaqqaz commented 3 years ago

That's correct solution 👍