chore: setup mini.test
This commit is contained in:
parent
e71f5937fc
commit
42a880ab95
5 changed files with 24 additions and 12 deletions
12
Taskfile.yml
12
Taskfile.yml
|
|
@ -26,17 +26,13 @@ tasks:
|
|||
cmds:
|
||||
- stylua .
|
||||
|
||||
test:
|
||||
desc: runs all tests
|
||||
aliases: [tests, spec]
|
||||
tests:
|
||||
desc: run all tests
|
||||
cmds:
|
||||
- |
|
||||
nvim --headless \
|
||||
-u ./scripts/minimal_init.lua \
|
||||
-c "PlenaryBustedDirectory spec \
|
||||
{minimal_init='./scripts/minimal_init.lua' \
|
||||
,sequential=true}" \
|
||||
-c ":qa!"
|
||||
-u ./scripts/minimal_init.lua \
|
||||
-c "lua MiniTest.run()"
|
||||
|
||||
docgen:
|
||||
desc: generate vimhelp
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
[vim]
|
||||
any = true
|
||||
|
||||
[MiniTest]
|
||||
any = true
|
||||
|
||||
[describe]
|
||||
any = true
|
||||
[[describe.args]]
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ local function install_plug(plugin)
|
|||
end
|
||||
end
|
||||
|
||||
vim.env.XDG_CONFIG_HOME = root ".tests/config"
|
||||
vim.env.XDG_DATA_HOME = root ".tests/data"
|
||||
vim.env.XDG_STATE_HOME = root ".tests/state"
|
||||
vim.env.XDG_CACHE_HOME = root ".tests/cache"
|
||||
|
||||
vim.cmd [[set runtimepath=$VIMRUNTIME]]
|
||||
vim.opt.runtimepath:append(root())
|
||||
vim.opt.packpath = { root ".tests/site" }
|
||||
|
|
@ -28,7 +33,15 @@ install_plug "nvim-lua/plenary.nvim"
|
|||
install_plug "nvim-treesitter/nvim-treesitter"
|
||||
install_plug "echasnovski/mini.doc" -- used for docs generation
|
||||
|
||||
vim.env.XDG_CONFIG_HOME = root ".tests/config"
|
||||
vim.env.XDG_DATA_HOME = root ".tests/data"
|
||||
vim.env.XDG_STATE_HOME = root ".tests/state"
|
||||
vim.env.XDG_CACHE_HOME = root ".tests/cache"
|
||||
-- setup mini.test only when running headless nvim
|
||||
if #vim.api.nvim_list_uis() == 0 then
|
||||
install_plug "echasnovski/mini.test"
|
||||
|
||||
require("mini.test").setup {
|
||||
collect = {
|
||||
find_files = function()
|
||||
return vim.fn.globpath("spec", "**/*_test.lua", true, true)
|
||||
end,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue