mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-19 15:44:02 +02:00
bring back snapshot test
This commit is contained in:
parent
b907d62a56
commit
8a5202bd35
1 changed files with 4 additions and 2 deletions
|
@ -501,9 +501,11 @@ test("Test getAggregatedBuckets - Data aggregation", async (t) => {
|
||||||
assert.ok(bucket.start < bucket.end);
|
assert.ok(bucket.start < bucket.end);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Verify bucket structure consistency
|
// Snapshot test - verify deterministic bucket structure
|
||||||
|
const snapshot = JSON.stringify(buckets);
|
||||||
const secondCall = c.getAggregatedBuckets(1 / 24, 6);
|
const secondCall = c.getAggregatedBuckets(1 / 24, 6);
|
||||||
assert.strictEqual(JSON.stringify(buckets), JSON.stringify(secondCall), "Bucket structure should be deterministic");
|
const secondSnapshot = JSON.stringify(secondCall);
|
||||||
|
assert.strictEqual(snapshot, secondSnapshot, "Bucket structure should be deterministic between calls");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Test getAggregatedBuckets - Edge cases", async (t) => {
|
test("Test getAggregatedBuckets - Edge cases", async (t) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue