return function()
local createElement = require(script.Parent.createElement)
local createReconciler = require(script.Parent.createReconciler)
local Logging = require(script.Parent.Logging)
local NoopRenderer = require(script.Parent.NoopRenderer)
local createReconcilerCompat = require(script.Parent.createReconcilerCompat)
local noopReconciler = createReconciler(NoopRenderer)
local compatReconciler = createReconcilerCompat(noopReconciler)
it("reify should only warn once per call site", function()
local logInfo = Logging.capture(function()
for _ = 1, 2 do
local handle = compatReconciler.reify(createElement("StringValue"))
noopReconciler.unmountVirtualTree(handle)
end
end)
expect(#logInfo.warnings).to.equal(1)
expect(logInfo.warnings[1]:find("reify")).to.be.ok()
logInfo = Logging.capture(function()
local handle = compatReconciler.reify(createElement("StringValue"))
noopReconciler.unmountVirtualTree(handle)
end)
expect(#logInfo.warnings).to.equal(1)
expect(logInfo.warnings[1]:find("reify")).to.be.ok()
end)
it("teardown should only warn once per call site", function()
local logInfo = Logging.capture(function()
for _ = 1, 2 do
local handle = noopReconciler.mountVirtualTree(createElement("StringValue"))
compatReconciler.teardown(handle)
end
end)
expect(#logInfo.warnings).to.equal(1)
expect(logInfo.warnings[1]:find("teardown")).to.be.ok()
logInfo = Logging.capture(function()
local handle = noopReconciler.mountVirtualTree(createElement("StringValue"))
compatReconciler.teardown(handle)
end)
expect(#logInfo.warnings).to.equal(1)
expect(logInfo.warnings[1]:find("teardown")).to.be.ok()
end)
it("update should only warn once per call site", function()
local logInfo = Logging.capture(function()
for _ = 1, 2 do
local handle = noopReconciler.mountVirtualTree(createElement("StringValue"))
compatReconciler.reconcile(handle, createElement("StringValue"))
noopReconciler.unmountVirtualTree(handle)
end
end)
expect(#logInfo.warnings).to.equal(1)
expect(logInfo.warnings[1]:find("reconcile")).to.be.ok()
logInfo = Logging.capture(function()
local handle = noopReconciler.mountVirtualTree(createElement("StringValue"))
compatReconciler.reconcile(handle, createElement("StringValue"))
noopReconciler.unmountVirtualTree(handle)
end)
expect(#logInfo.warnings).to.equal(1)
expect(logInfo.warnings[1]:find("reconcile")).to.be.ok()
end)
end