Skip to content

Commit

Permalink
Add a test for .filter(Boolean) on array, containing void
Browse files Browse the repository at this point in the history
  • Loading branch information
none23 committed Oct 13, 2023
1 parent c416823 commit 390b10f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tests/filter-boolean.ts
Expand Up @@ -38,3 +38,11 @@ doNotExecute(() => {

type tests = [Expect<Equal<typeof result, never[]>>];
});

doNotExecute(() => {
const arr = [(x?: unknown) => 1, () => {}].map((fn) => fn());

const result = arr.filter(Boolean);

type tests = [Expect<Equal<typeof result, number[]>>];
});

0 comments on commit 390b10f

Please sign in to comment.