Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate the naming of expected and actual #38

Open
shrink opened this issue Jun 18, 2021 · 0 comments
Open

Evaluate the naming of expected and actual #38

shrink opened this issue Jun 18, 2021 · 0 comments

Comments

@shrink
Copy link
Member

shrink commented Jun 18, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant