davestewart / javascript-state-machine

An expressive, feature-rich, event-driven JavaScript finite-state machine
http://statemachine.davestewart.io
342 stars 25 forks source link

I just forked master and 3 tests are failing #26

Closed justinmchase closed 5 years ago

justinmchase commented 5 years ago

I have a bug I want to fix but before I do that I am trying to get the current tests up and running. It appears that the code right out of master is failing tests however.

I could easily be doing something wrong though but I don't see a contributors guide so I'm not sure what step I may be missing.

I did:

git clone ... jsm; cd jsm
npm i
npm test

Is there a step I am missing?

Here are the test failures I'm seeing:

  34 passing (41ms)
  3 failing

  1) Given an instance of my library "before all" hook for "results in 'state.a.next state.b.next '":
     TypeError: Cannot read property 'hasOwnProperty' of undefined
      at src/core/classes/Config.js:9:24
      at Array.forEach (<anonymous>)
      at new Config (src/core/classes/Config.js:7:10)
      at StateMachine.initialize (src/StateMachine.js:88:27)
      at new StateMachine (src/StateMachine.js:18:10)
      at Context.<anonymous> (test/library.spec.js:13:11)

  2) Given an instance of my library when I set a property it should return the name:
     ReferenceError: fsm is not defined
      at Context.<anonymous> (test/valuemap.spec.js:22:20)

  3) Given an instance of my library when I need the blah should return the name:
     ReferenceError: fsm is not defined
      at Context.<anonymous> (test/valuemap.spec.js:28:20)
davestewart commented 5 years ago

Hi there.

Sorry about that.

TBH, I haven't touched this project in a long time!

It's always on the to-do list to start work on lighter, leaner V2, but I actually never really found a use for state machine after writing it.

I hope you find it useful!

I'll check your PRs now.