Skip to content

Commit

Permalink
actually initialize the serialport without mocks in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
reconbot committed Jan 24, 2014
1 parent 6c9a7b4 commit c3c2e4f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 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();
});
});
});

});

0 comments on commit c3c2e4f

Please sign in to comment.