aboutsummaryrefslogtreecommitdiff
path: root/test/js/workerd/html-rewriter.test.js
diff options
context:
space:
mode:
authorGravatar Brúnó Salomon <35275408+bru02@users.noreply.github.com> 2023-06-26 01:48:03 +0200
committerGravatar GitHub <noreply@github.com> 2023-06-25 16:48:03 -0700
commit662335d81aa39dc53b83f2759312ff0ff3a93af2 (patch)
treede4896944d8a92153d317f6d84c93646b928dbd6 /test/js/workerd/html-rewriter.test.js
parentd8817c2d32a237440a7677622ba351aa95f47c22 (diff)
downloadbun-662335d81aa39dc53b83f2759312ff0ff3a93af2.tar.gz
bun-662335d81aa39dc53b83f2759312ff0ff3a93af2.tar.zst
bun-662335d81aa39dc53b83f2759312ff0ff3a93af2.zip
chore: update lol-html version (#3356)
* chore: update lol-html version * add tests --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Diffstat (limited to 'test/js/workerd/html-rewriter.test.js')
-rw-r--r--test/js/workerd/html-rewriter.test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/js/workerd/html-rewriter.test.js b/test/js/workerd/html-rewriter.test.js
index 1ca92a567..b6131a09f 100644
--- a/test/js/workerd/html-rewriter.test.js
+++ b/test/js/workerd/html-rewriter.test.js
@@ -300,4 +300,19 @@ describe("HTMLRewriter", () => {
.text(),
).toEqual("<div></div>");
});
+
+ it("it supports lastInTextNode", async () => {
+ let lastInTextNode;
+
+ await new HTMLRewriter()
+ .on("p", {
+ text(text) {
+ lastInTextNode ??= text.lastInTextNode;
+ },
+ })
+ .transform(new Response("<p>Lorem ipsum!</p>"))
+ .text();
+
+ expect(lastInTextNode).toBeBoolean();
+ });
});