Closed mockdeep closed 4 years ago
ugh. interfaces are globally scoped.. so dumb. we should just change to use type
internally. I think that should fix it.
Could you test by making this change at node_modules/jest-enzyme/lib/index.d.ts:7:15
in your codebase?
just change it to type Matchers<R> = {
@blainekasten It doesn't work.
node_modules/@types/jest/index.d.ts:639:15 - error TS2300: Duplicate identifier 'Matchers'.
639 interface Matchers<R, T> {
~~~~~~~~
node_modules/jest-enzyme/lib/index.d.ts:7:10
7 type Matchers<R> = {
~~~~~~~~
'Matchers' was also declared here.
node_modules/jest-enzyme/lib/index.d.ts:7:10 - error TS2300: Duplicate identifier 'Matchers'.
7 type Matchers<R> = {
~~~~~~~~
node_modules/@types/jest/index.d.ts:639:15
639 interface Matchers<R, T> {
~~~~~~~~
'Matchers' was also declared here.
I thank that we need to change interface Matchers<R>
to interface Matchers<R, T>
in jest-enzyme
.
@vkrol did you test that locally to see it fix it? It just seems weird that typescript thinks they are the same
@blainekasten
did you test that locally to see it fix it?
Yes.
It just seems weird that typescript thinks they are the same
That's okay, because they're in the same namespace jest
.
Not sure how to resolve this, but it looks like upgrading
@types/jest
from24.0.19
to24.0.20
breaks compatibility with thejest-enzyme
types. Seems like it can be tricky to maintain type compatibility across libraries with issues such as this.