diff --git a/spec/scraper/module_doc_spec.tl b/spec/scraper/module_doc_spec.tl index 4d07db1..f8f691f 100644 --- a/spec/scraper/module_doc_spec.tl +++ b/spec/scraper/module_doc_spec.tl @@ -231,6 +231,71 @@ describe("Scrap documentation", function() }) end) + it("should provide a Function node with the `self` as the first positional parameter", function() + local ast = get_doc_from_page([[ +

Object methods

+
+
+ 🔗 + :swap (tag2) + + +
+
+

Parameters:

+ + + + + + + + + + + + + + + +
NameType(s)Description
tag2 + tag + The second tag
+
+
+ ]], "awful.tag") + assert.same(ast, { + children = { + { + children = {}, + name = "Signal", + token = "enum", + }, + { + parameters = { + { + types = { "Tag" }, + name = "self", + token = "variable", + }, + { + types = { "tag" }, -- This needs to be fixed : tag -> Tag + name = "tag2", + token = "variable", + } + }, + return_types = {}, + name = "swap", + token = "function", + }, + }, + name = "Tag", + token = "module", + }) + end) + it("should produce Signal nodes", function() local ast = get_doc_from_page([[

Signals