Skip to content

Commit

Permalink
feat(summary): jump to failures
Browse files Browse the repository at this point in the history
See #57
  • Loading branch information
rcarriga committed Aug 28, 2022
1 parent 6930256 commit d51a9fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions doc/neotest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ Default values:
expand_all = "e",
jumpto = "i",
mark = "m",
next_failed = "J",
output = "o",
prev_failed = "K",
run = "r",
run_marked = "R",
short = "O",
Expand Down
2 changes: 2 additions & 0 deletions lua/neotest/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ local default_config = {
clear_marked = "M",
target = "t",
clear_target = "T",
next_failed = "J",
prev_failed = "K",
},
},
output = {
Expand Down
11 changes: 6 additions & 5 deletions lua/neotest/consumers/output.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,12 @@ local init = function()
return
end
for _, pos in positions:iter() do
if pos.type == "test"
and results[pos.id]
and results[pos.id].status == "failed"
and pos.range[1] <= line
and pos.range[3] >= line
if
pos.type == "test"
and results[pos.id]
and results[pos.id].status == "failed"
and pos.range[1] <= line
and pos.range[3] >= line
then
open_output(
results[pos.id],
Expand Down
1 change: 1 addition & 0 deletions lua/neotest/consumers/summary/component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local config = require("neotest.config")
local icons = config.icons
local hi = config.highlights
local lib = require("neotest.lib")
local namespace = require("neotest.consumers.summary.canvas").namespace

---@class SummaryComponent
---@field client neotest.InternalClient
Expand Down

0 comments on commit d51a9fd

Please sign in to comment.