jest-community / jest-editor-support

A module for handling editor to jest integration
MIT License
28 stars 21 forks source link

Disable jsx plugin for .ts files #75

Closed ehaynes99 closed 3 years ago

ehaynes99 commented 3 years ago

The JSX plugin for Typescript is not compatible with bracket-style type assertions. This led to the introduction of the as keyword as an alternate: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#new-tsx-file-extension-and-as-operator

This restricts the plugin to only be used with .tsx files.

NOTE: There was a copy/paste error in the babel parser test that was skipping over the existing JSX test. Since other tests in the same file were using a comparison of the whole object that precludes such omissions, I changed the style of 2 of the tests to be consistent with this.

connectdotz commented 3 years ago

@gregoryzh do you have anything you want to add? Since #72 is similar to this PR, let's work together on one.

gregoryzh commented 3 years ago

@gregoryzh do you have anything you want to add? Since #72 is similar to this PR, let's work together on one.

sure, One thing, since we are solving the Agular bracket issue for ts. @ehaynes99 can you add a test case for that?

ehaynes99 commented 3 years ago

Good catch. I had one, but must have accidentally removed it. Added.