From 8a5202bd3550c7369bf9ac3d9578d585f32313a1 Mon Sep 17 00:00:00 2001 From: Doruk Date: Thu, 19 Jun 2025 20:56:41 +0200 Subject: [PATCH] bring back snapshot test --- test/backend-test/test-uptime-calculator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/backend-test/test-uptime-calculator.js b/test/backend-test/test-uptime-calculator.js index 0328983dd..136b8fb31 100644 --- a/test/backend-test/test-uptime-calculator.js +++ b/test/backend-test/test-uptime-calculator.js @@ -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) => {