return function()local O=require(script.Parent.Parent.Roact)local H=require(script.Parent.Parent.Rodux)local p=require(script.Parent.StoreProvider)local g=require(script.Parent.getStore)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\104\101 \115\116\111\114\101 \119\104\101\110 \112\114\101\115\101\110\116",function()local function t()return 0 end local Q=H.Store.new(t)local N=nil local l=O.Component:extend("\083\116\111\114\101\067\111\110\115\117\109\101\114")function l.init(O)N=g(O)end function l.render(O)return nil end local s=O.createElement(p,{store=Q},{Consumer=O.createElement(l)})local P=O.mount(s);(expect(N)).to.equal(Q)O.unmount(P)Q:destruct()end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \110\105\108 \119\104\101\110 \116\104\101 \115\116\111\114\101 \105\115 \110\111\116 \112\114\101\115\101\110\116",function()local H=6 local p=O.Component:extend("\083\116\111\114\101\067\111\110\115\117\109\101\114")function p.init(O)H=g(O)end function p.render(O)return nil end local t=O.createElement(p)local Q=O.mount(t);(expect(H)).to.equal(nil)O.unmount(Q)end)end
return function()
	local Roact = require(script.Parent.Parent.Roact)
	local Rodux = require(script.Parent.Parent.Rodux)

	local StoreProvider = require(script.Parent.StoreProvider)

	local getStore = require(script.Parent.getStore)

	it("should return the store when present", function()
		local function reducer()
			return 0
		end

		local store = Rodux.Store.new(reducer)
		local consumedStore = nil

		local StoreConsumer = Roact.Component:extend("StoreConsumer")

		function StoreConsumer:init()
			consumedStore = getStore(self)
		end

		function StoreConsumer:render()
			return nil
		end

		local tree = Roact.createElement(StoreProvider, {
			store = store,
		}, {
			Consumer = Roact.createElement(StoreConsumer),
		})

		local handle = Roact.mount(tree)

		expect(consumedStore).to.equal(store)

		Roact.unmount(handle)
		store:destruct()
	end)

	it("should return nil when the store is not present", function()
		-- Use a non-nil value to know for sure if StoreConsumer:init was called
		local consumedStore = 6

		local StoreConsumer = Roact.Component:extend("StoreConsumer")

		function StoreConsumer:init()
			consumedStore = getStore(self)
		end

		function StoreConsumer:render()
			return nil
		end

		local tree = Roact.createElement(StoreConsumer)
		local handle = Roact.mount(tree)

		expect(consumedStore).to.equal(nil)

		Roact.unmount(handle)
	end)
end