Is it possible to use 'allure-jest' with custom testEnvironment ? #2840
-
Motivation: use custom testEnvironment for applying specific hooks, instead of using default "allure-jest/node"/"allure-jest/jsdom"
CustomTestEnvironment.ts
Allure results are not created, because of:
I have tried to force create allure runtime, like it is done here:https://github.com/allure-framework/allure-js/blob/f0753df5c068bbd6d48970df6012a8e4b4001814/packages/allure-vitest/src/setup.ts#L12
Thanks in advance, any help is appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Beta Was this translation helpful? Give feedback.
-
Starting from 3.0.8, you can use import { createJestEnvironment } from "allure-jest/factory";
export default createJestEnvironment(WMETestEnvironment); |
Beta Was this translation helpful? Give feedback.
-
@baev thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
@baev I created the custom environment like: azure.ts:
The test.events.ts: and in my jest.config.ts: But still I cannot handle test events within the custom environment |
Beta Was this translation helpful? Give feedback.
-
@baev is it possible to use handleTestEvent method within custom environment? |
Beta Was this translation helpful? Give feedback.
Starting from 3.0.8, you can use
createJestEnvironment
helper function to use Allure with custom environments: