node-blink1
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -249,2 +249,10 @@ var HID = require('node-hid'); | ||
Blink1.prototype.close = function(callback) { | ||
this.hidDevice.close(); | ||
if(this._isValidCallback(callback)) { | ||
callback(); | ||
} | ||
}; | ||
Blink1.devices = devices; | ||
@@ -251,0 +259,0 @@ |
{ | ||
"name": "node-blink1", | ||
"description": "A node.js library for the blink(1).", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Sandeep Mistry", |
@@ -94,3 +94,6 @@ node-blink1 | ||
Close (the underlying HID device): | ||
blink1.close([callback]); | ||
License | ||
@@ -97,0 +100,0 @@ ======== |
@@ -33,2 +33,3 @@ | ||
var recvFeatureReport; | ||
var closed = false; | ||
@@ -42,2 +43,6 @@ var mockHIDdevice = { | ||
return ((id === FEATURE_REPORT_ID ) && (length === FEATURE_REPORT_LENGTH)) ? recvFeatureReport : null; | ||
}, | ||
close: function() { | ||
closed = true; | ||
} | ||
@@ -748,2 +753,21 @@ }; | ||
}); | ||
describe('#Blink1.close', function() { | ||
beforeEach(setupBlink1); | ||
afterEach(teardownBlink1); | ||
it('should close HID device', function(done) { | ||
blink1.close(done); | ||
closed.should.eql(true); | ||
}); | ||
it('should callback', function(done) { | ||
blink1.close(function() { | ||
closed.should.eql(true); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34856
785
119