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

Transformation error: Where to add a parser/compiler for TypeScript #102

Closed
sarahs07 opened this issue Feb 21, 2018 · 5 comments
Closed

Comments

@sarahs07
Copy link

I am looking to migrate our tests from Jasmine to Jest. However, it's failing on the first step with the error below:

Transformation error SyntaxError: Unexpected token (22:8)

It's recommended to use ts-jest but is jest-codemods configurable to allow for this or add TypeScript transformation?

@skovhus
Copy link
Owner

skovhus commented Feb 21, 2018

Hi. Thanks for reaching out.

jscodeshift that we use doesn't currently support TypeScript... But some people are working on it facebook/jscodeshift#180

We should probably add this to the README.

@sarahs07
Copy link
Author

Yes definitely, it should be highlighted in the README and also https://facebook.github.io/jest/docs/en/migration-guide.html where it mentions Jasmine but not TypeScript which go hand in hand....

It would have saved me a day's worth of effort trying to make it work with TypeScript.

@skovhus
Copy link
Owner

skovhus commented Feb 21, 2018

It would have saved me a day's worth of effort trying to make it work with TypeScript.

Sorry to hear that.

Both this and Jest is open source and welcome contributions. Let me know if you would like to contribute here by updating the README. : )

@sarahs07
Copy link
Author

sarahs07 commented Feb 21, 2018

Yes sure, thanks for letting me know, would like to contribute and update the ReadME file :)
Currently looking into https://www.npmjs.com/package/babel-preset-typescript to be added to babel as a preset.
I have added one in the root of jest-codemods but not sure if core babel would pick it or not

image

@skovhus
Copy link
Owner

skovhus commented Sep 18, 2018

Replaced by #122

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

No branches or pull requests

2 participants