@@ -33,14 +33,15 @@ describe('lib/index.ts', () => {
33
33
expect ( await queries . getNodeText ( element ) ) . toEqual ( 'Hello h1' )
34
34
} )
35
35
36
- it ( 'should keep the default data-testid when input passed is invalid' , async ( ) => {
37
- ; [ { } , undefined , null , { testIdAttribute : '' } ] . forEach ( async options => {
36
+ it . each ( [ { } , undefined , null , { testIdAttribute : '' } ] ) (
37
+ 'should keep the default data-testid when input passed is invalid' ,
38
+ async options => {
38
39
const document = await getDocument ( page )
39
40
configure ( options as any )
40
41
const element = await queries . getByTestId ( document , 'testid-label' )
41
42
expect ( await queries . getNodeText ( element ) ) . toEqual ( 'Label A' )
42
- } )
43
- } )
43
+ } ,
44
+ )
44
45
45
46
it ( 'should support regex on raw queries object' , async ( ) => {
46
47
const scope = await page . $ ( '#scoped' )
@@ -50,6 +51,9 @@ describe('lib/index.ts', () => {
50
51
} )
51
52
52
53
it ( 'should bind getQueriesForElement' , async ( ) => {
54
+ // FIXME: I think it will take some work to get the types in a
55
+ // place to prevent @typescript -eslint from flagging this
56
+ // eslint-disable-next-line @typescript-eslint/unbound-method
53
57
const { getByText} = getQueriesForElement ( await getDocument ( page ) )
54
58
const element = await getByText ( 'Hello h1' )
55
59
expect ( await queries . getNodeText ( element ) ) . toEqual ( 'Hello h1' )
@@ -59,6 +63,9 @@ describe('lib/index.ts', () => {
59
63
beforeEach ( async ( ) => page . goto ( `file://${ path . join ( __dirname , 'fixtures/late-page.html' ) } ` ) )
60
64
61
65
it ( 'should use `wait` properly' , async ( ) => {
66
+ // FIXME: I think it will take some work to get the types in a
67
+ // place to prevent @typescript -eslint from flagging this
68
+ // eslint-disable-next-line @typescript-eslint/unbound-method
62
69
const { getByText} = getQueriesForElement ( await getDocument ( page ) )
63
70
// eslint-disable-next-line @typescript-eslint/no-misused-promises
64
71
await waitFor ( async ( ) => expect ( await getByText ( 'Loaded!' ) ) . toBeTruthy ( ) , { timeout : 7000 } )
0 commit comments