Skip to content

Commit

Permalink
test: add test with pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
GerkinDev committed Feb 20, 2024
1 parent 7ed374d commit 04d3cd4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/zipObj.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expectType } from 'tsd';
import { zipObj } from '../types/zipObj';
import { pipe } from '../types/pipe';

const sym = Symbol.for('Symbol');

Expand All @@ -22,3 +23,9 @@ expectType<{a: boolean}>(zipObj(['a'])([true, false] as boolean[]));
expectType<{[key: string]: boolean}>(zipObj(['a'] as string[])([true, false]));
expectType<{bool: true, number: 1}>(zipObj(['bool', 'number'])([true, 1, 'string']));
expectType<{bool: true, number: 1, missing: undefined}>(zipObj(['bool', 'number', 'missing'])([true, 1]));


expectType<{string: string, number: number}>(pipe(
(a: [string, number]) => a,
zipObj(['string', 'number'])
)(['a', 42]));

0 comments on commit 04d3cd4

Please sign in to comment.