You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test below keeps failing when run. It passes right after the snapshot is updated but fails immediately on the next run. Snapshot update doesn't actually change any content. I think vitest doesn't handle line changes properly when comparing inline snapshots.
import{expect,test}from'vitest';/* * - npm run test * - Error -> Snapshot has changed. Press u * - Snapshot is updated, test passes. Press enter to re-run * - Error -> Snapshot has changed. Repeat previous steps... */test('unstable snapshot',()=>{expect(()=>{thrownewError(['First line','Second line'].join('\n'));}).toThrowErrorMatchingInlineSnapshot(` "First line Second line" `);});
Describe the bug
Test below keeps failing when run. It passes right after the snapshot is updated but fails immediately on the next run. Snapshot update doesn't actually change any content. I think
vitest
doesn't handle line changes properly when comparing inline snapshots.vitest-unstable-snapshot.mp4
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-kxavky?file=test/basic.test.ts
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: