I'm using Cucumber to do some e2e tests but I can't require support files with relative path to the project:
node_modules
cucumber
├── features
├── step_definitions
I run test using this command
./node_modules/.bin/cucumber-js cucumber/features --require cucumber/step_definitions
Cucumber is able to list files in cucumber/step_definitions
but can't require them: Error: Cannot find module 'cucumber/step_definitions/stepFile.js'
When I changed line 163 of /node_modules/cucumber/lib/cli/index.js:
return require(codePath);
by:
return require(process.cwd()+'/'+codePath);
everything works correctly. Can anyone tell me what I'm missing here ?
Thanks