An edge case is an unusual, extreme, or boundary input or condition that may expose unexpected behavior or failure. Unit tests use these cases to check whether code meets its specification. section 6.0
Use edge cases to:
- Test invalid or unusual inputs, such as passing null to a function. section 6.5
- Find error-handling paths and other code that ordinary tests never execute. section 6.5
- Measure whether imperative and functional implementations handle boundary conditions consistently. section 6.5
Testing a null input
A QUnit test calls showStudent(null). The imperative version skips much of its execution path and reaches only 40% coverage, while the functional version returns a Nothing-like result and continues to produce strong coverage for invalid input. section 6.5
QUnit.test('Imperative Show Student with null', function (assert) {
const result = showStudent(null);
assert.equal(result, null);
});
View the compact QUnit test that exercises the null-input edge case. section 6.5






