deno.land / x / xstate@xstate@4.33.6 / test / examples / 6.6.test.ts
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import { createMachine } from '../../src/index';import { testAll } from '../utils';
describe('Example 6.6', () => { const machine = createMachine({ initial: 'A', states: { A: { on: { 3: 'B' }, initial: 'D', states: { C: { on: { 2: '#B' } }, D: { on: { 1: 'C' } } } }, B: { id: 'B', on: { 4: 'A.D' } } } });
const expected = { A: { 1: 'A.C', 2: 'A.D', 3: 'B', 4: 'A.D' }, B: { 1: 'B', 2: 'B', 3: 'B', 4: 'A.D' }, 'A.C': { 1: 'A.C', 2: 'B', 3: 'B', 4: 'A.C' }, 'A.D': { 1: 'A.C', 2: 'A.D', 3: 'B', 4: 'A.D' } };
testAll(machine, expected);});
Version Info