asymmetric matcher type definitions are not good (yet again)
hugebdu opened this issue ยท 18 comments
After the recent change, cannot be used as nested in jest
.
See this comment.
PR welcome to fix it ๐
Sorry ๐ฌ
Could you create a repro repo so I could take a look at it later today and fix it
I don't know how the current AsymmetricMatchers types works
As you can see in:
The return type is AsymmetricMatcher
and we return void (even before my change)
Could you create a repro repo so I could take a look at it later today and fix it
wil do
10x
@rluvaton negative. now I have
โ Test suite failed to run
test.spec.ts:17:7 - error TS2322: Type 'AsymmetricMatcher' is not assignable to type 'number'.
17 baz: expect.toBeNumber()
~~~
test.spec.ts:5:3
5 baz?: number;
~~~
The expected type comes from property 'baz' which is declared here on type 'Foo'
@rluvaton built-in asymmetric matchers (like expect.stringContaining
) have any
as return type
@rluvaton built-in asymmetric matchers (like
expect.stringContaining
) haveany
as return type
Where do you see that?
change to any, could you please retry?
My guess is that they're any
in @types/jest
thanks, so it's ready for review ๐