Skip to content

Commit 2baa77b

Browse files
committed
correctly hide stackstrace file path and location
1 parent 0104787 commit 2baa77b

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

tests/testthat/_snaps/quarto.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
ERROR: Book chapter 'intro.qmd' not found
2121
2222
Stack trace:
23-
at throwInputNotFound (file://<quarto full path>\quarto.js:100761:19)
24-
at findInputs (file://<quarto full path>\quarto.js:100792:17)
23+
at throwInputNotFound (<quarto.js full path with location>)
24+
at findInputs (<quarto.js full path with location>)
2525
at eventLoopTick (ext:core/01_core.js:175:7)
26-
at async findChapters (file://<quarto full path>\quarto.js:100804:13)
27-
at async bookRenderItems (file://<quarto full path>\quarto.js:100807:5)
28-
at async Object.bookProjectConfig [as config] (file://<quarto full path>\quarto.js:100712:25)
29-
at async projectContext (file://<quarto full path>\quarto.js:82390:38)
30-
at async inspectConfig (file://<quarto full path>\quarto.js:110378:21)
31-
at async Command.actionHandler (file://<quarto full path>\quarto.js:110497:20)
32-
at async Command.execute (file://<quarto full path>\quarto.js:8253:13)
26+
at async findChapters (<quarto.js full path with location>)
27+
at async bookRenderItems (<quarto.js full path with location>)
28+
at async Object.bookProjectConfig [as config] (<quarto.js full path with location>)
29+
at async projectContext (<quarto.js full path with location>)
30+
at async inspectConfig (<quarto.js full path with location>)
31+
at async Command.actionHandler (<quarto.js full path with location>)
32+
at async Command.execute (<quarto.js full path with location>)
3333
3434
Caused by error:
3535
! System command 'quarto.exe' failed

tests/testthat/helper.R

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,13 @@ transform_quarto_cli_in_output <- function(
165165
lines
166166
)
167167

168-
# Remove any file:/// (in stackstrace outputs)
169-
lines <- gsub(
170-
"file:[/]{2,3}(<quarto full path>)",
171-
"file://<quarto full path>",
172-
lines
173-
)
174-
175168
# Handle quarto.js in stackstrace outputs
176169
lines <- gsub(
177-
"<quarto full path>/quarto.js",
178-
"<quarto full path>\\quarto.js",
179-
lines,
180-
fixed = TRUE,
170+
"file:[/]{2,3}<quarto full path>[/\\]quarto.js:\\d+:\\d+",
171+
"<quarto.js full path with location>",
172+
lines
181173
)
174+
# fixup location differrence
182175
} else {
183176
# it will be quarto.exe only on windows
184177
lines <- gsub("quarto\\.(exe|cmd)", "quarto", lines)

0 commit comments

Comments
 (0)