techninja / cncserver

A RESTful API server for driving serial based CNC devices
133 stars 39 forks source link

Strict refactor #61

Closed techninja closed 9 years ago

techninja commented 9 years ago

One big step towards the massive overhaul that's been on the agenda since the start. This requires all code to be strict, and adds basic testing via mocha. To run, after npm install, simply run npm test and all mocha tests in the /test folder will be run, after all the code has been linted of course.

So far the tests are far from comprehensive, only covering a few basics for scratch support, but simply implementing this endeavor has found a number of inconsistencies and bugs I was sure in the code, but could see till now.

Also, this abstracts a number of other parts of the main application, allowing for scratch support to be a completely separate node module, opening the door to future support "plugins" (though not quite there yet). I'll be adding lots more tests to finish out the basics, but will first turn my attention to RoboPaint as it still has a number of release blocker issues that are not necessarily fixed by adding more tests to CNCServer...