Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 000ded2

Browse files
committed
fix: don't throw when queryBy methods return null
1 parent 0b9e3a7 commit 000ded2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/fixture/locator.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ const engine: () => SelectorEngine = () => ({
7474
// @ts-expect-error
7575
const result = testingLibrary[queryName](root, ...args)
7676

77-
if (!result)
78-
throw new Error(
79-
`PlaywrightTestingLibrary: '${queryName}' was used to create this Locator and the query returned \`null\``,
80-
)
77+
if (!result) return []
8178

8279
return Array.isArray(result) ? result : [result]
8380
},

0 commit comments

Comments
 (0)