From c3c2e4fe346ac466195bb14a77216ccd5dec971d Mon Sep 17 00:00:00 2001 From: Francis Gulotta Date: Thu, 23 Jan 2014 20:13:15 -0500 Subject: [PATCH] actually initialize the serialport without mocks in tests --- test/serialport-c.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/serialport-c.js 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