return function()local I=require(script.Parent.createElement)local X=require(script.Parent.NoopRenderer)local Z=require(script.Parent.createReconciler)local d=require(script.Parent.PureComponent)local v=Z(X)it("\115\104\111\117\108\100 \098\101 \101\120\116\101\110\100\097\098\108\101",function()local I=d:extend("\077\121\067\111\109\112\111\110\101\110\116");(expect(I)).to.be.ok()end)it("\115\104\111\117\108\100 \115\107\105\112 \117\112\100\097\116\101\115 \102\111\114 \115\104\097\108\108\111\119-\101\113\117\097\108 \112\114\111\112\115",function()local X=0 local Z local l=d:extend("\080\117\114\101\067\104\105\108\100")function l.willUpdate(I)X=X+1 end function l.render(I)return nil end local j=d:extend("\080\117\114\101\067\111\110\116\097\105\110\101\114")function j.init(I)I.state={value=0}end function j.didMount(I)Z=function(X)I:setState({value=X})end end function j.render(X)return I(l,{value=X.state.value})end local z=I(j)local U=v.mountVirtualTree(z,nil,"\080\117\114\101\067\111\109\112\111\110\101\110\116 \084\114\101\101");(expect(X)).to.equal(0)Z(1);(expect(X)).to.equal(1)Z(1);(expect(X)).to.equal(1)Z(2);(expect(X)).to.equal(2)Z(1);(expect(X)).to.equal(3)v.unmountVirtualTree(U)end)end
return function()
	local createElement = require(script.Parent.createElement)
	local NoopRenderer = require(script.Parent.NoopRenderer)
	local createReconciler = require(script.Parent.createReconciler)

	local PureComponent = require(script.Parent.PureComponent)

	local noopReconciler = createReconciler(NoopRenderer)

	it("should be extendable", function()
		local MyComponent = PureComponent:extend("MyComponent")

		expect(MyComponent).to.be.ok()
	end)

	it("should skip updates for shallow-equal props", function()
		local updateCount = 0
		local setValue

		local PureChild = PureComponent:extend("PureChild")

		function PureChild:willUpdate()
			updateCount = updateCount + 1
		end

		function PureChild:render()
			return nil
		end

		local PureContainer = PureComponent:extend("PureContainer")

		function PureContainer:init()
			self.state = {
				value = 0,
			}
		end

		function PureContainer:didMount()
			setValue = function(value)
				self:setState({
					value = value,
				})
			end
		end

		function PureContainer:render()
			return createElement(PureChild, {
				value = self.state.value,
			})
		end

		local element = createElement(PureContainer)
		local tree = noopReconciler.mountVirtualTree(element, nil, "PureComponent Tree")

		expect(updateCount).to.equal(0)

		setValue(1)

		expect(updateCount).to.equal(1)

		setValue(1)

		expect(updateCount).to.equal(1)

		setValue(2)

		expect(updateCount).to.equal(2)

		setValue(1)

		expect(updateCount).to.equal(3)

		noopReconciler.unmountVirtualTree(tree)
	end)
end
