-
-
Notifications
You must be signed in to change notification settings - Fork 753
Open
Description
🚩 [4.0.1-beta.23]
For specific needs (ex: to deal with browserstack or to retrieve additional logs), we created some custom plugins / listeners in our solution, following this documentation: https://codecept.io/hooks/#plugins
Example in version 3.x
import CodeceptJS from "codeceptjs";
const traceStep = (): void => {
CodeceptJS.event.dispatcher.on(CodeceptJS.event.bddStep.before, (step) => {
console.log(`${step.keyword}${step.text} from ${step.match}`);
});
};
export = traceStep;
When trying to migrate to 4.x, the only way I found to make it work is to switch to module.export (from commonJS).
https://github.com/nlespiaucq/examples-ts/blob/4.x-plugin/trace.plugin.ts#L9
Note: keeping as-in is not an option as it causes both errors in the IDE and the PR checks (npx tsc --noEmit --skipLibCheck).
Is there another way to handle it? May it be a trouble on long-run?
How to reproduce:
- Clone:
git clone git@github.com:nlespiaucq/examples-ts.git - Checkout the 4.x branch:
git checkout 4.x-plugin - Install everything
cd codeceptjs-examples-ts
npm install
npx playwright install
- Go to
trace.plugin.ts
Metadata
Metadata
Assignees
Labels
No labels