Update tools for testing lua plugins

main
Ensar Sarajčić 2022-05-07 18:10:27 +02:00
parent 3a949c94ef
commit 0caec65ecf
2 changed files with 6 additions and 2 deletions

View File

@ -17,3 +17,7 @@ vim.keymap.set("n", "<Leader>tg", ":TestVisit<CR>", opts)
vim.api.nvim_create_user_command("PlenaryTestFile", function()
require("plenary.test_harness").test_directory(vim.fn.expand("%:p"))
end, {})
vim.api.nvim_create_user_command("PlenaryTestFileWithLocalMinInit", function()
require("plenary.test_harness").test_directory(vim.fn.expand("%:p"), { minimal_init = "tests/minimal.vim" })
end, {})

View File

@ -272,9 +272,9 @@ local lua_vim_plugin_config = {
},
["lua/*.lua"] = {
type = "source",
alternate = "tests/{}.lua",
alternate = "tests/{}_spec.lua",
},
["tests/*.lua"] = {
["tests/*_spec.lua"] = {
type = "test",
alternate = "lua/{}.lua",
template = {