Skip to content
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

Add support for TypeScript configuration file #7373

Open
Halllker opened this issue Nov 8, 2022 · 5 comments · May be fixed by #8039
Open

Add support for TypeScript configuration file #7373

Halllker opened this issue Nov 8, 2022 · 5 comments · May be fixed by #8039
Assignees
Labels
FREQUENCY: level 1 Good first issue TYPE: enhancement The accepted proposal for future implementation.

Comments

@Halllker
Copy link

Halllker commented Nov 8, 2022

What is your Scenario?

TestCafe with TypeScript is so far a great experience, however there is an issue with global hooks and configuration file.

Global hooks can be defined only with JS configuration file which restricts from importing TypeScript classes and functions.
This makes global hooks nearly impossible to use without some solid dark magic.

What are you suggesting?

Please, add a support for TypeScript configuration file so TS code can be referenced in global hooks and similar functionality (if any).

What alternatives have you considered?

Other possibility would be to separate global hooks from configuration files completely, which would maybe feel a bit more natural and there would be no need for js or ts config files and everything necessary could be handled by simple json.

Additional context

No response

@Halllker Halllker added the TYPE: enhancement The accepted proposal for future implementation. label Nov 8, 2022
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 8, 2022
@Halllker
Copy link
Author

Halllker commented Nov 8, 2022

And of course right after I've created this issue I stumbled upon similar one that approaches basically the same problem from the other side. #6867

@Aleksey28
Copy link
Collaborator

Hi @Halllker,

Thank you for the suggestion. We'll update this thread once we have any news.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 9, 2022
@gforepsly
Copy link

This enhancement would be great! I had similiar issues so I just went with .testcaferc.json for the configuration, and I created my own re-usable classes to handle repeating stuff. This would solve many issues for sure, thumbs up!

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 9, 2022
@Aleksey28 Aleksey28 removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 10, 2022
@Bayheck Bayheck self-assigned this Oct 5, 2023
@Bayheck Bayheck linked a pull request Oct 30, 2023 that will close this issue
2 tasks
@Jackman3005
Copy link

While we wait for the exciting PR to get merged. Is there a type annotation I can add in a comment in the .testcaferc.js file to get some type support for configuration options. Most tools I use support typescript config files and I immediately miss type support for exploring configuration options (and validating them) and am a little annoyed by having to visit the documentation every time I want to tweak or add something.

I tried looking through the source code to find a type definition for the config file contents, but I am not actually sure that one exists at this point...

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 21, 2024
@Klaster1
Copy link

@Jackman3005 this works for me:

/** @type {TestCafeConfigurationOptions} */
module.exports = {

@aleks-pro aleks-pro removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 1 Good first issue TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants