Without this change, following error is signaled:
(node:12996) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: First argument must be an int
This allows for catching TypeErrors when open gets called
- Change MockBinding to properly throw and return errors on open
- Enforce bindings throwing on empty string paths
This is a major change. To reading, the poller and the bindings layer, there isn’t a great way to do this piecemeal. The goal here is to make bindings a plugin layer, our c++ bindings isolated and tested, and make Serialport a streams object.
- Move all bindings into platform specific modules DarwinBinding LinuxBinding, and WindowsBinding
- Separate out the bindings from the SerialPort class so it can be required by itself.
- Provide mock bindings as a tested first class bindings layer
- Mixin stream methods with `pushBindingWrap`, inspired from fs.readStream
- All integration tests now require an Arduino
- Ditch sandboxed modules as we don't need to be that heavy handed to test anymore
TODO
- windows binding
- performance test
- memory leak test
- 🎉
`this.buffer` is never initialized so if we close the port while reading we'll get an error. This has no tests but doesn't fail any of our current tests. With the streams rewrite this is no longer an issue and instead of testing it fully here I'd rather concentrate on a new implementation of it.
Parsers are now transform streams! I'm not 100% convinced this is easier to use but it is more clear about the mechanics. I think that might make it worthwhile. It also opens up a clear example to how to make your own parser.
This moves a lot of docs into JSDOC and provides a doc build system including throwing a CI error if the docs are out of date or if the wrong file was edited. Docs are put into the README for now but html docs are possible. Updated contributors guide to explain how to update the docs.
Todo:
- transition static methods and parsers into jsdoc
- options objects and callbacks show as instance methods
- npm test now runs everything but stress tests
- TEST_PORT is optional but now requires an arduino, the travis provided OS X serial port wasn't worth it
- do some improvements to coverage
- Drop grunt for file size and complexity
- Eslint has dropped 0.10
I don't think Istanbul can detect coverage on sandboxed modules like our mocked bindings. Moving to an isolated binding will improve this situation.
I also don't think coveralls is working on travis