mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Handle expected closed status event in gpio tests
This commit is contained in:
parent
368418cf56
commit
5800ed41f1
@ -132,7 +132,12 @@ describe('RPI GPIO Node', function() {
|
|||||||
var n1 = helper.getNode("n1");
|
var n1 = helper.getNode("n1");
|
||||||
var n2 = helper.getNode("n2");
|
var n2 = helper.getNode("n2");
|
||||||
var n3 = helper.getNode("n3");
|
var n3 = helper.getNode("n3");
|
||||||
|
var count = 0;
|
||||||
n3.on("input", function(msg) {
|
n3.on("input", function(msg) {
|
||||||
|
// Only check the first status message received as it may get a
|
||||||
|
// 'closed' status as the test is tidied up.
|
||||||
|
if (count === 0) {
|
||||||
|
count++;
|
||||||
try {
|
try {
|
||||||
msg.should.have.property('status');
|
msg.should.have.property('status');
|
||||||
msg.status.should.have.property('text', "rpi-gpio.status.na");
|
msg.status.should.have.property('text', "rpi-gpio.status.na");
|
||||||
@ -140,6 +145,7 @@ describe('RPI GPIO Node', function() {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
done(err);
|
done(err);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
n1.receive({payload:"1"});
|
n1.receive({payload:"1"});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user