return function()local S=require(script.Parent.combineReducers)it("\115\104\111\117\108\100 \105\110\118\111\107\101 \101\097\099\104 \115\117\098-\114\101\100\117\099\101\114 \102\111\114 \101\118\101\114\121 \097\099\116\105\111\110",function()local l=0 local o=0 local v=S({a=function(S,o)l=l+1 end;b=function(S,l)o=o+1 end})v({},{});(expect(l)).to.equal(1);(expect(o)).to.equal(1)end)it("\115\104\111\117\108\100 \097\115\115\105\103\110 \101\097\099\104 \115\117\098-\114\101\100\117\099\101\114\'\115 \118\097\108\117\101 \116\111 \116\104\101 \110\101\119 \115\116\097\116\101",function()local l=S({a=function(S,l)return(S or 0)+1 end;b=function(S,l)return(S or 0)+3 end})local o=l({},{});(expect(o.a)).to.equal(1);(expect(o.b)).to.equal(3)end)it("\115\104\111\117\108\100 \110\111\116 \116\104\114\111\119 \119\104\101\110 \115\116\097\116\101 \105\115 \110\105\108",function()local l=S({a=function(S,l)return(S or 0)+1 end,b=function(S,l)return(S or 0)+3 end});(expect(function()l(nil,{})end)).to.never.throw()end)end
return function()
	local combineReducers = require(script.Parent.combineReducers)

	it("should invoke each sub-reducer for every action", function()
		local aCount = 0
		local bCount = 0

		local reducer = combineReducers({
			a = function(state, action)
				aCount = aCount + 1
			end,
			b = function(state, action)
				bCount = bCount + 1
			end,
		})

		-- Mock reducer invocation
		reducer({}, {})
		expect(aCount).to.equal(1)
		expect(bCount).to.equal(1)
	end)

	it("should assign each sub-reducer's value to the new state", function()
		local reducer = combineReducers({
			a = function(state, action)
				return (state or 0) + 1
			end,
			b = function(state, action)
				return (state or 0) + 3
			end,
		})

		local newState = reducer({}, {})
		expect(newState.a).to.equal(1)
		expect(newState.b).to.equal(3)
	end)

	it("should not throw when state is nil", function()
		local reducer = combineReducers({
			a = function(state, action)
				return (state or 0) + 1
			end,
			b = function(state, action)
				return (state or 0) + 3
			end,
		})

		expect(function()
			reducer(nil, {})
		end).to.never.throw()
	end)
end
