add TSamFile and TSamAll command with default keymaps
This commit is contained in:
@@ -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)" })
|
||||
|
||||
Reference in New Issue
Block a user