1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-28 00:17:12 +01:00

feat(1-3260): use match object to verify that status code series is included

This commit is contained in:
Thomas Heartman 2025-01-22 09:02:56 +01:00
parent ef5209fe57
commit 648fc6079c
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -245,10 +245,14 @@ test('can query for monthly aggregation of data for a specified range', async ()
now,
new Date(entry.month),
);
const expectedCount = expectedValues[index];
const expected = expectedValues[index];
expect(entry.count).toBe(expected[entry.trafficGroup]);
expect(entry).toMatchObject({
statusCodeSeries: 200,
trafficGroup: expect.stringMatching(/group(A|B)/),
month: expect.stringMatching(/\d{4}-\d{2}/),
count: expectedCount[entry.trafficGroup],
});
}
}
});