create-react-app-typescript icon indicating copy to clipboard operation
create-react-app-typescript copied to clipboard

ts-jest and moduleNameMapper after migrating from create-react-app to create-react-app-typescript

Open sm-tc opened this issue 7 years ago • 0 comments

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

No, haven't tried,

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected): [email protected]
  2. node -v: v8.11.3
  3. npm -v: v6.4.0

Then, specify:

  1. Operating system: Windows

Steps to Reproduce

(Write your steps here:)

  1. Create app with create-react-app
  2. Follow this guide to migrate to create-react-app-typescript
  3. Convert a few files to .ts, Add some basic path mapping to tsconfig.json
  4. npm test

Expected Behavior

Tests pass.

Actual Behavior

Tests fail with Could not locate module. Attempting to add entries into moduleNameMapper in package.json causes npm test to complain about moduleNameMapper not being a supported option with create-react-app, tells me to eject.

Reproducible Demo

Nothing yet, will put something together this weekend.

sm-tc avatar Sep 01 '18 00:09 sm-tc