From 371e9f5b3b42c9720f86e69b6851d75e84fb1821 Mon Sep 17 00:00:00 2001 From: Cullen Walsh Date: Fri, 18 Jul 2025 19:43:50 +0000 Subject: [PATCH] [Test] Stop ignoring exceptions thrown in snapshot tests Summary: This logic can hide breakages and cause tests to pass when the underlying logic is actually broken. I encountered these hidden breakages while working on some further feature changes, and figured it was appropriate to fix this first. As all existing tests pass without the try/catch, this change is effectively a no-op. Test Plan: `yarn install && yarn run test ./tests/` --- test-setup/run_spec.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-setup/run_spec.mjs b/test-setup/run_spec.mjs index 9be86fe..9fd59e2 100644 --- a/test-setup/run_spec.mjs +++ b/test-setup/run_spec.mjs @@ -45,7 +45,9 @@ function run_spec(dirname, parsers, options) { raw(source + '~'.repeat(80) + '\n' + result), ).toMatchSnapshot(filename); } catch (e) { - console.error(e, path); + throw new Error( + `Problem occurred in ${path} file: ${error.name}`, + ); } });