Updating inline snapshot passes without actually updating code in Browser Mode when slowHijackESM: true
#5280
Closed
6 tasks done
Labels
feat: browser
Issues and PRs related to the browser runner
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
See #5278 (comment)
Currently inline snapshot update is not working due to #5263, but even after the fix #5278, it's still not working when
slowHijackESM: true
for a different reason.It looks like there's something wrong with stacktrace and it's not finding the right position. I was debug logging around here:
vitest/packages/snapshot/src/port/state.ts
Lines 125 to 133 in 4ff7159
Reproduction
expect(2).toMatchInlineSnapshot('1')
:vitest/test/browser/test/snapshot.test.ts
Lines 3 to 5 in 4ff7159
$ pnpm -C test/browser test-fixtures run -u test/snapshot.test.ts -t inline ... ✓ test/snapshot.test.ts (3) ✓ inline snapshot ↓ snapshot [skipped] ↓ file snapshot [skipped] Snapshots 1 updated Test Files 1 passed (1) Tests 1 passed | 2 skipped (3) Start at 17:47:52 Duration 1.22s (transform 0ms, setup 0ms, collect 13ms, tests 7ms, environment 0ms, prepare 0ms)
test/snapshot.test.ts
still hasexpect(2).toMatchInlineSnapshot('1')
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: