Skip to content

Commit

Permalink
feat(neotest): add default mappings to neotest
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jan 19, 2024
1 parent aff3ef2 commit a808e3d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion lua/astrocommunity/test/neotest/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
local prefix = "<Leader>T"
return {
{
"nvim-neotest/neotest",
ft = { "go", "rust", "python" },
lazy = true,
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
[prefix] = { desc = "󰗇 Tests" },
[prefix .. "t"] = { function() require("neotest").run.run() end, desc = "Run test" },
[prefix .. "d"] = { function() require("neotest").run.run { strategy = "dap" } end, desc = "Debug test" },
[prefix .. "f"] = {
function() require("neotest").run.run(vim.fn.expand "%") end,
desc = "Run all tests in file",
},
[prefix .. "p"] = {
function() require("neotest").run.run(vim.fn.getcwd()) end,
desc = "Run all tests in project",
},
[prefix .. "<CR>"] = { function() require("neotest").summary.toggle() end, desc = "Test Summary" },
[prefix .. "o"] = { function() require("neotest").output.open() end, desc = "Output hover" },
[prefix .. "O"] = { function() require("neotest").output_panel.toggle() end, desc = "Output window" },
["]T"] = { function() require("neotest").jump.next() end, desc = "Next test" },
["[T"] = { function() require("neotest").jump.prev() end, desc = "previous test" },
},
},
},
},
{
"folke/neodev.nvim",
opts = function(_, opts)
Expand Down

0 comments on commit a808e3d

Please sign in to comment.