mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
actually initialize the serialport without mocks in tests
This commit is contained in:
parent
6c9a7b4704
commit
c3c2e4fe34
1 changed files with 28 additions and 0 deletions
28
test/serialport-c.js
Normal file
28
test/serialport-c.js
Normal file
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue