add TSamFile and TSamAll command with default keymaps

This commit is contained in:
2025-12-23 23:35:40 +01:00
parent 463d0ae2f7
commit 61f9a7dcb4
8 changed files with 281 additions and 41 deletions

View File

@@ -3,14 +3,34 @@ if vim.g.loaded_test_samurai_plugin == 1 then
end
vim.g.loaded_test_samurai_plugin = 1
vim.api.nvim_create_user_command("TestNearest", function()
vim.api.nvim_create_user_command("TSamNearest", function()
require("test-samurai").test_nearest()
end, { desc = "test-samurai: run nearest test" })
vim.api.nvim_create_user_command("TsShowOutput", function()
vim.api.nvim_create_user_command("TSamShowOutput", function()
require("test-samurai").show_output()
end, { desc = "test-samurai: show last test output" })
vim.api.nvim_create_user_command("TSamFile", function()
require("test-samurai").test_file()
end, { desc = "test-samurai: run all tests in current file" })
vim.api.nvim_create_user_command("TSamAll", function()
require("test-samurai").test_all()
end, { desc = "test-samurai: run all tests in project (per runner)" })
vim.keymap.set("n", "<leader>tn", function()
require("test-samurai").test_nearest()
end, { desc = "test-samurai: run nearest test" })
vim.keymap.set("n", "<leader>to", function()
require("test-samurai").show_output()
end, { desc = "test-samurai: show last test output" })
vim.keymap.set("n", "<leader>tf", function()
require("test-samurai").test_file()
end, { desc = "test-samurai: run all tests in current file" })
vim.keymap.set("n", "<leader>ta", function()
require("test-samurai").test_all()
end, { desc = "test-samurai: run all tests in project (per runner)" })