mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix random delay in milliseconds case and change test to reproduce bug.
Because there was no multiplier the node.randomFirst was a string so the later '+' was a concatentation. The test failed to catch this because it uses integers not strings to configure the node.
This commit is contained in:
@@ -62,8 +62,8 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
if (n.randomUnits === "milliseconds") {
|
||||
this.randomFirst = n.randomFirst;
|
||||
this.randomLast = n.randomLast;
|
||||
this.randomFirst = n.randomFirst * 1;
|
||||
this.randomLast = n.randomLast * 1;
|
||||
} else if (n.randomUnits === "seconds") {
|
||||
this.randomFirst = n.randomFirst * 1000;
|
||||
this.randomLast = n.randomLast * 1000;
|
||||
|
Reference in New Issue
Block a user