We are working on ts-jest that allows easier Jest integration with TypeScript.
Currently it provides preprocessor and testResultsProcessor to correctly handle line numbers when error happened and coverage reamapping.
It covers most of use cases, has simple docs and covered by integration tests.
There are still some issues, but some of them requires new API in Jest itself and others will be solved soon.
It also could be great if we'll be able to provide zero-config(https://github.com/kulshekhar/ts-jest/issues/13) as it done for babel-jest. I guess I'm able to provide PR that implements it.
So, I'm curious if you are interested in this improvement or Jest won't support such deep TypeScript integration?
I'm happy to accept PRs and make this official provided they follow the code standards, are easy to maintain and well tested. I only want to take this dependency on if we have some guidelines in place to make sure we aren't just growing this repo for no reason :)
@Igmat do you have a path forward for this? Any idea how we could make this work? I think for now I'd prefer ts-jest to be maintained outside of the Jest repo but if there are some easy things we can do to make it easier to set up, I'm happy to hear your opinion.
@cpojer @Igmat I use ts-jest, but im curious -- why not just make typescript a first-class citizen in jest the same way Babel is? A quick scan of the code looks like it's not terribly hard to just duplicate the babel pattern and make .ts/.tsx work the same way out of the box?
I'm happy to take a stab at making it happen if it's something that hasn't already been discarded as an idea -- i can't find any confirmation if it's been discussed/discarded?
@Igmat was exploring this in the past and it did require a bunch of changes as it is more involved than the babel-jest stuff. I'd love for it to be revisited and figure out how to make this work.
Babel 7 supports typescript, and stuff like this exists: https://www.npmjs.com/package/babel-plugin-transform-typescript
Will that help? Will stuff just work:tm: for TS? Or do we still need some other integration?
@SimenB yeah, I honestly think that makes the most sense. I think latest babel-jest already works with Babel 7, so let's go down that route.
Most helpful comment
@Igmat was exploring this in the past and it did require a bunch of changes as it is more involved than the babel-jest stuff. I'd love for it to be revisited and figure out how to make this work.