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

Upgrade Typescript compiler with latest Testcafe version #24

Closed
khanh-shady opened this issue Jan 29, 2021 · 16 comments
Closed

Upgrade Typescript compiler with latest Testcafe version #24

khanh-shady opened this issue Jan 29, 2021 · 16 comments

Comments

@khanh-shady
Copy link

Recently, TestCafe released a new version (@v1.10.2-alpha.1) and they removed the tsConfigPath function in favour of compilerOptions, also they specify TypeScript option to pass into their TypeScript compiler

It seems that this is the way it is from now on so do you think you can make an upgrade for this? Thank you very much!

@Arthy000
Copy link
Owner

Arthy000 commented Feb 1, 2021

Hello,

I've only tested with testcafe@1.10.1 (the last stable release), however it looks like there is nothing to do on my side.
image

Gherkin-testcafe does not use its own testcafe dependency, instead it requires a peer dependency; That means you are responsible for upgrading testcafe.

Do you have an issue that I can try to reproduce?

@khanh-shady
Copy link
Author

It's in their newest version (v1.10.2-alpha.1) and I think they will upgrade it soon as in their documents clearly stated.

@Arthy000
Copy link
Owner

Arthy000 commented Feb 2, 2021

tsConfigPath is

Deprecated as of TestCafe v.1.10.0 in favour of the compilerOptions setting.

So the change you refer to is already available in 1.10.1. As shown in the screenshot, the new option is available, provided that you upgrade your TestCafe dependency.

I'm not sure what you are expecting of me here.

@khanh-shady
Copy link
Author

The new compilerOptions have a typescript property which is not present right now in gherkin-testcafe, so we won't be able to pass our configuration file to it.

@Arthy000
Copy link
Owner

Arthy000 commented Feb 2, 2021

That one?
image

@khanh-shady
Copy link
Author

Yes!

@Arthy000
Copy link
Owner

Arthy000 commented Feb 3, 2021

That's weird, the only thing I had to do was upgrade testcafe (1.10.1) in my personal project (NOT gherkin-testcafe).

Gherkin-testcafe keeps most of the runner object, it just adds a few functions and modifies one. Anything else is exported as is and should work without any change in this package.

I'm not sure what I can do, but I'm willing to help you figure this out.

@khanh-shady
Copy link
Author

Sorry I didn't make my point clear enough.

In gherkin-testcafe, we have our own compiler which received our configs to pass to testcafe compilers. But in testcafe, they clearly changed how to receive our configs as you can see here.

Testcafe get only the typescript property in configuration object to pass down to typescript compiler while gherkin-testcafe get the whole object and pass straight down.

Arthy000 pushed a commit that referenced this issue Feb 4, 2021
the options object from the API has to be destructured to retrieve the typescript property and pass
it to the typescript compiler, instead of passing the whole object

BREAKING CHANGE: the new version will only work with testcafe 1.10 and above

#24
@Arthy000
Copy link
Owner

Arthy000 commented Feb 4, 2021

Sorry I didn't understand the issue sooner.
Could you please try the branch linked to this issue?

@Andy2003
Copy link

Andy2003 commented Feb 4, 2021

I think the sollution is to change

new TestcafeTypescriptCompiler(compilerOptions)

to

new TestcafeTypescriptCompiler(compilerOptions.typescript)

@Andy2003
Copy link

Andy2003 commented Feb 4, 2021

I tested the above change locally and my customized typescript compile config was successfully passed through

@khanh-shady
Copy link
Author

I think the sollution is to change

new TestcafeTypescriptCompiler(compilerOptions)

to

new TestcafeTypescriptCompiler(compilerOptions.typescript)

This is totally correct! I have to change it like this locally to pass my config through

@Andy2003
Copy link

@Arthy000 when will this bug be fixed and released?

@Arthy000
Copy link
Owner

Hello,
I'm still waiting for confirmation that my branch does the work (it's almost the change you suggested, but not identical).
I'm hoping to release a new version tomorrow if I can solve another issue.

@Andy2003
Copy link

@Arthy000 your branch will fix this issue!

@Arthy000
Copy link
Owner

I just published a new version that contains the fix for this issue, as well as a fix for Unix users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants