Skip to content

Commit

Permalink
Chunk tests (#2999)
Browse files Browse the repository at this point in the history
Co-authored-by: maksim.khramtsov <maksim.khramtsov@btsdigital.kz>
  • Loading branch information
KhraksMamtsov and maksim.khramtsov authored Jun 17, 2024
1 parent 0ff11d7 commit 06ede85
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dull-zoos-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

Added tests for `Chunk.toArray` and `Chunk.toReadonlyArray` with use cases in the `pipe`
14 changes: 13 additions & 1 deletion packages/effect/dtslint/Chunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,27 @@ pipe(nonEmptyNumbers, Chunk.reverse)
// $ExpectType string[]
Chunk.toArray(hole<Chunk.Chunk<string>>())

// $ExpectType string[]
pipe(hole<Chunk.Chunk<string>>(), Chunk.toArray)

// $ExpectType [string, ...string[]]
Chunk.toArray(hole<Chunk.NonEmptyChunk<string>>())

// $ExpectType [string, ...string[]]
pipe(hole<Chunk.NonEmptyChunk<string>>(), Chunk.toArray)

// -------------------------------------------------------------------------------------
// toArray
// toReadonlyArray
// -------------------------------------------------------------------------------------

// $ExpectType readonly string[]
Chunk.toReadonlyArray(hole<Chunk.Chunk<string>>())

// $ExpectType readonly string[]
pipe(hole<Chunk.Chunk<string>>(), Chunk.toReadonlyArray)

// $ExpectType readonly [string, ...string[]]
Chunk.toReadonlyArray(hole<Chunk.NonEmptyChunk<string>>())

// $ExpectType readonly [string, ...string[]]
pipe(hole<Chunk.NonEmptyChunk<string>>(), Chunk.toReadonlyArray)

0 comments on commit 06ede85

Please sign in to comment.