Closed
Description
Describe the bug
When configuring the CLI parameters with a config file, this file must be called cucumber.js
This is an issue when your Node.js project as the type module
because it expect JS file to be ESM module rather than CommonJS modules. In such case, cucumber.js
must be an ESM module, but if so it is not understood and ends up with an error or it must be called cucumber.cjs
and in such case the cucumber-js cli ignore the file.
To Reproduce
Steps to reproduce the behavior:
- Set up a new project
- do
npm init
- add the key
type
with the valuemodule
in the package.json file - set up cucumber-js
- Add a cucumber.js file
- run
npx cucumber-js
- See it fail
- rename cucumber.js to cucumber.cjs
- run
npx cucumber-js
- See the configuration not being loaded
Expected behavior
cucumber.js
could be alternatively named cucumber.cjs
or it could be written as a valid ESM module.