return function()local Y=require(script.Parent.Parent.createElement)local i=require(script.Parent.Parent.createReconciler)local h=require(script.Parent.Parent.createSpy)local x=require(script.Parent.Parent.NoopRenderer)local C=require(script.Parent.Parent.Type)local P=require(script.Parent.Parent.Component)local R=i(x)it("\115\104\111\117\108\100 \098\101 \105\110\118\111\107\101\100 \119\104\101\110 \117\110\109\111\117\110\116\101\100",function()local i=P:extend("\077\121\067\111\109\112\111\110\101\110\116")local x=h()i.willUnmount=x.value function i.render(Y)return nil end local K=Y(i)local A=nil local q="\084\101\115\116"local k=R.mountVirtualNode(K,A,q)R.unmountVirtualNode(k);(expect(x.callCount)).to.equal(1)local H=x:captureValues("\115\101\108\102");(expect(C.of(H.self))).to.equal(C.StatefulComponentInstance)end)end
return function()
	local createElement = require(script.Parent.Parent.createElement)
	local createReconciler = require(script.Parent.Parent.createReconciler)
	local createSpy = require(script.Parent.Parent.createSpy)
	local NoopRenderer = require(script.Parent.Parent.NoopRenderer)
	local Type = require(script.Parent.Parent.Type)

	local Component = require(script.Parent.Parent.Component)

	local noopReconciler = createReconciler(NoopRenderer)

	it("should be invoked when unmounted", function()
		local MyComponent = Component:extend("MyComponent")

		local willUnmountSpy = createSpy()

		MyComponent.willUnmount = willUnmountSpy.value

		function MyComponent:render()
			return nil
		end

		local element = createElement(MyComponent)
		local hostParent = nil
		local key = "Test"

		local node = noopReconciler.mountVirtualNode(element, hostParent, key)
		noopReconciler.unmountVirtualNode(node)

		expect(willUnmountSpy.callCount).to.equal(1)

		local values = willUnmountSpy:captureValues("self")

		expect(Type.of(values.self)).to.equal(Type.StatefulComponentInstance)
	end)
end
