lwd-technology / react-app-rewire-typescript

Add ts-loader to a react-app-rewired config.
MIT License
55 stars 12 forks source link

Run typescript tests #1

Open jaimesangcap opened 7 years ago

jaimesangcap commented 7 years ago

Thank you for creating this plugin, I successfully integrated it with create-react-app and antd. However when I'm running the tests, files with *.test.ts are not being detected.

Here is my package.json scripts

 "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test --env=jsdom",
    "eject": "react-app-rewired eject"
  },

Is there an extra step I need to do?

icopp commented 7 years ago

This repo currently doesn't cover running .ts tests. It's just the Webpack build (which is totally separate from all the stuff that create-react-app does with Jest).

So far we haven't found a good way to get react-scripts to work automatically with Jest + Typescript, so our own project is currently just using ts-jest with a manual configuration in package.json. However, we welcome suggestions or PRs to integrate this if anyone finds a working configuration for it with create-react-app.

jaimesangcap commented 7 years ago

I see, I think we have the same setup. I'm keeping an eye with this pull request from the react-app-rewire repo. https://github.com/timarney/react-app-rewired/pull/109. Any thoughts?

christensena commented 6 years ago

I've just put in a PR for this, #8 that uses the new support for rewiring jest configs in react-app-rewired.