Skip to content

Diff generator #74

@Derpius

Description

@Derpius

This function should generate a diff, optionally with ANSI colour codes via a boolean parameter, between two values. It should support deeply nested tables, accounting for circular references.

Acceptance criteria

  • It takes two arguments: valueBefore and valueAfter
  • It prints a table with correct indentation
  • For fields that are equal between the two tables, it prints the field only once and with no colouring / annotation
  • For fields that are different between the two tables
    • It prints the field in the before value
      • highlighted in red
      • with a - before it - this should be at the same horizontal position regardless of indentation
    • It also prints the field in the after value
      • highlighted in green
      • with a + before it - this should follow the same positioning as above
    • It prints the before and after values adjacent to each other vertically
    • It prints the before value before the after value
  • It is used in matchers that can compare two table values, such as toEqual

Metadata

Metadata

Assignees

Labels

jira ticketThis issue was created from a Jira ticket during the migration to GitHub issuesscope - reportingReporting test results and related info

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions