init.lua/lua/configs/neotest.lua(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
--# selene: allow(multiple_statements)
local neotest = require "neotest"
local map = require("core.utils").map
neotest.setup {
adapters = {
require "neotest-go" { experimental = { test_table = true } },
require "neotest-jest",
require "neotest-plenary",
},
icons = {
expanded = "",
child_prefix = "",
child_indent = "",
final_child_prefix = "",
non_collapsible = "",
collapsed = "",
passed = "",
running = "",
failed = "",
unknown = "",
},
summary = {
mappings = {
expand = { "l", "h", "<CR>" },
stop = "s",
},
},
}
-- stylua: ignore start
map("n", "<leader>tn", neotest.run.run)
map("n", "<leader>ts", neotest.summary.toggle)
map("n", "<leader>ta", neotest.run.attach)
map("n", "<leader>tS", neotest.run.stop)
map("n", "<leader>to", neotest.output.open)
map("n", "]t", neotest.jump.next)
map("n", "[t", neotest.jump.prev)
map("n", "]T", function() neotest.jump.next { status = "failed" } end)
map("n", "[T", function() neotest.jump.prev { status = "failed" } end)
map("n", "<leader>td", function() neotest.run.run { strategy = "dap" } end)
map("n", "<leader>tt", function()
neotest.run.run(vim.fn.expand "%") ---@diagnostic disable-line: missing-parameter
end)
-- stylua: ignore end
|