From 4a302119dc44d268e7b29de6e8d123fb572147e5 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 17 Jul 2024 12:32:31 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Dmitry Gozman Signed-off-by: Max Schmitt --- docs/src/test-assertions-js.md | 2 +- packages/playwright/src/matchers/expect.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index d8059190b6..defbc3a293 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -308,7 +308,7 @@ test('amount', async () => { }); ``` -### Compatibility with expect from Jest +### Compatibility with expect library :::note Do not confuse Playwright's `expect` with the [`expect` library](https://jestjs.io/docs/expect). The latter is not fully integrated with Playwright test runner, so make sure to use Playwright's own `expect`. diff --git a/packages/playwright/src/matchers/expect.ts b/packages/playwright/src/matchers/expect.ts index 4db9b39c70..3e49360eb7 100644 --- a/packages/playwright/src/matchers/expect.ts +++ b/packages/playwright/src/matchers/expect.ts @@ -185,7 +185,7 @@ function createExpect(info: ExpectMetaInfo) { } function throwUnsupportedExpectMatcherError() { - throw new Error('Playwright Expect matchers are not fully compatible with Jest matchers. See https://aka.ms/playwright/expect-compatibility'); + throw new Error('It looks like you are using custom expect matchers that are not compatible with Playwright. See https://aka.ms/playwright/expect-compatibility'); } expectLibrary.setState({ expand: false });