add spreadfactor test
This commit is contained in:
parent
fca72ac0f1
commit
6fb903353a
1 changed files with 26 additions and 1 deletions
27
test/test.js
27
test/test.js
|
@ -157,5 +157,30 @@ async.series([
|
|||
});
|
||||
|
||||
ports.dev2.write(`send${message}\n`);
|
||||
});
|
||||
}, "round-trip message");
|
||||
|
||||
test(function(t) {
|
||||
t.plan(2);
|
||||
|
||||
var sf = 9;
|
||||
var msg = `sf${sf}\n`;
|
||||
|
||||
testSetSpreadFactor(ports.dev1);
|
||||
testSetSpreadFactor(ports.dev2);
|
||||
|
||||
function testSetSpreadFactor(port) {
|
||||
var buf = "";
|
||||
|
||||
port.on("data", function onData(c) {
|
||||
buf += c.toString();
|
||||
|
||||
if(buf.indexOf(`spreadfactor: ${sf}`) !== -1) {
|
||||
t.pass("spreadfactor set");
|
||||
port.removeListener("data", onData);
|
||||
}
|
||||
});
|
||||
|
||||
port.write(msg);
|
||||
};
|
||||
}, "spreadfactor");
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue