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