using a tsconfig.json file with cucumber-js
See original GitHub issueWhen using cucumber-js with TypeScript, I can’t figure out how to get a tsconfig.json to take effect.
cucumber version: 5.0.0 node version: v8.11.3 os: OS X El Capitan 10.11.6
At my project’s root, I’ve got a package.json that contains:
{
"name": "...",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test-features": "cucumber-js test/features --require-module ts-node/register --require 'test/features/**/*.ts'",
...
Also at project root, a tsconfig.json file that contains something like:
{
"compilerOptions": {
"baseUrl": ".", // This must be specified if "paths" is.
"paths": {
"*": [
"src/commands/*"
] // This mapping is relative to "baseUrl"
}
}
}
To run cucumber, I type npm run test-features
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (4 by maintainers)
Top Results From Across the Web
example of cucumber-js with babel and es6? - Gitter
Hi, I'm using cucumber-js with Typescript and am noticing that when I run my code via cucumber-js, the tsconfig.json file is not read....
Read more >Cucumber.js with TypeScript - Elliot DeNolf
This post will go through setting up a basic Cucumber.js suite using ... your tsconfig.json in order for the decorators to compile properly....
Read more >TypeScript Module Resolution doesn't quite work with ...
So far everything is fine...but I can't find a way to properly configure the module resolution when using tsconfig-paths . This is my...
Read more >Running Cucumber test written in TypeScript from WebStorm
Here's an example of tsconfig.json , feel free to adjust it to your ... and choose Cucumber.js; Feature file or directory , leave...
Read more >Cucumber.js | WebStorm Documentation - JetBrains
json file to use. WebStorm will run the TypeScript compiler with this tsconfig.json before running Cucumber.js. Cucumber.js Run configuration: ...
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
In case any else stumbles upon this trying to get baseUrl to work with ts-node / cucumber-js…
You need to create a setup file:
require: ["tsconfig-paths/register"]was the part which tripped me up.Then reference it in your cucumber config file:
@arjunjh10
I am interested to hear how such a file would look like