You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading to react-scripts v5, and running react-scripts start or react-scripts build any .test.ts or .spec.ts file with type errors are reported to the build process and the build fails.
Did you try recovering your dependencies?
I started a fresh project to reproduce the error and the bug still exists
Which terms did you search for in User Guide?
Typescript, types, tests.
Environment
Environment Info:
current version of create-react-app: 5.0.0
running from /Users/joewalton/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: macOS 12.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 16.13.1 - ~/.asdf/installs/nodejs/16.13.1/bin/node
Yarn: 1.22.17 - ~/.asdf/installs/nodejs/16.13.1/.npm/bin/yarn
npm: 8.1.2 - ~/.asdf/installs/nodejs/16.13.1/bin/npm
Browsers:
Chrome: 97.0.4692.71
Edge: Not Found
Firefox: Not Found
Safari: 15.1
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: ^5.0.0 => 5.0.0
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
Create a new create-react-app using the typescript template. npx create-react-app my-app --template typescript
Add a type error to src/App.test.tsx
run npm run build
Expected behavior
Type errors should be ignored in test files when running or building app code.
Actual behavior
Type errors are reported in test files when running or building app code.
Same issue here, and adding to that, where normally @ts-ignore or @ts-expect-error works, they don't work in the .test files, they are ignored there, but in the main code it still works.
So I think there is some config difference when the tests are ran, it might ignore linting plugins? Or those plugins are outdated and don't support test env?
Describe the bug
When upgrading to react-scripts v5, and running
react-scripts start
orreact-scripts build
any.test.ts
or.spec.ts
file with type errors are reported to the build process and the build fails.Did you try recovering your dependencies?
I started a fresh project to reproduce the error and the bug still exists
Which terms did you search for in User Guide?
Typescript, types, tests.
Environment
Steps to reproduce
npx create-react-app my-app --template typescript
src/App.test.tsx
npm run build
Expected behavior
Type errors should be ignored in test files when running or building app code.
Actual behavior
Type errors are reported in test files when running or building app code.
Reproducible demo
https://github.com/jwalton9/cra-test-type-error
The text was updated successfully, but these errors were encountered: