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
{{ message }}
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
I wonder why src/setupTests.ts is excluded in tsconfig.json. The thing is, when extending jest with custom matchers that are injected into expect's return type, this needs an adjustment making the corresponding extension to jest's expect's return type definition.
Extending jest's extend is usually needed to be done only once, and therefore is usually recommended to be done in the setup tests file. But with this file not included by TS, uses of the custom matchers are flagged as type errors.
See testing-library/jest-dom#45 for details. The solution there in the end was to remove src/setupTests.ts file from the exclude section of tsconfig.json. I wonder if that could be made the default for newly created apps using this TS CRA. And if not, why? And what other solution would be recommended?
The text was updated successfully, but these errors were encountered:
gnapse
changed the title
Consider removing src/setupTests.ts from tscozfig's exclude section
Consider removing src/setupTests.ts from tsconfig's exclude section
Jul 26, 2018
Is this a bug report?
No
What's the question then?
I wonder why
src/setupTests.ts
is excluded intsconfig.json
. The thing is, when extending jest with custom matchers that are injected intoexpect
's return type, this needs an adjustment making the corresponding extension to jest'sexpect
's return type definition.Extending jest's
extend
is usually needed to be done only once, and therefore is usually recommended to be done in the setup tests file. But with this file not included by TS, uses of the custom matchers are flagged as type errors.See testing-library/jest-dom#45 for details. The solution there in the end was to remove
src/setupTests.ts
file from theexclude
section oftsconfig.json
. I wonder if that could be made the default for newly created apps using this TS CRA. And if not, why? And what other solution would be recommended?The text was updated successfully, but these errors were encountered: