mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Print all delta values in case of error, not just the last value
Which might not even be the one triggering the error condition.
This commit is contained in:
parent
9489953a8f
commit
0c2ab13c48
@ -1734,9 +1734,10 @@ describe('function node', function() {
|
||||
msg.delta = Date.now() - msg.payload;
|
||||
receivedMsgs.push(msg)
|
||||
if (receivedMsgs.length === 5) {
|
||||
var errors = receivedMsgs.filter(msg => msg.delta < timeout_ms)
|
||||
let deltas = receivedMsgs.map(msg => msg.delta);
|
||||
var errors = deltas.filter(delta => delta < timeout_ms)
|
||||
if (errors.length > 0) {
|
||||
done(new Error(`Message received before init completed - was ${msg.delta} expected >${timeout_ms}`))
|
||||
done(new Error(`Message received before init completed - delta values ${JSON.stringify(deltas)} expected to be > ${timeout_ms}`))
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user