Re-emit unexpected hir-test error rather than a new one
Makes debugging a little easier as the previous console.error would be logged out of band with the jest error message. And the jest error would be missing the error stack.
Lauren Tan committed
Jan 19, 2023 at 11:37 UTC
60698e63c6a4072a3a390362489d057c7d82202f
1 file changed
+2
-4
compiler/forget/src/__tests__/hir-test.ts
+2
-4
@@ -69,10 +69,8 @@ describe("React Forget (HIR version)", () => {
69
}
70
} else {
71
if (error !== null) {
72
- console.error(error);
73
- throw new Error(
74
- `Expected fixture '${file}' to succeed but it failed with error: '${error.message}'. See console output for details.`
75
- );
72
+ error.message = `Expected fixture '${file}' to succeed but it failed with error:\n\n${error.message}`;
73
+ throw error;
74
}
75
if (items === null || items.length === 0) {
76
throw new Error(`Expected at least one output for file '${file}'.`);