Skip to content

Evaluate the naming of expected and actual #38

@shrink

Description

@shrink

The naming of these inputs makes sense for comparisons but for more complex assertions, or assertions where there is an implicit target, it doesn't make as much sense. For example, an assertion that checks for a status code needs to accept a status code input (e.g: 200) and a list of one or more URLs to test. An assertion that checks if a number is even knows what it's testing for -- it just needs a list of numbers to test.

Expected is... the (optional) value that the assertion is testing for
Actual is... the (optional) value(s) that the assertion is perform the test on

A comprehensive description of each input with examples might help avoid the need to rename the inputs, or perhaps aliases for the inputs could work (may be confusing, though).

  • expected / actual
  • target / input
  • for / against
  • values
assertion: npm://@assertions/is-even
each: true
values: |
  2
  4
  6
  8
assertion: npm://@assertions/status-code
each: true
expected: 200
actual: |
  https://www.example.com/200
  https://www.example.com/200
  https://www.example.com/404

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions