c4lifa / jest-allure-circus

Allure reporting for newest Jest Circus v28.1
MIT License
4 stars 7 forks source link

Missing clear guidelines on adding allure types in jest >29 - now its not working #163

Open saritvakrat opened 1 year ago

saritvakrat commented 1 year ago

Describe the bug

We dont have jest.setup.js only jest.config.js Therefor we can't use the allure API, since we get error "error TS2304: Cannot find name 'allure'."

Whats configured? // The test environment that will be used for testing testEnvironment: 'jest-allure-circus', // This option allows use of a custom test runner 'testRunner': 'jest-circus/runner',

Expected behavior

Guideline on configuring allure with TS

c4lifasecondary commented 1 year ago

Hi, @saritvakrat can you assist plz what version of Jest you exactly use?

saritvakrat commented 1 year ago

@c4lifasecondary Hi, would be great to get some assitance since now we cant use for example allure.issue

jest.config.js: testEnvironmentOptions: { jiraUrl: 'https://hhhgital.atlassian.net/browse/', environmentInfo: process.env.ENV_NAME, testPath: '/tests/*' },

Getting this error:

TypeError: Cannot read properties of null (reading 'addLink')

49 | allure.issue('GNG-181.'); | ^ 50 | beforeAll(async () => { 51 | // Login in order to create an app and get sessions list 52 | headers = await authentication.getHeadersWithJSESSIONIDCookie();

  at JestAllureInterface.link (node_modules/allure-js-commons/src/Allure.ts:47:22)
  at JestAllureInterface.issue (node_modules/jest-allure-circus/src/jest-allure-interface.ts:111:8)

When adding This line to jest.setup.js : require('jest-allure-circus');

TypeError: Cannot read properties of null (reading 'addLink')

  134 | // unstable
  135 | describe.skip('Form Validation Errors - data validation', () => {
> 136 |     allure.issue('https:/15419');
      |            ^
  138 |

  at JestAllureInterface.link (node_modules/allure-js-commons/src/Allure.ts:47:22)
  at JestAllureInterface.issue (node_modules/jest-allure-circus/src/jest-allure-interface.ts:111:8)

"devDependencies": { "@jest/globals": "^29.3.1", "@types/jest": "^29.2.5", "@types/node": "^18.11.18", "typescript": "^5.2.2" }, "dependencies": { "jest-allure-circus": "^1.0.21", "jest-html-reporters": "^3.1.4", "jest-junit": "^16.0.0", "jest-runner-groups": "^2.2.0", "ts-jest": "^29.0.3" }