-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
At times, I want to test my generated HTML pretty extensively.
LazyHTML already makes it possible, but having some test utility functions would be welcome - either in a dedicated module, or directly in the main LazyHTML module, that I do not know.
The two examples that come to my mind right now would be
- a
matches?(doc, selector)function, that basically corresponds todoc |> LazyHTML.filter(selector) |> Enum.empty?() |> Kernel.not() - a
exists?(doc, selector)function, that simplifiesdoc |> LazyHTML.query(selector) |> Enum.empty?() |> Kernel.not()
--
Now that I see it this way, maybe a LazyHTML.exists?(doc) that just verifies that a query or filter returned an element would be nice 😄
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels