------------------------------------------------------------------------------- -- - Vim-test and general testing config - ------------------------------------------------------------------------------- local neotest = require("neotest") neotest.setup({ adapters = { require("neotest-rust"), require("neotest-plenary"), require("neotest-vim-test")({ ignore_file_types = { "rust", "lua" }, }), }, }) local last = nil -- Map test running commands local opts = { silent = true } vim.keymap.set("n", "tn", function() last = nil neotest.run.run() end, opts) vim.keymap.set("n", "tdn", function() last = { strategy = "dap", suite = false } neotest.run.run(last) end, opts) vim.keymap.set("n", "tf", function() last = vim.fn.expand("%") neotest.run.run(last) end, opts) vim.keymap.set("n", "tdf", function() last = { vim.fn.expand("%"), strategy = "dap", suite = false } neotest.run.run(last) end, opts) vim.keymap.set("n", "ts", function() last = { suite = true } neotest.run.run(last) end, opts) vim.keymap.set("n", "tds", function() last = { strategy = "dap", suite = true } neotest.run.run(last) end, opts) vim.keymap.set("n", "tl", function() if last then neotest.run.run(last) else neotest.run.run() end end, opts) vim.keymap.set("n", "tp", neotest.output_panel.open, opts)