diff --git a/test/serialport-c.js b/test/serialport-c.js new file mode 100644 index 0000000..3debfa5 --- /dev/null +++ b/test/serialport-c.js @@ -0,0 +1,28 @@ +"use strict"; + +var sinon = require("sinon"); +var chai = require('chai'); +var expect = chai.expect; + +describe('SerialPort', function () { + var sandbox; + + beforeEach(function () { + sandbox = sinon.sandbox.create(); + }); + + afterEach(function () { + sandbox.restore(); + }); + + describe('Initialization', function () { + it("Throws an error in callback when trying to open an invalid port", function (done) { + var SerialPort = require('../').SerialPort; + var port = new SerialPort('/dev/nullbad', function (err) { + chai.assert.isDefined(err, "didn't get an error"); + done(); + }); + }); + }); + +}); \ No newline at end of file