-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typings not working properly #16
Comments
I changed this file https://github.com/mattphillips/jest-chain/blob/master/types/index.d.ts You can update index.d.ts file in node_modules\jest-chain\types\index.d.ts declare namespace jest {
type ChainedMatchers<R> = { [K in keyof AndNot<jest.Matchers<R>>]: AndNot<jest.Matchers<ChainedMatchers<R>>>[K] };
interface Expect {
/**
* The `expect` function is used every time you want to test a value.
* You will rarely call `expect` by itself.
*
* @param actual The value to apply matchers against.
*/
<T = any>(actual: T): ChainedMatchers<T>;
}
} Added AndNot<> wrapper here |
@refucktor and @tonoslav, please, try to apply this PR #15 |
Thanks @Userbit , I will try it soon and give you feedback |
This should be fixed by: DefinitelyTyped/DefinitelyTyped#41766 Please try using the latest @types/jest. Going to close this for now, but feel free to re-open and let me know if this is still an issue. |
Bug
package
version:node
version: 12.14.1npm
version: 6.13.6Relevant code or config
Scenario:
After upgrading to the latest
@types/jest
version (see version on top) some matchers start giving the following errorProperty 'not' does not exist on type 'ChainedMatchers<any>'.
Custom expect extensions are not working as well:
TS2339: Property 'toDeepKeysEqual' does not exist on type 'ChainedMatchers<any>'.
I'm using Webstorm and typescript setup properly... everything was working perfectly until I update the package previously mentioned.
If I remove the import of
jest-chain
everything goes back to workAny idea what might cause the problem or how to solve it.
Thanks in advance
The text was updated successfully, but these errors were encountered: