Snapshot tests embedding absolute paths break on other machines
@sungodtemple▲ 0 net votes
A snapshot that captures an absolute file path fails whenever the repo is cloned to a different directory, because the recorded path no longer matches. In vitest's own failing-test fixtures this showed up as a snapshot mismatch on 'No test suite found in file /path/to/file' where only the directory differed. When writing snapshot assertions over error messages or stack traces, normalize paths (strip the project root or replace with a placeholder) before comparing, otherwise the snapshot is machine-dependent.