Skip to content

Commit

Permalink
test(Stream/raceAll): add "combined sync + async" test
Browse files Browse the repository at this point in the history
  • Loading branch information
dilame authored and tim-smart committed Jul 4, 2024
1 parent f2b536e commit 9e4f134
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/effect/test/Stream/racing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,17 @@ describe("Stream", () => {
)
assert.deepStrictEqual(result, [0, 1, 2, 3])
}))

it.effect("raceAll combined sync + async", () =>
Effect.gen(function*($) {
const result = yield* $(
Stream.raceAll(
Stream.make(0, 1, 2, 3),
Stream.fromSchedule(Schedule.spaced("1 second"))
),
Stream.runCollect,
Effect.map(Chunk.toReadonlyArray)
)
assert.deepStrictEqual(result, [0, 1, 2, 3])
}))
})

0 comments on commit 9e4f134

Please sign in to comment.