SimonGAndrews / xstate-fsm-Espruino

fork of the finite state machine (FSM), XState/fsm, with modifications necessary to run it as a module within the Espruino JavaScript Interpreter for Microcontrollers
MIT License
0 stars 0 forks source link

"target" not defined in function "transition" of const "machine" #7 #8

Closed SimonGAndrews closed 3 years ago

SimonGAndrews commented 3 years ago

image Above error occurs running test_basicMachine.js inEsprunio on esp32. Another destructuging assignment like #6

SimonGAndrews commented 3 years ago

This is an object destructure assignment (not supported in Esprunio) however it also contains default assignments. used Babel to get a translation as follows:

image

Mod passes regression test test\Node\xstate-fsm\fsm.test.js in jest and fixes the issue when running in Esprunio on esp32. :)

SimonGAndrews commented 3 years ago

fix above had errors testing actions (failed to assign action from config). Reviewed and changed modification to: image

open pending further testing

SimonGAndrews commented 3 years ago

changed mod tested and passes regression test test\Node\xstate-fsm\fsm.test.js in jest. and fixes observed issue in testing actions.