MCPcopy Create free account
hub / github.com/Effect-TS/effect / expectIteration

Function expectIteration

packages/effect/test/HashMap.test.ts:162–168  ·  view source on GitHub ↗
(iterator: Iterator<A>, expected: ReadonlyArray<A>)

Source from the content-addressed store, hash-verified

160
161 it("preserves traversal order across every node kind", () => {
162 const expectIteration = <A>(iterator: Iterator<A>, expected: ReadonlyArray<A>) => {
163 for (const value of expected) {
164 expect(iterator.next()).toEqual({ done: false, value })
165 }
166 expect(iterator.next()).toEqual({ done: true, value: undefined })
167 expect(iterator.next()).toEqual({ done: true, value: undefined })
168 }
169
170 const empty = HashMap.empty<string, number>()
171 expectIteration(empty[Symbol.iterator](), [])

Callers 1

HashMap.test.tsFile · 0.85

Calls 2

nextMethod · 0.65
expectFunction · 0.50

Tested by

no test coverage detected