23 lines
599 B
Plaintext
23 lines
599 B
Plaintext
|
local assert = require("luassert")
|
||
|
local scraper = require("scraper").module_doc
|
||
|
|
||
|
local get_doc_from_page = scraper.get_doc_from_page
|
||
|
|
||
|
describe("Scrap documentation", function()
|
||
|
it("should return a valid AST for an empty module", function()
|
||
|
local ast <const>, nodes <const> = get_doc_from_page("", "empty")
|
||
|
assert.same(ast, {
|
||
|
children = {
|
||
|
{
|
||
|
children = {},
|
||
|
name = "Signal",
|
||
|
token = "enum",
|
||
|
}
|
||
|
},
|
||
|
name = "Empty",
|
||
|
token = "module",
|
||
|
})
|
||
|
assert.same(nodes, {})
|
||
|
end)
|
||
|
end)
|