Goal
Add deterministic unit coverage for isTauriRuntime() in src/lib/tauriEnv.ts, which separates desktop-only behavior from the browser preview.
Scope
- Add
src/lib/tauriEnv.test.ts.
- Test the helper by installing and restoring controlled
window markers.
- Keep the tests independent of a running Tauri application.
Acceptance criteria
- Returns
false when window is unavailable.
- Returns
false when a browser-like window has no Tauri markers.
- Returns
true for each supported marker independently: __TAURI_INTERNALS__, __TAURI__ and isTauri.
- Falsey marker values do not produce a false positive.
- Every test restores global state so test order cannot affect the result.
- Production behavior stays unchanged unless a test exposes a documented defect.
Verification
npm test -- src/lib/tauriEnv.test.ts
npm run typecheck
Goal
Add deterministic unit coverage for
isTauriRuntime()insrc/lib/tauriEnv.ts, which separates desktop-only behavior from the browser preview.Scope
src/lib/tauriEnv.test.ts.windowmarkers.Acceptance criteria
falsewhenwindowis unavailable.falsewhen a browser-likewindowhas no Tauri markers.truefor each supported marker independently:__TAURI_INTERNALS__,__TAURI__andisTauri.Verification
npm test -- src/lib/tauriEnv.test.ts npm run typecheck