avajs/ava

First parameter for "snapshot" assertion should be called "value" for consistency

Aperta

#2931 aperta il 5 gen 2022

 (9 commenti) (1 reazione) (0 assegnatari)JavaScript (1408 fork)batch import
help wanted

Metriche repository

Star
 (20.600 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Currently, it is called "expected": https://github.com/avajs/ava/blob/main/docs/03-assertions.md#snapshotexpected-message

However, that is inconsistent with other assertion APIs like "is" where parameters are named "value" and "expected": https://github.com/avajs/ava/blob/main/docs/03-assertions.md#isvalue-expected-message

In the case of "snapshot", the expected data is represented by the previously-captured snapshot and the test data (often called "actual") is what gets passed to the function via the first parameter.

Guida contributor