skuhl / RobotRemote

0 stars 0 forks source link

Create some tests, to ensure everything works properly. #10

Open BinaryFissionGames opened 6 years ago

BinaryFissionGames commented 6 years ago

Maybe look for some testing framework/library.

Most of these test are server based. Might want to try something that can spin up multiple connections at once.

BinaryFissionGames commented 6 years ago

I'm thinking we should use Mocha. It looks like it could work just fine for our purposes.

BinaryFissionGames commented 6 years ago

I've made substantial progress with this. All the boiler plate is there, I think. The next parts are writing the actual tests. I have some made, and it's already helped to find some non-ideal behavior in our implementation.

Also, some refactoring of some things might be a good idea. like db_fetch ought to be an object, since it holds state (a mysql pool). Same with things like the camera servers and the arm server. I've already converted the webserver to an object; Although I'm not convinced about how I've used the functions in it, 'cuz a lot of those should probably be used only internally (suff like initApp).

The tests also depend on everything being set up for a local install, but I don't think that's a problem; The tests are mainly for development.

BinaryFissionGames commented 6 years ago

Something that might be useful for testing basic webpages: zombie