feat: setup neotest

This commit is contained in:
Stevan Freeborn
2025-01-21 03:29:50 -06:00
parent ca420cebe3
commit ce7a820333
3 changed files with 64 additions and 1 deletions
+7
View File
@@ -1,4 +1,5 @@
{
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
@@ -12,6 +13,12 @@
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" },
"neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
"neotest-dotnet": { "branch": "main", "commit": "5a2fa35c3c6a72cfd3fc6a28b3d1af6e68e6c3a8" },
"neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" },
"neotest-playwright": { "branch": "master", "commit": "6266945039dac27a354de33d2f2a66e75485d5e9" },
"neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },
"neotest-vitest": { "branch": "main", "commit": "3e338b77700853f725856c37ff5a3cf9295bffae" },
"none-ls.nvim": { "branch": "main", "commit": "af318216b744f2fe2d5afa6febb01f455ae61d6c" },
"nuget.nvim": { "branch": "main", "commit": "ce137d6503e96657d133b48946f8739c8600834b" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
+54
View File
@@ -0,0 +1,54 @@
return {
"nvim-neotest/neotest",
dependencies = {
"antoinemadec/FixCursorHold.nvim",
"nvim-neotest/neotest-python",
"nvim-neotest/neotest-jest",
"marilari88/neotest-vitest",
"thenbe/neotest-playwright",
"issafalcon/neotest-dotnet",
},
config = function()
local neotest = require("neotest")
neotest.setup({
log_level = "debug",
adapters = {
require("neotest-python"),
require("neotest-jest"),
require("neotest-vitest"),
require("neotest-playwright").adapter({
options = {
persist_project_selection = true,
enable_dynamic_test_discovery = true,
preset = "headed",
experimental = {
telescope = {
enable = true,
},
},
},
}),
require("neotest-dotnet")({
discovery_root = "solution",
}),
},
})
vim.keymap.set("n", "<leader>tr", neotest.run.run, { desc = "Run nearest test" })
vim.keymap.set("n", "<leader>ts", neotest.run.stop, { desc = "Stop nearest test" })
vim.keymap.set("n", "<leader>tf", function()
neotest.run.run(vim.fn.expand("%"))
end, { desc = "Run file tests" })
vim.keymap.set("n", "<leader>to", neotest.output.open, { desc = "Display output" })
vim.keymap.set("n", "<leader>top", neotest.output_panel.open, { desc = "Display output panel" })
vim.keymap.set("n", "<leader>topc", neotest.output_panel.clear, { desc = "Clear output" })
vim.keymap.set("n", "<C-t>", neotest.summary.open, { desc = "Display summary" })
vim.keymap.set("n", "<leader>tsr", neotest.summary.run_marked, { desc = "Run marked tests" })
vim.keymap.set("n", "<leader>tsc", neotest.summary.clear_marked, { desc = "Clear marked tests" })
vim.keymap.set("n", "<leader>tw", neotest.watch.watch, { desc = "Start watching tests" })
vim.keymap.set("n", "<leader>twc", neotest.watch.stop, { desc = "Stop watching tests" })
end,
}
+3 -1
View File
@@ -5,7 +5,9 @@ vim.cmd("set shiftwidth=2")
vim.cmd("set number")
vim.cmd("set relativenumber")
vim.cmd("set shell=pwsh")
vim.cmd("let &shellcmdflag = '-NoLogo'")
vim.cmd("set shellcmdflag=-Command")
vim.cmd("set shellquote=")
vim.cmd("set shellxquote=")
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"