return function()local O=require(script.Parent.Parent.createElement)local H=require(script.Parent.Parent.createReconciler)local p=require(script.Parent.Parent.createSpy)local g=require(script.Parent.Parent.NoopRenderer)local t=require(script.Parent.Parent.Type)local Q=require(script.Parent.Parent.Component)local N=H(g)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 H=Q:extend("\077\121\067\111\109\112\111\110\101\110\116")local g=p()H.willUnmount=g.value function H.render(O)return nil end local l=O(H)local s=nil local P="\084\101\115\116"local k=N.mountVirtualNode(l,s,P)N.unmountVirtualNode(k);(expect(g.callCount)).to.equal(1)local L=g:captureValues("\115\101\108\102");(expect(t.of(L.self))).to.equal(t.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