Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test("array should support iterall / iterable ", () => {
var a = observable([1, 2, 3])
expect(iterall.isIterable(a)).toBe(true)
expect(iterall.isArrayLike(a)).toBe(true)
var values = []
iterall.forEach(a, v => values.push(v))
expect(values).toEqual([1, 2, 3])
var iter = iterall.getIterator(a)
expect(iter.next()).toEqual({ value: 1, done: false })
expect(iter.next()).toEqual({ value: 2, done: false })
expect(iter.next()).toEqual({ value: 3, done: false })
expect(iter.next()).toEqual({ value: undefined, done: true })
a.replace([])
iter = iterall.getIterator(a)
expect(iter.next()).toEqual({ value: undefined, done: true })
})