@@ -5,7 +5,7 @@ import {toMatchScreenshot} from './toMatchScreenshot';
55import type { Expect } from './Expect' ;
66import type { NonSelectorAdditionalMatchers , SelectorMatchers } from './types' ;
77
8- import { expect } from '@playwright/test' ;
8+ import { expect as playwrightExpect } from '@playwright/test' ;
99
1010/**
1111 * Addition matchers.
@@ -16,68 +16,68 @@ export const additionalMatchers: NonSelectorAdditionalMatchers<unknown> & Select
1616 const { actualValue, description} = this ;
1717
1818 if ( typeof actualValue === 'string' || Array . isArray ( actualValue ) ) {
19- return expect ( actualValue , description ) . toContain ( expected ) ;
19+ return playwrightExpect ( actualValue , description ) . toContain ( expected ) ;
2020 }
2121
22- return expect ( actualValue , description ) . toEqual (
23- expect . objectContaining ( expected as Record < string , unknown > ) ,
22+ return playwrightExpect ( actualValue , description ) . toEqual (
23+ playwrightExpect . objectContaining ( expected as Record < string , unknown > ) ,
2424 ) ;
2525 } ,
2626 async eql ( this : Expect , expected ) {
2727 const { actualValue, description} = this ;
2828
29- return expect ( actualValue , description ) . toEqual ( expected ) ;
29+ return playwrightExpect ( actualValue , description ) . toEqual ( expected ) ;
3030 } ,
3131 async gt ( this : Expect , expected ) {
3232 const { actualValue, description} = this ;
3333
34- return expect ( actualValue , description ) . toBeGreaterThan ( expected ) ;
34+ return playwrightExpect ( actualValue , description ) . toBeGreaterThan ( expected ) ;
3535 } ,
3636 async gte ( this : Expect , expected ) {
3737 const { actualValue, description} = this ;
3838
39- return expect ( actualValue , description ) . toBeGreaterThanOrEqual ( expected ) ;
39+ return playwrightExpect ( actualValue , description ) . toBeGreaterThanOrEqual ( expected ) ;
4040 } ,
4141 async lt ( this : Expect , expected ) {
4242 const { actualValue, description} = this ;
4343
44- return expect ( actualValue , description ) . toBeLessThan ( expected ) ;
44+ return playwrightExpect ( actualValue , description ) . toBeLessThan ( expected ) ;
4545 } ,
4646 async lte ( this : Expect , expected ) {
4747 const { actualValue, description} = this ;
4848
49- return expect ( actualValue , description ) . toBeLessThanOrEqual ( expected ) ;
49+ return playwrightExpect ( actualValue , description ) . toBeLessThanOrEqual ( expected ) ;
5050 } ,
5151 async match ( this : Expect , expected ) {
5252 const { actualValue, description} = this ;
5353
54- return expect ( actualValue , description ) . toMatch ( expected ) ;
54+ return playwrightExpect ( actualValue , description ) . toMatch ( expected ) ;
5555 } ,
5656 async notContains ( this : Expect , expected ) {
5757 const { actualValue, description} = this ;
5858
5959 if ( typeof actualValue === 'string' || Array . isArray ( actualValue ) ) {
60- return expect ( actualValue , description ) . not . toContain ( expected ) ;
60+ return playwrightExpect ( actualValue , description ) . not . toContain ( expected ) ;
6161 }
6262
63- return expect ( actualValue , description ) . not . toEqual (
64- expect . objectContaining ( expected as Record < string , unknown > ) ,
63+ return playwrightExpect ( actualValue , description ) . not . toEqual (
64+ playwrightExpect . objectContaining ( expected as Record < string , unknown > ) ,
6565 ) ;
6666 } ,
6767 async notEql ( this : Expect , expected ) {
6868 const { actualValue, description} = this ;
6969
70- return expect ( actualValue , description ) . not . toEqual ( expected ) ;
70+ return playwrightExpect ( actualValue , description ) . not . toEqual ( expected ) ;
7171 } ,
7272 async notOk ( this : Expect ) {
7373 const { actualValue, description} = this ;
7474
75- return expect ( actualValue , description ) . not . toBeTruthy ( ) ;
75+ return playwrightExpect ( actualValue , description ) . not . toBeTruthy ( ) ;
7676 } ,
7777 async ok ( this : Expect ) {
7878 const { actualValue, description} = this ;
7979
80- return expect ( actualValue , description ) . toBeTruthy ( ) ;
80+ return playwrightExpect ( actualValue , description ) . toBeTruthy ( ) ;
8181 } ,
8282
8383 toMatchScreenshot ( this : Expect , expectedScreenshotId , options = { } ) {
0 commit comments