As an overload in SnapshotAssertion:
|
export type SnapshotAssertion = { |
|
/** |
|
* Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a |
|
* previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if |
|
* necessary record a new snapshot. |
|
* |
|
* Returns `true` if the assertion passed and throws otherwise. |
|
*/ |
|
(expected: any, message?: string): true; |
|
|
|
/** Skip this assertion. */ |
|
skip(expected: any, message?: string): void; |
|
}; |
)
snapshot(expected: string, options?: { formatAsCodeBlock: true | string }, message?: string)
This options object should only be accepted for string values, and must only contain formatAsCodeBlock. string values would be the syntax, and true would be the same as an empty string (but less weird).
When formatting, backticks would need to be escaped properly.
Originally posted by @novemberborn in #2903 (reply in thread)
As an overload in
SnapshotAssertion:ava/types/assertions.d.cts
Lines 320 to 332 in a6f42ea
This options object should only be accepted for string values, and must only contain
formatAsCodeBlock.stringvalues would be the syntax, andtruewould be the same as an empty string (but less weird).When formatting, backticks would need to be escaped properly.
Originally posted by @novemberborn in #2903 (reply in thread)