Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(test): add vim-test #1112

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lua/astrocommunity/test/vim-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# vim-test

Run your tests at the speed of thought

**Repository:** <https://github.com/vim-test/vim-test>
32 changes: 32 additions & 0 deletions lua/astrocommunity/test/vim-test/init.lua
Original file line number Diff line number Diff line change
@@ -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 = "<Leader>T"
maps.n[prefix] = { desc = require("astroui").get_icon("VimTest", 1, true) .. "Testing" }

maps.n[prefix .. "n"] = { ":TestNearest<CR>", desc = "Test Nearest" }
maps.n[prefix .. "f"] = { ":TestFile<CR>", desc = "Test File" }
maps.n[prefix .. "l"] = { ":TestLast<CR>", desc = "Test Last" }
maps.n[prefix .. "c"] = { ":TestClass<CR>", desc = "Test Class" }
maps.n[prefix .. "s"] = { ":TestSuite<CR>", desc = "Test Suite" }
maps.n[prefix .. "v"] = { ":TestVisit<CR>", 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" },
}
Loading