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
The readme demonstrates that toSatisfy() and toSatisfyAll() should accept a predicate:
test('passes when value passes given predicate',()=>{constgreaterThanOneButNotThree=n=>n>1&&n!==3;expect(100).toSatisfy(greaterThanOneButNotThree);expect(0).not.toSatisfy(greaterThanOneButNotThree);expect(3).not.toSatisfy(greaterThanOneButNotThree);});
but the TypeScript compiler complains (for this exact example): Argument of type '(n: any) => boolean' is not assignable to parameter of type '() => boolean'.
What happened (please provide anything you think will help):
In types/index.d.ts, the definitions of toSatisfy() and toSatisfyAll() are incorrectly specified as:
Bug
package
version: 0.8.1node
version: 8.11.3npm
(oryarn
) version: 6.1.0Relevant code or config
The readme demonstrates that
toSatisfy()
andtoSatisfyAll()
should accept a predicate:but the TypeScript compiler complains (for this exact example):
Argument of type '(n: any) => boolean' is not assignable to parameter of type '() => boolean'.
What happened (please provide anything you think will help):
In
types/index.d.ts
, the definitions oftoSatisfy()
andtoSatisfyAll()
are incorrectly specified as:in which the predicate does not accept any argument.
Possible solution:
They should be
The text was updated successfully, but these errors were encountered: