Skip to content

Commit

Permalink
fix: node.matches is not a function (#216)
Browse files Browse the repository at this point in the history
* Fix node.matches is not a function

* Simplify return clause
  • Loading branch information
valscion authored and Kent C. Dodds committed Feb 15, 2019
1 parent 2cda6a7 commit 4c17512
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function queryAllByText(
if (typeof container.matches === 'function' && container.matches(selector)) {
baseArray = [container]
}
return Array.from([...baseArray, ...container.querySelectorAll(selector)])
return [...baseArray, ...Array.from(container.querySelectorAll(selector))]
.filter(node => !ignore || !node.matches(ignore))
.filter(node => matcher(getNodeText(node), node, text, matchNormalizer))
}
Expand Down

0 comments on commit 4c17512

Please sign in to comment.