Skip to content

Commit 82da08b

Browse files
piecykclaude
andcommitted
test: keep the original error when leaving print fails
Check the screen media timeout after restoring the page instead of throwing from `finally`, so an `emulateMedia` rejection is not replaced by the timeout error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0e9ed49 commit 82da08b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎scripts/compare-plot-catalog.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,10 +3101,11 @@ async function endBehaviorPrint(page) {
31013101
return true
31023102
})
31033103
if (!printing) return
3104+
let changed = true
31043105
try {
31053106
await page.emulateMedia({ media: null })
31063107
} finally {
3107-
const changed = await page.evaluate(async () => {
3108+
changed = await page.evaluate(async () => {
31083109
const behavior = globalThis.__conformanceBehavior
31093110
const {
31103111
changed,
@@ -3125,8 +3126,8 @@ async function endBehaviorPrint(page) {
31253126
}
31263127
}
31273128
})
3128-
if (!changed) throw new Error('screen media did not apply within 5 s')
31293129
}
3130+
if (!changed) throw new Error('screen media did not apply within 5 s')
31303131
}
31313132

31323133
async function cancelActiveBehaviorPointer(page) {

0 commit comments

Comments
 (0)