chore(expect): clarify message() for custom matchers

This commit is contained in:
Simon Knott 2024-10-28 10:53:19 +01:00
parent 4b7c8d8a20
commit a9d78b49e3
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -276,12 +276,12 @@ export const expect = baseExpect.extend({
}
const message = pass
? () => this.utils.matcherHint(assertionName, undefined, undefined, { isNot: this.isNot }) +
? () => this.utils.matcherHint(assertionName, undefined, undefined, { isNot: true }) +
'\n\n' +
`Locator: ${locator}\n` +
`Expected: ${this.isNot ? 'not' : ''}${this.utils.printExpected(expected)}\n` +
`Expected: not ${this.utils.printExpected(expected)}\n` +
(matcherResult ? `Received: ${this.utils.printReceived(matcherResult.actual)}` : '')
: () => this.utils.matcherHint(assertionName, undefined, undefined, { isNot: this.isNot }) +
: () => this.utils.matcherHint(assertionName, undefined, undefined, { isNot: false }) +
'\n\n' +
`Locator: ${locator}\n` +
`Expected: ${this.utils.printExpected(expected)}\n` +