theatre/packages/dataverse2/src/derivations/iterateOver.test.ts
2021-06-18 13:05:06 +02:00

19 lines
565 B
TypeScript

import Atom from '../Atom'
import iterateOver from './iterateOver'
describe.skip(`iterateOver()`, () => {
test('it should work', () => {
const a = new Atom({a: 0})
let iter = iterateOver(a.pointer.a)
expect(iter.next().value).toEqual(0)
a.setIn(['a'], 1)
a.setIn(['a'], 2)
expect(iter.next()).toMatchObject({value: 2, done: false})
iter.return()
iter = iterateOver(a.pointer.a)
expect(iter.next().value).toEqual(2)
a.setIn(['a'], 3)
expect(iter.next()).toMatchObject({done: false, value: 3})
iter.return()
})
})