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

(feat): support JS & JSX files in tsdx test #486

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

agilgur5
Copy link
Collaborator

@agilgur5 agilgur5 commented Feb 3, 2020

  • JS & JSX are already supported in tsdx build, so this is just adding
    some better parity in tsdx test

    • more JS & JSX support also means better support for gradual TS
      migrations
  • JS + JSX spec files should also be ran, not just TS + TSX

    • run them with babel-jest, which is jest's default
      • changing transform meant babel-jest wasn't run on them anymore
    • notably, TSDX itself has tests written in JS, so TSDX would need
      this to dogfood itself
  • also get coverage from JS + JSX files too

I'm currently adding TSDX in https://github.com/agilgur5/react-signature-canvas while migrating it to TS and these all came up as frustrations. Related to #383 which is also about parity for build vs. test

EDIT: For posterity, here's my PR agilgur5/react-signature-canvas#42, and specifically agilgur5/react-signature-canvas@8f124fe is where this popped up.

EDIT: This apparently fixes #187 , didn't know about that issue when I wrote this

- JS & JSX are already supported in tsdx build, so this is just adding
  some better parity in tsdx test
  - more JS & JSX support also means better support for gradual TS
    migrations

- JS + JSX spec files should also be ran, not just TS + TSX
  - run them with babel-jest, which is jest's default
    - changing transform meant babel-jest wasn't run on them anymore
  - notably, TSDX itself has tests written in JS, so TSDX would need
    this to dogfood itself
- also get coverage from JS + JSX files too
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.

Support Testing with imports of JS files in ESM
2 participants