fix(test): isolate jsdom storage on Node 26

This commit is contained in:
Turtle
2026-07-30 21:49:33 +08:00
parent 5335d61d11
commit f04b35c6a4
15 changed files with 116 additions and 10 deletions

View File

@@ -35,9 +35,7 @@ afterEach(cleanup)
// The chat store persists under its declared key; clear so one case's active
// view cannot rehydrate into the next.
beforeEach(() => {
// Node 22+ exposes an experimental localStorage global that is undefined
// without --localstorage-file; only clear when a real Storage is present.
if (typeof localStorage !== 'undefined') localStorage.clear()
localStorage.clear()
})
/** Node fixture: user prologue, two turns, one tool result inside turn 1. */