ryanolf / node-sonos-nfc

Access your streaming music through physical NFC tokens, like putting on a CD or record. Great for children and adult aesthetics.
MIT License
36 stars 14 forks source link

Add tests #5

Closed mattijsbliek closed 3 years ago

mattijsbliek commented 3 years ago

This PR adds tests that cover the vast majority of the code (95% coverage) while making as few changes to the code itself as possible.

Important changes

The only code that's currently not covered by tests is the error thrown when a playback command can't be executed. Since that will almost certainly be extracted, it's something I can live with for now. Let me know if you disagee.

Note that this PR also contains the changes from the Prettier PR. Those will disappear as soon as that's merged to master. I suggest not reviewing this PR before that time :)

ryanolf commented 3 years ago

@mattijsbliek Thanks for these. Got a chance to look it through and test it out and it all seems good!