Skip to content

Commit

Permalink
complete test case for #84
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelerchian committed Nov 23, 2023
1 parent 1a9ba2c commit 6b2c829
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions machine-runner/tests/esm/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,19 @@ describe('machine as async generator', () => {
})

describe('non-destroying cloned async generator', () => {
it('should not wait after main generator peek', async () => {
const r1 = new Runner(On, { toggleCount: 0 })
const machine = r1.machine

r1.feed([], true)

const peekResult = (await machine.peekNext()).value
for await (const state of machine.noAutoDestroy()) {
expect(state).toBe(peekResult)
break
}
})

it('should generate the same snapshot as parent', async () => {
const r = new Runner(On, { toggleCount: 0 })
const machine = r.machine
Expand Down

0 comments on commit 6b2c829

Please sign in to comment.