-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Environment (please complete the following information):
- Node.js version: 18.16
- NPM version: 9.5.1
- webdriver.io version: 8.11.2
- @wdio/cucumber-framework version: 8.11.0
- wdio-cucumberjs-json-reporter version: 5.1.6
Config of webdriver.io and the reporter
I'm trying to create a custom reporter that extends wdio-cucumberjs-json-reporter to overload some behaviors.
import * as CucumberJsJsonReporter from 'wdio-cucumberjs-json-reporter';
export default class CustomReporter extends CucumberJsJsonReporter {
...
}Describe the bug
The problem occurs when trying to import CucumberJsJson from a file imported as a commonJS module because as you can see in this file of wdio-cucumberjs-json-reporter, the commonJS version of the module only exports the attach static method.
The created reporter is so invalid and does not contain methods like emit or others that should be inherited from WDIO as in the "non commonJS" version.
To Reproduce
Import wdio-cucumberjs-json-reporter from a commonJS module, you will see that only attach method is available.
Expected behavior
Both "non commonJS" and commonJS versions of this module should export the same api.
Thank you