change output format for TSamAll from short- to fullname

This commit is contained in:
2025-12-27 12:53:45 +01:00
parent a6e51f280f
commit 88aa1de902
3 changed files with 148 additions and 6 deletions

View File

@@ -311,28 +311,31 @@ local function run_cmd(cmd, cwd, handlers)
})
end
local function pick_display(results, key)
local function pick_display(results, key, scope_kind)
if scope_kind == "all" then
return results[key]
end
if type(results.display) == "table" and type(results.display[key]) == "table" then
return results.display[key]
end
return results[key]
end
local function format_results(results)
local function format_results(results, scope_kind)
local lines = {}
local passes = pick_display(results, "passes")
local passes = pick_display(results, "passes", scope_kind)
if type(passes) == "table" then
for _, title in ipairs(passes) do
table.insert(lines, "[ PASS ] - " .. title)
end
end
local skips = pick_display(results, "skips")
local skips = pick_display(results, "skips", scope_kind)
if type(skips) == "table" then
for _, title in ipairs(skips) do
table.insert(lines, "[ SKIP ] - " .. title)
end
end
local failures = pick_display(results, "failures")
local failures = pick_display(results, "failures", scope_kind)
if type(failures) == "table" then
for _, title in ipairs(failures) do
table.insert(lines, "[ FAIL ] - " .. title)
@@ -373,6 +376,7 @@ local function run_command(command, opts)
parser = { on_complete = parser }
end
local parser_state = {}
parser_state.scope_kind = options.scope_kind
local had_parsed_output = false
local output_lines = {}
@@ -413,7 +417,7 @@ local function run_command(command, opts)
state.last_scope_failures = results.failures
end
end
local lines = format_results(results)
local lines = format_results(results, options.scope_kind)
if #lines == 0 then
return
end

View File

@@ -934,6 +934,9 @@ function M.new(opts)
if results then
state.done = true
state.saw_stream = true
if _state and _state.scope_kind == "all" and jest_streamed then
return emit_jest_results(results, false)
end
return emit_jest_results(results, not jest_streamed)
end
return nil