Skip to content

Commit 371e9f5

Browse files
ckwalshvladislavarsenev
authored andcommitted
[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/`
1 parent 045e85e commit 371e9f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test-setup/run_spec.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ function run_spec(dirname, parsers, options) {
4545
raw(source + '~'.repeat(80) + '\n' + result),
4646
).toMatchSnapshot(filename);
4747
} catch (e) {
48-
console.error(e, path);
48+
throw new Error(
49+
`Problem occurred in ${path} file: ${error.name}`,
50+
);
4951
}
5052
});
5153

0 commit comments

Comments
 (0)