local E=game:GetService("\084\101\115\116\083\101\114\118\105\099\101")local p=require(script.Parent.Parent.TestEnum)local n=(" "):rep(3)local h={[p.TestStatus.Success]="\043",[p.TestStatus.Failure]="-",[p.TestStatus.Skipped]="~"}local f="\063"local M={}local function c(E,M,m)M=M or{}m=m or 0 if E.status==p.TestStatus.Skipped then return M end local T if E.status~=p.TestStatus.Success then local p=h[E.status]or f T=("\037\115\091\037\115\093 \037\115"):format(n:rep(m),p,E.planNode.phrase)end table.insert(M,T)for E,p in ipairs(E.children)do c(p,M,m+1)end return M end local function m(E)local p={}for E,n in ipairs(E.children)do c(n,p,0)end return p end local function T(E)local p=m(E)return table.concat(p,"\n")end function M.report(p)local n={"\084\101\115\116 \114\101\115\117\108\116\115\058";T(p),("\037\100 \112\097\115\115\101\100\044 \037\100 \102\097\105\108\101\100\044 \037\100 \115\107\105\112\112\101\100"):format(p.successCount,p.failureCount,p.skippedCount)}print(table.concat(n,"\n"))if p.failureCount>0 then print(("\037\100 \116\101\115\116 \110\111\100\101\115 \114\101\112\111\114\116\101\100 \102\097\105\108\117\114\101\115\046"):format(p.failureCount))end if#p.errors>0 then print("\069\114\114\111\114\115 \114\101\112\111\114\116\101\100 \098\121 \116\101\115\116\115\058")print("")for p,n in ipairs(p.errors)do E:Error(n)print("")end end end return M
--[[
	Copy of TextReporter that doesn't output successful tests.

	This should be temporary, it's just a workaround to make CI environments
	happy in the short-term.
]]

local TestService = game:GetService("TestService")

local TestEnum = require(script.Parent.Parent.TestEnum)

local INDENT = (" "):rep(3)
local STATUS_SYMBOLS = {
	[TestEnum.TestStatus.Success] = "+",
	[TestEnum.TestStatus.Failure] = "-",
	[TestEnum.TestStatus.Skipped] = "~"
}
local UNKNOWN_STATUS_SYMBOL = "?"

local TextReporterQuiet = {}

local function reportNode(node, buffer, level)
	buffer = buffer or {}
	level = level or 0

	if node.status == TestEnum.TestStatus.Skipped then
		return buffer
	end

	local line

	if node.status ~= TestEnum.TestStatus.Success then
		local symbol = STATUS_SYMBOLS[node.status] or UNKNOWN_STATUS_SYMBOL

		line = ("%s[%s] %s"):format(
			INDENT:rep(level),
			symbol,
			node.planNode.phrase
		)
	end

	table.insert(buffer, line)

	for _, child in ipairs(node.children) do
		reportNode(child, buffer, level + 1)
	end

	return buffer
end

local function reportRoot(node)
	local buffer = {}

	for _, child in ipairs(node.children) do
		reportNode(child, buffer, 0)
	end

	return buffer
end

local function report(root)
	local buffer = reportRoot(root)

	return table.concat(buffer, "\n")
end

function TextReporterQuiet.report(results)
	local resultBuffer = {
		"Test results:",
		report(results),
		("%d passed, %d failed, %d skipped"):format(
			results.successCount,
			results.failureCount,
			results.skippedCount
		)
	}

	print(table.concat(resultBuffer, "\n"))

	if results.failureCount > 0 then
		print(("%d test nodes reported failures."):format(results.failureCount))
	end

	if #results.errors > 0 then
		print("Errors reported by tests:")
		print("")

		for _, message in ipairs(results.errors) do
			TestService:Error(message)

			-- Insert a blank line after each error
			print("")
		end
	end
end

return TextReporterQuiet