return function()local u=require(script.Parent.Parent.Store)local q=require(script.Parent)it("\115\104\111\117\108\100 \098\101 \097 \116\097\098\108\101",function()(expect(q)).to.be.a("\116\097\098\108\101")end)it("\115\104\111\117\108\100 \110\111\116 \099\111\110\116\097\105\110 \097 \109\101\116\097\116\097\098\108\101",function()(expect(getmetatable(q))).to.equal(nil)end)it("\115\104\111\117\108\100 \112\114\105\110\116 \119\104\101\110\101\118\101\114 \097\110 \097\099\116\105\111\110 \105\115 \100\105\115\112\097\116\099\104\101\100",function()local l=0 local r local function P(u,q)return u end local y=u.new(P,{fooValue=12345;barValue={bazValue="\104\105\066\097\122"}},{q.middleware})q.outputFunction=function(u)l+=1 r=u end y:dispatch({type="\116\101\115\116\065\099\116\105\111\110\084\121\112\101"});(expect(l)).to.equal(1);(expect(r:find("\116\101\115\116\065\099\116\105\111\110\084\121\112\101"))).to.be.ok();(expect(r:find("\102\111\111\086\097\108\117\101"))).to.be.ok();(expect(r:find("\049\050\051\052\053"))).to.be.ok();(expect(r:find("\098\097\114\086\097\108\117\101"))).to.be.ok();(expect(r:find("\098\097\122\086\097\108\117\101"))).to.be.ok();(expect(r:find("\104\105\066\097\122"))).to.be.ok()q.outputFunction=print end)end
return function()
	local Store = require(script.Parent.Parent.Store)

	local loggerMiddleware = require(script.Parent)

	it("should be a table", function()
		expect(loggerMiddleware).to.be.a("table")
	end)

	it("should not contain a metatable", function()
		expect(getmetatable(loggerMiddleware)).to.equal(nil)
	end)

	it("should print whenever an action is dispatched", function()
		local outputCount = 0
		local outputMessage

		local function reducer(state, action)
			return state
		end

		local store = Store.new(reducer, {
			fooValue = 12345,
			barValue = {
				bazValue = "hiBaz",
			},
		}, {
			loggerMiddleware.middleware,
		})

		loggerMiddleware.outputFunction = function(message)
			outputCount += 1
			outputMessage = message
		end

		store:dispatch({
			type = "testActionType",
		})

		expect(outputCount).to.equal(1)
		expect(outputMessage:find("testActionType")).to.be.ok()
		expect(outputMessage:find("fooValue")).to.be.ok()
		expect(outputMessage:find("12345")).to.be.ok()
		expect(outputMessage:find("barValue")).to.be.ok()
		expect(outputMessage:find("bazValue")).to.be.ok()
		expect(outputMessage:find("hiBaz")).to.be.ok()

		loggerMiddleware.outputFunction = print
	end)
end
