Skip to content

Commit 2ab45fe

Browse files
test: verify exceeds arrays are empty with invalid thresholds
Assert that no function has exceeds when thresholds are non-numeric strings, complementing the summary.aboveWarn === 0 assertions.
1 parent 674a48a commit 2ab45fe

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/integration/complexity.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ describe('complexityData', () => {
345345
// With all thresholds invalid, no filtering occurs — all functions returned
346346
expect(data.functions.length).toBeGreaterThanOrEqual(4);
347347
expect(data.summary.aboveWarn).toBe(0);
348+
// No function should have exceeds when all thresholds are invalid
349+
for (const fn of data.functions) {
350+
expect(fn.exceeds).toBeUndefined();
351+
}
348352
});
349353

350354
test('string-numeric thresholds are rejected (strict type check)', () => {
@@ -362,5 +366,9 @@ describe('complexityData', () => {
362366
// so all functions are returned (no HAVING filter applied)
363367
expect(data.functions.length).toBeGreaterThanOrEqual(4);
364368
expect(data.summary.aboveWarn).toBe(0);
369+
// No exceeds when thresholds are strings
370+
for (const fn of data.functions) {
371+
expect(fn.exceeds).toBeUndefined();
372+
}
365373
});
366374
});

0 commit comments

Comments
 (0)