bring back snapshot test

This commit is contained in:
Doruk 2025-06-19 20:56:41 +02:00
parent b907d62a56
commit 8a5202bd35

View file

@ -501,9 +501,11 @@ test("Test getAggregatedBuckets - Data aggregation", async (t) => {
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);
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) => {