Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Update Jest config so .js and .jsx are transformed correctly #162

Closed

Conversation

timswalling
Copy link

@timswalling timswalling commented Sep 13, 2017

  • .js and .jsx should be transformed by ts-jest to make sure any ES6+ features are transpiled
  • The fileTransform.js should not be run on any JavaScript or TypeScript files [resolved by 31e3ffe]

Fixes #136, and changes order and regex style to more closely match create-react-app.

How to verify that these changes fix the issue:

  • Create a .tgz containing the modified react-scripts package
  • Serve the .tgz over HTTP(S)
  • Create a new project, but set --scripts-version to the path to the .tgz
  • Follow the "steps to reproduce" from jest testing is not using config/polyfills.js #136. The test should now pass.

We need to make sure that any ES6+ features that aren't supported
by Jest/Node are transpiled, and that `fileTransform.js` isn't
run on any files that it shouldn't.
@DorianGrey
Copy link
Collaborator

Hm... just a thought: Wouldn't it be more useful to let babel-jest take care of .js/.jsx files? It's included anyway, since jest depends on it. ts-jest is using it internally when being forced to use babel in addition to typescript. Should be a bit more concise.

@wmonk
Copy link
Owner

wmonk commented Jan 14, 2018

As this issue hasn't been updated for a while, I am going to close it. If there are any updates feel free to re-open and comment. 👍

@wmonk wmonk closed this Jan 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jest testing is not using config/polyfills.js
3 participants