-
Notifications
You must be signed in to change notification settings - Fork 309
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
Not compatible with [email protected] #195
Comments
PR is welcome 🙂 |
Thanks for the fix @FrozenPandaz ! Such a shame that How can we help with ensuring compatibility with 23.1.0? Any places to start at, or any tips? |
Hi @byronmejia I contacted with ts-jest's contributors and got some clues to start but I am on vacation now so I don't have much time to look into it. You can contact @huafu to discuss a point to start :) |
Awesome! Cheers. :) |
#204) Closes #195 and closes #201 ### Breaking Change This is a breaking change as Configuration Interface changes ([see ts-jest v23.10 docs](https://kulshekhar.github.io/ts-jest/user/config/#ts-jest-options)) This PR is built upon @huafu's #201, kudos to him for setting up everything and pointing out what was still to be done. Transformer and test are also heavily inspired by his examples in ts-jest. Also see the PR for more information. ### Implementation Details Like the Regex, all the transformer does is transform * `templateUrl: <PATH>` to `template: require(<PATH>)` * `styles: <ANYTHING>` to `styles: []` * `styleUrls <ANYTHING>` to `styleUrls: []` For more information see the comments in the [transformer file](https://github.com/wtho/jest-preset-angular/blob/55bcfdb993d1dc511611553995ff566d64ea6944/src/InlineHtmlStripStylesTransformer.ts) or #201. ### Edge Cases I had to make some decisions on how strict the astTransformer is, I decided for this, but I am open to discussion: **Works** ```ts import { Component as Cmp } from '@angular/core'; @cmp({ templateUrl: './some-path.html' }) class AngularComp { } ``` Caveat - this also gets transformed ```ts @SomeOtherDecorator({ templateUrl: './some-path.html' }) class SomeClass { } ``` **Does not work** ```ts const componentArgs = { templateUrl: './some-path.html' } @component(componentArgs) class AngularComp { } ``` ### Additional Notes * Run unit tests for the transformer with `npm test` * The transformer was written in TypeScript. A `prepare`-script for was added, which compiles it to JS before publishing and after `npm install`. * `preprocessor.js` and its unit tests were removed.
Current Behavior
[email protected]
(published today) is a rewrite of the package and has many breaking changesExpected Behavior
Short term, lock
ts-jest
to~23.1.0
.Long term, ensure compatibility with
ts-jest@^23.10.0
.The text was updated successfully, but these errors were encountered: