From a72930a7bbd666b6362e1aa22b18a021b1588340 Mon Sep 17 00:00:00 2001 From: Kenneth Lum Date: Thu, 28 Oct 2021 08:35:35 -0700 Subject: [PATCH] docs: add the general rule to expect the opposite of the matchers (#9772) --- docs/src/test-assertions-js.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index 5a8069e7cd..6e20a630fb 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -11,7 +11,13 @@ expect(success).toBeTruthy(); ``` Playwright also extends it with convenience async matchers that will wait until -the expected condition is met. +the expected condition is met. In general, we can expect the opposite to be true by adding a `.not` to the front +of the matchers: + +```js +expect(value).not.toEqual(0); +await expect(locator).not.toContainText("some text"); +```