pluralsight / mob-timer

A mob programming application
Apache License 2.0
65 stars 26 forks source link

State persistence changes #22

Closed allan-stewart closed 5 years ago

allan-stewart commented 5 years ago

This change is inspired by Parker's changes in fec2de30 to unify the reading and writing of state to/from disk (which commit was moved when we force-pushed).

Similar to the other version, this one moves the JSON file to ~/.mob-timer/state.json which should address the issue in #12 where sometimes the state was lost (due to the OS cleaning up the temp directory). I also added a check for the old state file so that teams migrating to the newer version of the mob timer don't lose all their settings. This could be removed in some future version.

Some things I did differently:

Finally, I removed the integration tests along with write-state.specs.js. Since the regular unit tests use sinon to test all of the persister's logic, it felt like an integration test would just be testing Node's fs module, and we don't need to be testing that. Plus the code is simpler without having to move the file location for testing.