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 ts-jest version #219

Merged
merged 1 commit into from
Jan 3, 2019
Merged

Conversation

patoncrispy
Copy link
Contributor

This resolves an issue where constructor parameters are considered code branches and are not covered by code coverage. istanbuljs/istanbuljs#70

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jan 3, 2019

This issue was already fixed in master branch. If you check release 7.0.0-alpha.2 the coverage works. Simply updating to latest ts-jest actually doesn't solve the issue. Because now we switch to AST transformer that's why the coverage works.

thank you for your chore PR :)

@ahnpnl ahnpnl merged commit 801cb62 into thymikee:master Jan 3, 2019
@thymikee
Copy link
Owner

thymikee commented Jan 3, 2019

That's still covered by semver range, but oh well 🤷‍♂️

@ahnpnl I'm thinking about publishing stable somewhere soon, but I'd like to wait for Jest 24 to happen (the release is really close), so we don't end up with 2 breaking changes in one month or so.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jan 3, 2019

it's nice to hear that v24 is coming. I agree let's wait for Jest 24 👍

@thymikee
Copy link
Owner

thymikee commented Jan 3, 2019

It has TS support built in (jestjs/jest#7533), backed by Babel. Do you think it makes sense to move away from ts-jest at some point? @babel/preset-typescript not feature complete with TS, but it works pretty well for majority of usecases. cc @wtho

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jan 3, 2019

My personal opinion about this is I prefer ts-jest more because I use type checking a lot in test file + const enum + namespace. Other advantages of ts-jest comparing to @babel/preset-typescript can be found in ts-jest documentation as well.

I wonder if somehow we can create a switch for the users either to use ts-jest or use default @babel/preset-typescript. That would be the best. Maybe we need to read the configuration of jest in our preset and decide whether the preset should use ts-jest or @babel/preset-typescript.

@patoncrispy patoncrispy deleted the ts-jest-upgrade branch January 4, 2019 09:35
@wtho
Copy link
Collaborator

wtho commented Jan 4, 2019

I am not aware about all the differences between @babel/preset-typescript and TS, could you link or list them? Would be awesome.

it works pretty well for majority of usecases

If users would quite often require full TS features, e. g. a custom tsconfig.json or rely on type-checking-tests, I would definitely prefer keeping the full feature set through ts-jest. But I guess we cannot find out how often this is actually used by the community. It really depends on how big this majority really is.

I would also be interested in the arguments of why to move away from ts-jest. Of course it would be one big dependency less to manage (and dealing less with semver-issues), but on the other hand the decision should serve the community, especially now it seems like we handled most of the issues that came with the recent ts-jest changes.

I do not want to challenge any opinion, I just want to learn more about the drawbacks here.

@thymikee
Copy link
Owner

thymikee commented Jan 4, 2019

I am not aware about all the differences between @babel/preset-typescript and TS, could you link or list them?

https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats

It's just a thought, in this preset we abstract most of the config for ts-jest users, so I guess that's not a big deal and we should most likely keep using it

I can imagine Babel being faster than TS in larger projects, but then again it's only on the first run.

@wtho
Copy link
Collaborator

wtho commented Jan 4, 2019

My personal experience with jest-preset-angular was that it JustWorked™ and I could adjust it from there. Before I tried to setup jest with angular, but I could not get it to work.

Having a working preset with the ability to adjust any setting in seconds is just awesome.

I would be totally open to move away from ts-jest at some point, given there are changes with ts-jest or @babel/preset-typescript.

thymikee added a commit that referenced this pull request Jan 26, 2019
* origin/master:
  Upgraded ts-jest version. (#219)
  docs: add astTransformers in configuration example (#218)
  feat: Import jest-zone-patch (#214)
  chore: Migrate CI config to CircleCI v2 (#212)
  Transform templateUrl, styleUrls and styles everywhere (#211)
  feat: adjust semver range of jest-zone-patch (#209)
  Adjust CHANGELOG (#208)
@ahnpnl ahnpnl added this to the 7.0.0 milestone Mar 5, 2019
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

Successfully merging this pull request may close these issues.

4 participants