local a=require(script.Parent.executeTest)return function(E,C)local s=table.create(#C)if#C>0 then table.move(C,1,#C,1,s)else for a,E in pairs(C)do s[a]=E end end C=s C.testDepth+=1 local p=false for a,E in pairs(E)do if E._focus then p=true break end end C.focusedOnly=p C.totalTime=0 local T={}for E,s in pairs(E)do local p=a(s,C)if p then table.insert(T,p)end end return{depth=C.testDepth;results=T,time=C.config.showExecutionTime and C.totalTime}end
local executeTest = require(script.Parent.executeTest)

return function(tests, context)
	local newContext = table.create(#context)
	if #context > 0 then
		table.move(context, 1, #context, 1, newContext)
	else
		for k, v in pairs(context) do
			newContext[k] = v
		end
	end

	context = newContext
	context.testDepth += 1

	local hasFocus = false
	for _, test in pairs(tests) do
		if test._focus then
			hasFocus = true
			break
		end
	end

	context.focusedOnly = hasFocus
	context.totalTime = 0

	local testResults = { }
	for _, test in pairs(tests) do
		local result = executeTest(test, context)

		if result then
			table.insert(testResults, result)
		end
	end

	return {
		depth = context.testDepth;
		results = testResults;
		time = context.config.showExecutionTime and context.totalTime;
	}
end
