diff --git a/lua/astrocommunity/test/vim-test/README.md b/lua/astrocommunity/test/vim-test/README.md new file mode 100644 index 000000000..8fa3318f0 --- /dev/null +++ b/lua/astrocommunity/test/vim-test/README.md @@ -0,0 +1,5 @@ +# vim-test + +Run your tests at the speed of thought + +**Repository:** diff --git a/lua/astrocommunity/test/vim-test/init.lua b/lua/astrocommunity/test/vim-test/init.lua new file mode 100644 index 000000000..f2f310fee --- /dev/null +++ b/lua/astrocommunity/test/vim-test/init.lua @@ -0,0 +1,32 @@ +---@type LazySpec +return { + "vim-test/vim-test", + cmd = { "TestNearest", "TestFile", "TestLast", "TestClass", "TestSuite", "TestVisit" }, + dependencies = { + { + "AstroNvim/astrocore", + ---@param opts AstroCoreOpts + opts = function(_, opts) + local maps = assert(opts.mappings) + + local prefix = "T" + maps.n[prefix] = { desc = require("astroui").get_icon("VimTest", 1, true) .. "Testing" } + + maps.n[prefix .. "n"] = { ":TestNearest", desc = "Test Nearest" } + maps.n[prefix .. "f"] = { ":TestFile", desc = "Test File" } + maps.n[prefix .. "l"] = { ":TestLast", desc = "Test Last" } + maps.n[prefix .. "c"] = { ":TestClass", desc = "Test Class" } + maps.n[prefix .. "s"] = { ":TestSuite", desc = "Test Suite" } + maps.n[prefix .. "v"] = { ":TestVisit", desc = "Test Visit" } + + -- Set the strategy to open results in a vertical split + if not opts.options then opts.options = {} end + if not opts.options.g then opts.options.g = {} end + opts.options.g["test#strategy"] = "neovim" + opts.options.g["test#neovim#term_position"] = "vert" + end, + }, + { "AstroNvim/astroui", opts = { icons = { VimTest = "󰙨" } } }, + }, + event = { "VeryLazy" }, +}