From 4d44faf91100ee30902439bb52e25e3c39e4626f Mon Sep 17 00:00:00 2001 From: Mathias Leppich Date: Sat, 21 Sep 2024 00:31:39 +0200 Subject: [PATCH] fix proxying expect.not --- packages/playwright/src/matchers/expect.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/playwright/src/matchers/expect.ts b/packages/playwright/src/matchers/expect.ts index c3a604521f..582ca950a5 100644 --- a/packages/playwright/src/matchers/expect.ts +++ b/packages/playwright/src/matchers/expect.ts @@ -184,13 +184,13 @@ function createExpect(info: ExpectMetaInfo, prefix: string[], customMatchers: Re } if (property === 'not') { - return new Proxy(expectLibrary, { + return new Proxy(expectLibrary.not, { get: function(target: any, property: string) { if (typeof property === 'string' && typeof customMatchers[property] === 'function' && typeof (customMatchers[property] as any).qualifiedName === 'string') { const qualifiedName = (customMatchers[property] as any).qualifiedName as string; - return (expectLibrary as any)['not'][qualifiedName]; + return target[qualifiedName]; } - return (expectLibrary as any)['not'][property]; + return target[property]; }, }); }