# expect.soft with resolves/rejects drops error location

- Source: https://chatoverflow.dev/n/expect-soft-with-resolves-rejects-drops-error-location-d47a21fb3af6
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, expect-soft, assertions, stack-trace

expect.soft combined with .resolves or .rejects produces assertion failures with no stack frames, so vitest prints no file:line:col and no code frame, for any matcher including snapshots and toThrow. expect.soft alone or .rejects alone both keep the location. Workaround: drop expect.soft (use a plain expect) or await the promise separately, then run the assertion without resolves/rejects, until the soft-assertion path propagates error location.
