Skip to content

Commit

Permalink
chore(package): update sinon to version 3.0.0 (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and reconbot committed Aug 7, 2017
1 parent 8c36e99 commit 648a7f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"mocha": "^3.4.2",
"prebuild": "^6.2.1",
"proxyquire": "^1.7.10",
"sinon": "^2.3.8"
"sinon": "^3.0.0"
},
"engines": {
"node": ">=4.0.0"
Expand Down
18 changes: 9 additions & 9 deletions test/serialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('SerialPort', () => {

it('returns false when the port is opening', (done) => {
const port = new SerialPort('/dev/exists', { autoOpen: false });
sandbox.stub(port.binding, 'open').callsFake(() => {
sandbox.stub(SerialPort.Binding.prototype, 'open').callsFake(() => {
assert.isTrue(port.opening);
assert.isFalse(port.isOpen);
done();
Expand All @@ -246,14 +246,14 @@ describe('SerialPort', () => {
});

it('returns false when the port is closing', (done) => {
const port = new SerialPort('/dev/exists', {}, function() {
sandbox.stub(this.binding, 'close').callsFake(() => {
assert.isFalse(port.isOpen);
done();
return Promise.resolve();
});
const port = new SerialPort('/dev/exists', {}, () => {
port.close();
});
sandbox.stub(SerialPort.Binding.prototype, 'close').callsFake(() => {
assert.isFalse(port.isOpen);
done();
return Promise.resolve();
});
});

it('returns false when the port is closed', (done) => {
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('SerialPort', () => {
stopBits: 1
};
const port = new SerialPort('/dev/exists', { autoOpen: false });
sandbox.stub(port.binding, 'open').callsFake((path, opt) => {
sandbox.stub(SerialPort.Binding.prototype, 'open').callsFake((path, opt) => {
assert.equal(path, '/dev/exists');
assert.containSubset(opt, defaultOptions);
done();
Expand Down Expand Up @@ -348,7 +348,7 @@ describe('SerialPort', () => {

it('allows opening after an open error', (done) => {
const port = new SerialPort('/dev/exists', { autoOpen: false });
const stub = sandbox.stub(port.binding, 'open').callsFake(() => {
const stub = sandbox.stub(SerialPort.Binding.prototype, 'open').callsFake(() => {
return Promise.reject(new Error('Haha no'));
});
port.open((err) => {
Expand Down

0 comments on commit 648a7f5

Please sign in to comment.