[expect-type] usage with create-react-app #141
-
I'd like to use this library. to test it, I've created a new react-app with typescript ( In the existing
In the IDE (I'm using VS Code), this shows an error ( How did you enable type checking for your test files? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I'm not familiar with create-react-app - is there a script that runs the typescript compiler? That's where the errors would he caught. |
Beta Was this translation helpful? Give feedback.
-
Seems like the TS config is embedded here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js#L102 |
Beta Was this translation helpful? Give feedback.
-
Is there a
|
Beta Was this translation helpful? Give feedback.
-
@LorenzHenk have converted this to a Q&A Discussion since I don't think there's an issue with expect-type here. Did you get it working with create-react-app in the end? |
Beta Was this translation helpful? Give feedback.
-
@mmkal you're right, I just added the script
to |
Beta Was this translation helpful? Give feedback.
@mmkal you're right,
yarn build
fails.Running the command
tsc
fails as well.I just added the script
to
package.json
and can now runyarn test && yarn ts:check
to make sure the tests are working correctly.