local U=require(script.Parent.Parent.TestEZ)local F={report=function() end}return{["\114\117\110 \101\120\112\101\099\116-\101\120\116\101\110\100 \101\050\101"]=function()U.run(script:FindFirstChild("\101\120\112\101\099\116-\101\120\116\101\110\100"),function(U)assert(#U.errors==0,"\069\120\112\101\099\116\101\100 \110\111 \101\114\114\111\114\115\044 \103\111\116 "..(tostring(U.errors[1])..(" \112\108\117\115 "..(tostring(#U.errors-1).." \109\111\114\101\046"))))end)end,["\114\117\110 \097\102\116\101\114\069\097\099\104 \101\050\101 \119\105\116\104 \101\114\114\111\114 \105\110 \105\116 \098\108\111\099\107"]=function()U.run((script:FindFirstChild("\097\102\116\101\114\069\097\099\104\065\102\116\101\114\070\097\105\108\117\114\101")):FindFirstChild("\101\114\114\111\114\073\110\073\116\066\108\111\099\107"),function(U)assert(#U.errors==1,"\069\120\112\101\099\116\101\100 \111\110\101 \101\114\114\111\114\044 \103\111\116 "..tostring(#U.errors))local F=string.find(U.errors[1],"\097\102\116\101\114\069\097\099\104 \116\104\114\101\119 \097\110 \101\114\114\111\114 \097\115 \101\120\112\101\099\116\101\100")assert(F~=nil,"\069\120\112\101\099\116\101\100 \097\102\116\101\114\069\097\099\104 \116\111 \098\101 \114\101\097\099\104\101\100 \097\102\116\101\114 \105\116 \116\104\114\111\119\115 \097\110 \101\114\114\111\114")local k=string.find(U.errors[1],"\087\104\105\108\101 \099\108\101\097\110\105\110\103 \117\112 \116\104\101 \102\097\105\108\101\100 \116\101\115\116 \097\110\111\116\104\101\114 \101\114\114\111\114 \119\097\115 \102\111\117\110\100")assert(k~=nil,"\069\120\112\101\099\116\101\100 \'\087\104\105\108\101 \099\108\101\097\110\105\110\103 \117\112\046\046\046\' \109\115\103 \116\111 \098\101 \115\104\111\119\110 \119\104\101\110 \097\102\116\101\114\069\097\099\104 \102\097\105\108\115 \097\102\116\101\114 \105\116 \102\097\105\108\115")end)end;["\114\117\110 \097\102\116\101\114\069\097\099\104 \101\050\101 \119\105\116\104 \102\097\105\108\117\114\101 \105\110 \105\116 \098\108\111\099\107"]=function()U.run((script:FindFirstChild("\097\102\116\101\114\069\097\099\104\065\102\116\101\114\070\097\105\108\117\114\101")):FindFirstChild("\102\097\105\108\117\114\101\073\110\073\116\066\108\111\099\107"),function(U)assert(#U.errors==1,"\069\120\112\101\099\116\101\100 \111\110\101 \101\114\114\111\114\044 \103\111\116 "..tostring(#U.errors))local F=string.find(U.errors[1],"\097\102\116\101\114\069\097\099\104 \116\104\114\101\119 \097\110 \101\114\114\111\114 \097\115 \101\120\112\101\099\116\101\100")assert(F~=nil,"\069\120\112\101\099\116\101\100 \097\102\116\101\114\069\097\099\104 \116\111 \098\101 \114\101\097\099\104\101\100 \097\102\116\101\114 \105\116 \116\104\114\111\119\115 \097\110 \101\114\114\111\114")local k=string.find(U.errors[1],"\087\104\105\108\101 \099\108\101\097\110\105\110\103 \117\112 \116\104\101 \102\097\105\108\101\100 \116\101\115\116 \097\110\111\116\104\101\114 \101\114\114\111\114 \119\097\115 \102\111\117\110\100")assert(k~=nil,"\069\120\112\101\099\116\101\100 \'\087\104\105\108\101 \099\108\101\097\110\105\110\103 \117\112\046\046\046\' \109\115\103 \116\111 \098\101 \115\104\111\119\110 \119\104\101\110 \097\102\116\101\114\069\097\099\104 \102\097\105\108\115 \097\102\116\101\114 \105\116 \102\097\105\108\115")end)end,["\114\117\110 \097\102\116\101\114\069\097\099\104 \101\050\101 \119\105\116\104 \102\097\105\108\117\114\101 \105\110 \097\102\116\101\114\069\097\099\104 \098\108\111\099\107"]=function()U.run((script:FindFirstChild("\097\102\116\101\114\069\097\099\104\065\102\116\101\114\070\097\105\108\117\114\101")):FindFirstChild("\101\114\114\111\114\073\110\065\102\116\101\114\069\097\099\104\066\108\111\099\107"),function(U)assert(#U.errors==1,"\069\120\112\101\099\116\101\100 \111\110\101 \101\114\114\111\114\044 \103\111\116 "..tostring(#U.errors))local F=string.find(U.errors[1],"\097\102\116\101\114\069\097\099\104 \116\104\114\101\119 \097\110 \101\114\114\111\114 \097\115 \101\120\112\101\099\116\101\100")assert(F~=nil,"\069\120\112\101\099\116\101\100 \097\102\116\101\114\069\097\099\104 \116\111 \098\101 \114\101\097\099\104\101\100 \097\102\116\101\114 \105\116 \116\104\114\111\119\115 \097\110 \101\114\114\111\114")local k=string.find(U.errors[1],"\087\104\105\108\101 \099\108\101\097\110\105\110\103 \117\112 \116\104\101 \102\097\105\108\101\100 \116\101\115\116 \097\110\111\116\104\101\114 \101\114\114\111\114 \119\097\115 \102\111\117\110\100")assert(k==nil,"\069\120\112\101\099\116\101\100 \'\087\104\105\108\101 \099\108\101\097\110\105\110\103 \117\112\046\046\046\' \109\115\103 \116\111 \110\111\116 \098\101 \115\104\111\119\110 \119\104\101\110 \111\110\108\121 \097\102\116\101\114\069\097\099\104 \102\097\105\108\115")end)end,["\114\117\110 \108\105\102\101\099\121\099\108\101 \101\050\101 \119\047 \102\105\108\116\101\114 \102\111\114 \100\101\115\099\114\105\098\101 \098\108\111\099\107"]=function()U.TestBootstrap:run({(script:FindFirstChild("\108\105\102\101\099\121\099\108\101")):FindFirstChild("\116\101\115\116\078\097\109\101\070\105\108\116\101\114\068\101\115\099\114\105\098\101\066\108\111\099\107")},F,{testNamePattern="\115\117\112\101\114 \115\112\101\099\105\102\105\099 \100\101\115\099\114\105\098\101 \098\108\111\099\107"})end;["\114\117\110 \108\105\102\101\099\121\099\108\101 \101\050\101 \119\047 \102\105\108\116\101\114 \102\111\114 \102\105\108\101 \110\097\109\101"]=function()U.TestBootstrap:run({(script:FindFirstChild("\108\105\102\101\099\121\099\108\101")):FindFirstChild("\116\101\115\116\078\097\109\101\070\105\108\116\101\114\070\105\108\101\078\097\109\101")},F,{testNamePattern="\115\112\101\099\105\102\105\099\070\105\108\101\078\097\109\101"})end}
local TestEZ = require(script.Parent.Parent.TestEZ)

local noOptReporter = {
	report = function()
	end,
}

return {
	["run expect-extend e2e"] = function()
		TestEZ.run(script:FindFirstChild("expect-extend"), function(results)
			assert(#results.errors == 0,
				"Expected no errors, got " .. tostring(results.errors[1]) ..
				" plus " .. tostring(#results.errors - 1) .. " more.")
		end)
	end,

	["run afterEach e2e with error in it block"] = function()
		TestEZ.run(script:FindFirstChild("afterEachAfterFailure"):FindFirstChild("errorInItBlock"), function(results)
			assert(#results.errors == 1, "Expected one error, got " .. tostring(#results.errors))

			local afterEachError = string.find(results.errors[1], "afterEach threw an error as expected")
			assert(afterEachError ~= nil, "Expected afterEach to be reached after it throws an error")

			local cleaningUpError = string.find(results.errors[1], "While cleaning up the failed test another error was found")
			assert(cleaningUpError ~= nil, "Expected 'While cleaning up...' msg to be shown when afterEach fails after it fails")
		end)
	end,

	["run afterEach e2e with failure in it block"] = function()
		TestEZ.run(script:FindFirstChild("afterEachAfterFailure"):FindFirstChild("failureInItBlock"), function(results)
			assert(#results.errors == 1, "Expected one error, got " .. tostring(#results.errors))

			local afterEachError = string.find(results.errors[1], "afterEach threw an error as expected")
			assert(afterEachError ~= nil, "Expected afterEach to be reached after it throws an error")

			local cleaningUpError = string.find(results.errors[1], "While cleaning up the failed test another error was found")
			assert(cleaningUpError ~= nil, "Expected 'While cleaning up...' msg to be shown when afterEach fails after it fails")
		end)
	end,

	["run afterEach e2e with failure in afterEach block"] = function()
		TestEZ.run(script:FindFirstChild("afterEachAfterFailure"):FindFirstChild("errorInAfterEachBlock"), function(results)
			assert(#results.errors == 1, "Expected one error, got " .. tostring(#results.errors))

			local afterEachError = string.find(results.errors[1], "afterEach threw an error as expected")
			assert(afterEachError ~= nil, "Expected afterEach to be reached after it throws an error")

			local cleaningUpError = string.find(results.errors[1], "While cleaning up the failed test another error was found")
			assert(cleaningUpError == nil, "Expected 'While cleaning up...' msg to not be shown when only afterEach fails")
		end)
	end,

	["run lifecycle e2e w/ filter for describe block"] = function()
		TestEZ.TestBootstrap:run({
			script:FindFirstChild("lifecycle"):FindFirstChild("testNameFilterDescribeBlock"),
		},
		noOptReporter,
		{
			testNamePattern = "super specific describe block",
		})
	end,

	["run lifecycle e2e w/ filter for file name"] = function()
		TestEZ.TestBootstrap:run({
			script:FindFirstChild("lifecycle"):FindFirstChild("testNameFilterFileName"),
		},
		noOptReporter,
		{
			testNamePattern = "specificFileName",
		})
	end,
}
