-
Notifications
You must be signed in to change notification settings - Fork 675
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
Support custom TypeScript compiler options #1845
Comments
Hi @Hotell, Thanks for the proposal, we'll investigate. |
ok so this won't work, what really needs to be done is to allow testcafe to consume users In our case we are using preact with aliases to React typings, so we also need to set |
So I've been tweaking testcafe source a bit and come up with something like this for getting needed tsconfig settings from user's tsconfig https://gist.github.com/Hotell/f88c7588d6e878df87fe01f12019de1f#file-compiler-js-L2-L41 which is almost working , just have to resolve few issues with path mapping I still got some errors |
@Hotell, thanks for you investigations. I suppose it can be some conflicts between TestCafe TypeScript settings and a custom tsconfig. Meanwhile, I think it would be nice to add an ability to pass a custom tsconfig file path to TestCafe run. |
working on it, will send PR when ready ;) |
There is a more one use case: var getElementHeigth = ClientFunction(() => { $(element()).heigth(); }, { dependencies: element}); Then I run In this way, I need a way to extend tsconfig used by testcafe for compiling tests. |
This is pretty crucial for us as well. We have typings that would be nice to access in ClientFunctions, and they can't be imported from within TestCafe because we use path aliases and decorators in our client code, which aren't compatible with the compiler options TestCafe has hard-coded. Any progress here? |
Thanks for your point. Actually we didn't work on this yet but it's in our plans. |
Hi @AlexanderMoskovkin, are there any workarounds for now to let testcafe read a custom tsconfig ? |
Hi @AhnpGit, Sorry for late response. Unfortunately I don't see workarounds here for now. But this feature is in our plans and we'll implement it in future (can't provide estimates for now). |
Need that feature as well to add custom paths aliases to tsconfig. |
No workaround for this right now? If I import code from my app (to use in tests) and that uses this feature, it fails. |
@Foxandxss, unfortunately you have to compile you app to the plain JS before importing its code from TestCafe test files. |
That is problematic. We have a complex Angular app using stuff like:
So if we try to import from testcafé any angular file (any at all) it will try to compile the entire app and fail because it won't recognize the syntax. |
Hi @Foxandxss! Is there a specific reason that you have your testcafe code and your angular code in the same project? I believe the idea is that your testcafe tests exist in their own project and you run them against a served up or deployed app. I'd recommend separating your testcafe tests from your angular app. Forgive me if I'm confused. :) Maybe there are some unseen benefits to your approach. It just seems uncommon to me. Regardless, I'm specifically subscribed to this thread in hopes that this feature will be implemented soon. Looks like it's getting there. |
@icfantv nope. Unfortunately I had other priorities... |
In order to help keep our E2E test suite sturdy, we want to have our React components define their own test selectors. So we would like our react TSX files to declare static string properties called testSelector, which our TestCafe fixtures would then import. The hope is to break at compilation time if a developer refactors code which removes used test selectors. In order to do this we need to configure TestCafe to compile JSX. Please consider this feature for 2019. |
Hi guys... really needed feature to set tsconfig's could someone please point me about status a little more specifically in terms of dates, for example:
or
This answer helps me decide on the choice of technology to my active projects |
I second that—our entire codebase is written in Would it be possible to enable JSX with |
Hello @rodmax, At the moment we are not working on this feature, but we have it in our roadmap for 2019. I cannot give you more precise estimate right now. |
Hello @rbardini , Thank you for the idea. We will take your suggestion into account when we are ready to implement this feature. |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Are you requesting a feature or reporting a bug?
feature
What is the suggested behavior?
TestCafe should provide a way to modify TypeScript compilation options for test files. For instance, there should be an option that enables JSX compilation:
Additional Details
Current behavior
if I wanna import something to test file from file that has an `tsx` extension f.e.: `foo.tsx` file, testcafe TS compilation will error out:testcafe chrome e2e/test.ts
System information
The text was updated successfully, but these errors were encountered: