This commit is contained in:
lx
2026-07-06 14:01:11 -04:00
commit c4f97d729d
16468 changed files with 935321 additions and 0 deletions
@@ -0,0 +1,35 @@
return function()
local createElement = require(script.Parent.createElement)
local oneChild = require(script.Parent.oneChild)
it("should get zero children from a table", function()
local children = {}
expect(oneChild(children)).to.equal(nil)
end)
it("should get exactly one child", function()
local child = createElement("Frame")
local children = {
foo = child,
}
expect(oneChild(children)).to.equal(child)
end)
it("should error with more than one child", function()
local children = {
a = createElement("Frame"),
b = createElement("Frame"),
}
expect(function()
oneChild(children)
end).to.throw()
end)
it("should handle being passed nil", function()
expect(oneChild(nil)).to.equal(nil)
end)
end