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

NEW Add support for .ts files #204

Merged
merged 2 commits into from
Aug 13, 2023
Merged

NEW Add support for .ts files #204

merged 2 commits into from
Aug 13, 2023

Conversation

dhensby
Copy link
Contributor

@dhensby dhensby commented May 24, 2022

When using rewire with typescript an error is thrown about assigning values to consts when trying to override top level variables.

This is because rewire is not intercepting and re-writing the compiled Typescript.

This change brings in support for .ts files by specifically overriding the .ts compile call and rewriting the compiled typescript from ts-node.

The test provided is just a copy of the coffeescript test but for the TS file. Without the patch to moduleEnv.js the assign to const error is thrown.

@coveralls
Copy link

Coverage Status

coverage: 98.063% (-0.7%) from 98.721% when pulling 2d7729f on dhensby:pulls/ts-support into 092e554 on jhnns:master.

@jhnns jhnns merged commit a183ba7 into jhnns:master Aug 13, 2023
@dhensby dhensby deleted the pulls/ts-support branch August 13, 2023 20:30
@jhnns
Copy link
Owner

jhnns commented Aug 13, 2023

Awesome. Great work, thank you :)
Shipped with v7.0.0 🚀

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.

3 participants