Skip to content

Commit

Permalink
Add test cases for ArrayTail type (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
som-sm authored Dec 5, 2024
1 parent 9869aa3 commit d5a7cae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test-d/array-tail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ expectType<[undefined, 3]>(getArrayTail([1, undefined, 3] as const));
// Complex mixed case
type ComplexArray = [string, boolean, number?, string?];
expectType<[boolean, number?, string?]>(getArrayTail(['test', false] as ComplexArray));

// All optional elements
expectType<['b'?]>([] as ArrayTail<['a'?, 'b'?]>);

// Union of tuples
expectType<[] | ['b']>([] as ArrayTail<[] | ['a', 'b']>);

0 comments on commit d5a7cae

Please sign in to comment.