Not possible to use --require-module ts-node/register along with cucumber.js
See original GitHub issueHi,
I have a cucumber-js project written in Typescript and I’m calling an npm script for transpiling Typescript files with tsc before executing the project:
node ./node_modules/cucumber/bin/cucumber-js
js files are generated in a separate folder called transpiled. I also have a cucumber.js for loading a profile which looks like this:
const { DefaultCucumberProfileBuilder } = require('./transpiled/acceptance/config/DefaultCucumberProfileBuilder');
module.exports = DefaultCucumberProfileBuilder.build();
This is working fine, but If I try to require ts-node module in order to avoid calling tsc:
node ./node_modules/cucumber/bin/cucumber-js --require-module ts-node/register
I’m getting the following error:
Error: Cannot find module 'acceptance/config/DefaultCucumberProfileBuilder'
DefaultCucumberProfileBuilder is a Typscript class.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
cucumber/cucumber-js - Gitter
Hi everyone, I've got edge node & npm versions, but struggle with using import statements with cucumber-js. Research so far says I should...
Read more >Proper usage of cucumber with typescript? - Stack Overflow
You can just run cucumber with the typescript transpiler using --require-module ts-node/register . Full example courtesy of hdorgeval at ...
Read more >Playwright and Cucumber.js BDD tutorial | Blog | ediblecode
A tutorial for setting up automated BDD cross-browser functional tests using Cucumber.js, Playwright and TypeScript.
Read more >Reviews: Cucumber.js - IntelliJ IDEs Plugin | Marketplace
At /CucumberJavaScript/lib/cucumberjs_formatter_v7.js:191:25 186 function ... Does not work with cucumber since version 6. ... Not working.
Read more >Frameworks - WebdriverIO
Please note that this is a @wdio/cucumber-framework specific option and not recognized by cucumber-js itself. Type: boolean. Default: false. names. Only ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
try:
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.