From e02e3aec70d82a536d662c4c34e638bd9e1e6786 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 22 Jun 2022 08:37:16 +0200 Subject: Add neotest --- after/plugin/neotest.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 after/plugin/neotest.lua (limited to 'after/plugin') diff --git a/after/plugin/neotest.lua b/after/plugin/neotest.lua new file mode 100644 index 0000000..d70d5cd --- /dev/null +++ b/after/plugin/neotest.lua @@ -0,0 +1,25 @@ +local ok, neotest = pcall(require, "neotest") +if not ok then + return +end + +neotest.setup({ + adapters = { + require("neotest-go"), + require("neotest-vim-test")({ + ignore_file_types = { "go" }, + }), + }, +}) + +vim.keymap.set("n", "t", function() + neotest.run.run() +end, { silent = true, noremap = true }) + +vim.keymap.set("n", "t", function() + neotest.run.run(vim.fn.expand("%")) +end, { silent = true, noremap = true }) + +vim.keymap.set("n", "t", function() + neotest.summary.toggle() +end, { silent = true, noremap = true }) -- cgit v1.2.3