Skip to content

Conversation

eventualbuddha
Copy link
Contributor

This makes it possible to write codemods with TypeScript using a .ts extension with ts-jest.

This makes it possible to write codemods with TypeScript using a `.ts` extension with `ts-jest`.
@rwjblue rwjblue merged commit 7729958 into rwjblue:master Feb 15, 2019
@rwjblue rwjblue added the bug Something isn't working label Feb 15, 2019
@eventualbuddha eventualbuddha deleted the allow-typescript-tests-with-ts-jest branch February 15, 2019 21:01
@mfeckie
Copy link
Contributor

mfeckie commented Feb 16, 2019

@eventualbuddha How are you getting this to work when running the actual codemod? I've been working on a project and saw this, so converted my index.js to index.ts and can get it running tests and passing fine, but when I try to actually run the codemod, I get an error

ERROR Transform file ***/decorate-service/index.js does not exist

Wondering if I'm invoking the project incorrectly?

@rwjblue
Copy link
Owner

rwjblue commented Feb 16, 2019

@mfeckie - Did you setup ts-jest also?

@mfeckie
Copy link
Contributor

mfeckie commented Feb 16, 2019

@rwjblue Yep, ts-jest works happily.

In the end I just converted the file back to .js because I was more interested in getting the project working.

I was assuming that it should just work ™️ after reading https://github.com/facebook/jscodeshift/releases/tag/v0.6.0

and https://github.com/facebook/jscodeshift#transform-module

Wondering if there's something I'm missing.

@eventualbuddha
Copy link
Contributor Author

@mfeckie Here's a branch of one of the Ember codemods showing it working with TypeScript:

ember-codemods/ember-sinon-sandbox-codemod@master...eventualbuddha:typescript

@mfeckie
Copy link
Contributor

mfeckie commented Feb 18, 2019

Yeah, so I had similar config and everything works fine in testing but when I come to run the actual code, I get ERROR Transform file .../index.js does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants