New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add support for TypeScript #335
Comments
Why don't you send a pull request @Chris2011 |
I will be only a customer of this project, when I do each pull request of each stuff what I use and there is some missing, than I can create it by my own. It is only a feature request. If someone has time and would like to do it, why not. Me not, because I don't have time, I have the same normal work and other projects and don't want to be a contributor on each project that I use. Sry for the harsh words maybe but for me it is clear that it is not possible to be a contributor on each project, what I use. I have to understand the source and so on. |
I understand @Chris2011. Maybe one day someone will decide to spend time implementing this because they want to help you, or just for fun. The more realistic scenario is that this feature request stays open until someone needs it enough to be willing to spend the time and effort to implement it and send a PR. |
Maybe. Thx for your opinion. In my perspective, it was only logic to ask for this feature because TS will be more popular as for 1 or 2 years. And when you or whoever decided to implement coffeescript too, why not typescript too? Thx a lot. We will see what happens... |
In general - just like formatters - I'd like to have language/dialect support to be 3rd party plugins instead of part of the core (including the current CoffeeScript and PogoScript). |
TS +1 |
+1 |
Like it, pls do it some time!!! |
👍 |
No amount of +1 or 👍 will make this happen. Someone has to submit a pull request. |
👍 @aslakhellesoy spot on |
@jbpros @aslakhellesoy the only thing should be done to support 3rd party languages is implementing way to modify: SupportCodePathExpander.SUPPORT_CODE_FILES_IN_DIR_REGEXP = /\.(js|coffee|pogo)$/; And then anyone can register any transpiler in |
I'm happy to look at this. I can find the coffeeScript feature file but can't find where the step definitions are implemented, please could someone give me some pointers as to what needs to be done? |
@SeanFarrow I've already done it locally. You have just to modify |
Are you ghoing to send a pr? From: Aleh Kashnikau [mailto:notifications@github.com] @SeanFarrowhttps://github.com/SeanFarrow I've already done it locally. You have just to modify /lib/cucumber//cli/argument_parser/support_code_path_expander.js:12 and then add any transpiler via require hook — |
@mkusher there is more to it. To be complete, step definitions snippets should also be available in the additional language (which is currently not done for PogoScript), see the CLI I'd really like this to be done via a plugin/transpiler system anyway and remove all dialects from core (including coffeescript). |
I don't understand why language specific support is even needed? Wouldn't you just transpile the step definitions to JavaScript as part of your build process? |
#398 should make supporting any transpiler simple |
Yep, #398 will fix this. @henrify the only thing that "needs" to be added to Cucumber is the step definition snippet support for other languages. Currently they're in vanilla JS by default and can be output in CS with the We might just drop non-JS snippets altogether (including CS?). Thoughts? |
#398 has been merged and will be available in the next release. TypeScript support is documented in the README. |
@jbpros since the readme's been updated, and this shows prominently in results for Transpilers-Step definitions and support files can be written in other languages that transpile to javascript. CoffeeScriptInstall the coffee-script NPM package and invoke Cucumber with TypeScriptInstall the typescript-node NPM package and invoke Cucumber with As usual, all your step definition and support files must export a function to be run by Cucumber. This is how it is done in TS: declare var module: any;
module.exports = function () {
this.Given(/.*/, function () {
// ...
})
} PogoScriptInstall the pogo NPM package and invoke Cucumber with |
Is it really needed to use typescript-node? Is it possible to use the official supported tsc instead of typescript-node? I don't know the differences but tsc is official supported from Microsoft. |
@Chris2011 |
Ok thx. |
@JoshuaKGoldberg where is the excerpt from? My searches have failed to find it. |
A sample to guide you in the cucumberjs with typescript use: |
Thanks @AbraaoAlves for the sample. |
how to attach screenshot in cucumber report. I'm using typescript language. Please anyone help me. |
Please confirm if there would be cucumber+Protractor+Typescript compatibility issues going forward...as we plan use the combination for our implementations.. |
@Rajazpandi
|
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. |
I created a lib with typescript and my tests are written in typescript too. I really would like to try cucumber.js and create step definition files, with typescript. So you support coffeescript and js, .ts would be nice too.
Regards
Chris
The text was updated successfully, but these errors were encountered: