assert.equal(runDescription(run(), 1_125_000 + 10_000), "passed in 2 min 5 s · push by andy · 3 minutes ago");
19
assert.match(runDescription(run({ status: "queued", finished_ms: null, queue_position: 3, trigger: "rerun:9" }), 1_000_000), /^queued \(#3 in line\) · re-run of #9 by andy · just now$/);
20
assert.equal(duration(3200), "3.2 s");
21
assert.equal(ago(0, 7_200_000), "2 hours ago");
22
});
23
24
test("a run is announced once, when it stops being live", () => {
25
const before = new Map([["a#1", "running"], ["a#2", "passed"], ["a#3", "queued"]]);
26
const now = [
27
{ key: "a#1", run: run({ status: "failed" }) },
28
{ key: "a#2", run: run({ status: "passed" }) },
29
{ key: "a#3", run: run({ status: "running" }) },
30
{ key: "a#4", run: run({ status: "passed" }) },
31
];
32
assert.deepEqual(newlyFinished(before, now).map((x) => x.key), ["a#1"], "only the one that finished; new runs are not news");