forked from serialport/node-serialport
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actually initialize the serialport without mocks in tests
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); | ||
}); | ||
|
||
}); |