farmOS / farmOS.js

A JavaScript library for working with farmOS data structures and interacting with farmOS servers.
MIT License
17 stars 13 forks source link

Add tests based on jgaehring/farmos-js-examples #16

Closed jgaehring closed 3 years ago

jgaehring commented 4 years ago

For a while now I've been using another respository, jgaehring/farmos-js-examples, to test this library in both Node.js and React environments. I've thought about just copying the whole examples directory from that repository into this one. However, if I'm going to commit to maintaining those examples, I'd prefer them to be automated, so I don't have to manually check every script to see if they are still working, every time I make a change. I also don't think I want to keep the React test around, because of all its dependencies, and because we have Field Kit to serve an real-world example of a browser-based application using farmOS.js.

I chatted a little with @mstenta and @paul121 about this, and we realized it could be another great use of the example data set proposed on the forum. That sounds like it could be a while before coming to fruition, so I wonder if there might be a halfway point that's not as automated and rigorous, but achieves a lot of what the farmos-js-examples repo does now. :thinking:

When I have more time, I'll try to circle back around to this.

jgaehring commented 3 years ago

I've started migrating the Node examples over to this repo on the 2.x branch as I work on farmOS/farmOS-client#430. With 1c7e56c I installed Mocha and Chai for testing, and migrated the first test with 7d36680. It will take a little time to migrate all the examples over as tests, but I think this can be closed for now, as that task will be ongoing.