Skip to content

Commit 9c1dd5a

Browse files
committed
test: buse busted for running tasks
1 parent bbe136b commit 9c1dd5a

File tree

5 files changed

+40
-40
lines changed

5 files changed

+40
-40
lines changed

.busted

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
return {
2+
_all = {
3+
coverage = false,
4+
},
5+
default = {
6+
verbose = true,
7+
},
8+
tests = {
9+
verbose = true,
10+
},
11+
}

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
nvim --version
2727
[ ! -d tests ] && exit 0
28-
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}"
28+
nvim -l tests/busted.lua tests
2929
community:
3030
runs-on: ubuntu-latest
3131
steps:

tests/busted.lua

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env -S nvim -l
2+
3+
-- set stdpaths to use .tests
4+
local root = vim.fn.fnamemodify("./.tests", ":p")
5+
for _, name in ipairs({ "config", "data", "state", "cache" }) do
6+
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
7+
end
8+
9+
-- -- Bootstrap lazy.nvim
10+
-- local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
11+
-- if not (vim.uv or vim.loop).fs_stat(lazypath) then
12+
-- local lazyrepo = "https://github.com/folke/lazy.nvim.git"
13+
-- vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
14+
-- end
15+
-- vim.opt.rtp:prepend(lazypath)
16+
vim.opt.rtp:prepend(".")
17+
18+
vim.o.loadplugins = true -- enable since nvim -l disables plugins
19+
20+
-- Setup lazy.nvim
21+
require("lazy").setup({
22+
"lunarmodules/busted", -- add busted
23+
})
24+
25+
-- run busted
26+
return pcall(require("busted.runner"), {
27+
standalone = false,
28+
}) or os.exit(1)

tests/init.lua

-36
This file was deleted.

tests/run

-3
This file was deleted.

0 commit comments

Comments
 (0)