From a9d78b49e3a498638f3b38a62c646bab19d48c8d Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 28 Oct 2024 10:53:19 +0100 Subject: [PATCH] chore(expect): clarify message() for custom matchers --- docs/src/test-assertions-js.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index defbc3a293..96ec50921e 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -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` +