From c83a1209262d4092d3afafc6c7455accea7b1bdf Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Wed, 14 Feb 2024 22:12:36 +0000 Subject: [PATCH] Use t.execution for exhaustiveness error tests --- tests/utils.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/utils.js b/tests/utils.js index fcb03a7c1..261a28b4d 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -7,16 +7,18 @@ test('assert()', (t) => { t.exception(() => assert(false, 'uh oh'), /uh oh/) }) -test('exhaustivenessError', () => { +test('exhaustivenessError', (t) => { const bools = [true, false] - bools.forEach((bool) => { - switch (bool) { - case true: - case false: - break - default: - throw new ExhaustivenessError(bool) - } + t.execution(() => { + bools.forEach((bool) => { + switch (bool) { + case true: + case false: + break + default: + throw new ExhaustivenessError(bool) + } + }) }) })