After a good amount of reading / searching, I still can't wrap my head around how exactly I can run cucumber-js with Typescript. I understand --compiler
was removed in favor of --require-module
but I fail to find concrete examples that use simply cucumber-js + typescript (not with Protractor, not with Nightwatch or any other test framework) to illustrate the process.
cucumber-js
app with ts-node ?Right now, I'm using cucumber-js --require-module ts-node/register
in my package.json (cucumber-js is installed locally, not globally), is this correct ?
--require
stuff inside support
and step_definitions
with the use of CLI flags or having the proper folder structure takes care of this ?Right now, my folder structure looks like this :
- [root app folder]
-- package.json
-- features/
---- myExample.feature
---- step_definitions/
------ myExample.ts
---- support/
------ customWorld.ts
When I run the tests, I get an output specifying that all steps in my feature file are undefined, I think this might be a transpiling issue but I'm not sure.
Hi @Niceplace, this repo may help you: cucumber-ts-starter
@Niceplace did you see this documentation: https://github.com/cucumber/cucumber-js/blob/e149ee3644f57d788483390e46d8a60fd8db886c/docs/cli.md#transpilers?
Closing for now. Please reopen if you think we can structure our documentation better. Maybe we should add a top level link to transpilers?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @Niceplace, this repo may help you: cucumber-ts-starter