alerts: story
Three rounds of readings through alerts.
The boiler runs hot: on-call hears about it.
$send alerts.check (readings = [{sensor: "boiler", value: 71.5}, {sensor: "attic", value: 22.0}], limit = 60.0)
$expect payload == ["boiler"]
$expect sizeOf(sent) is 1
$expect sent[0].text is "over 60.0: boiler"
Twice the limit: the manager is told as well.
$send alerts.check (readings = [{sensor: "boiler", value: 130.0}, {sensor: "attic", value: 64.0}], limit = 60.0)
$expect sizeOf(sent) is 3
$expect sent[-1].to is "manager"
A quiet round sends nothing new.
$send alerts.check (readings = [{sensor: "attic", value: 20.0}], limit = 60.0)
$expect payload is "all normal"
$expect sizeOf(sent) is 3