-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(test): add vim-test * fix(test): vim-test options * feat(test): add type annotation and nil safety * fix(test): remove wrapping {}
- Loading branch information
1 parent
71f26b6
commit 4e33ed3
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" }, | ||
} |