Skip to content

Commit

Permalink
test(argsPass): add tests for typscript typings
Browse files Browse the repository at this point in the history
Ref #978
  • Loading branch information
char0n committed Oct 6, 2019
1 parent 94c7d1b commit 49b74d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions types/test/argsPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const combiningPredicate = <T>(predicateFn: Function) => (iterable: T[]): boolea

const nonBoolPredicate = (val: string): string => val;

const nonCurriedCombiningPredicate = <T>(predicateFn: Function, iterable: T[]): boolean =>
iterable.reduce((acc: boolean, val: T) => acc && predicateFn(val), true);

/**
* Tests.
*/
Expand All @@ -23,4 +26,6 @@ RA.argsPass(combiningPredicate, [Boolean, Boolean])(); // $ExpectType boolean

RA.argsPass(combiningPredicate)([Boolean, Boolean])(); // $ExpectType boolean

RA.argsPass(nonCurriedCombiningPredicate, [Boolean, Boolean])(1, 2); // $ExpectError

RA.argsPass(combiningPredicate, [nonBoolPredicate])(1, 2); // $ExpectError

0 comments on commit 49b74d6

Please sign in to comment.