diff options
Diffstat (limited to 'test/js')
-rw-r--r-- | test/js/workerd/html-rewriter.test.js | 15 |
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(); + }); }); |