Skip to content

Commit

Permalink
test: add more ArrayPlus.Filter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Sep 12, 2023
1 parent 7c8e0e8 commit 3e941ac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions type-plus/ts/array/array_plus.filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ it('can override never case', () => {
it('can override not array case', () => {
testType.equal<ArrayPlus.Filter<[], string, { $notArray: 1 }>, 1>(true)
})

it('filter type within the array matching the criteria', () => {
testType.equal<ArrayPlus.Filter<Array<string | undefined>, string>, string[]>(true)
})

it('defaults to match true', () => {
testType.equal<ArrayPlus.Filter<Array<string | true | undefined>>, true[]>(true)
testType.equal<ArrayPlus.Filter<Array<string | boolean | undefined>>, true[]>(true)
})

0 comments on commit 3e941ac

Please sign in to comment.