Skip to content

Vitest API Phase 1: Add matchers (toContainEqual, toStrictEqual, toMatchObject, toMatch) #117

@frostney

Description

@frostney

Parent: #114

Summary

Add self-contained matchers to TGocciaExpectationValue in Goccia.Builtins.TestAssertions.pas that require no new infrastructure.

Matchers

Implementation notes

  • All matchers follow the existing pattern: method on TGocciaExpectationValue, respects FIsNegated, calls AssertionFailed() on mismatch
  • toStrictEqual differs from toEqual by checking constructor identity and not allowing type coercion
  • toMatchObject recursively checks that every key in the expected object exists in the actual with matching values (subset check)
  • Tests should run in both TestRunner and Vitest

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions