Skip to content

ExpectationResult of a custom asymmetric matcher is ignored #7730

@kettanaito

Description

@kettanaito

Describe the bug

When I have a custom asymmetric matcher, Vitest applies it correctly but disregards the matcher's ExpectationResult properties like message, actual, and expected if the matcher fails. I expect the inverse assertions (.not) to have the same problem.

Reproduction

Here's a sandbox: https://stackblitz.com/edit/vitest-dev-vitest-je43znvc?file=vite.config.ts,vitest.setup.ts,test%2Fbasic.test.ts&initialPath=__vitest__/

System Info

Irrelevant.

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions