Skip to content

Commit 9e37e02

Browse files
committed
Surface renderProject error in the #14683 e2e regression test
The missing-file assertion fired before the result.error check, so a CI-only failure gave no diagnostic beyond "no HTML produced". Include the error message/stack in the existence assertion so the next CI run shows the actual cause.
1 parent 6517539 commit 9e37e02

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎tests/unit/preview-subdir-knitr-cwd.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@ unitTest(
9595
// The behavioral signal for this bug is whether the knitr render
9696
// actually produced output. With the bug, the R subprocess fails at
9797
// rmarkdown:::abs_path(input) (execute.R) before Pandoc runs, so no
98-
// HTML is written. The wrapped renderProject error carries no message
99-
// (render-files.ts), so we assert on the output itself, not error text.
98+
// HTML is written. Surface renderProject's error (if any) first, since
99+
// the missing-file assertion below would otherwise mask it.
100100
const outputHtml = join(e2eProjDir, "_site", "labs", "claudetest.html");
101101
assert(
102102
existsSync(outputHtml),
103103
"Expected rendered HTML at _site/labs/claudetest.html — knitr render " +
104-
"of the subdir doc failed to produce output (regression #14683)",
104+
"of the subdir doc failed to produce output (regression #14683). " +
105+
`renderProject error: ${result.error?.message} ${result.error?.stack}`,
105106
);
106107

107108
// Mere existence is not enough: prove the knitr chunk actually

0 commit comments

Comments
 (0)