2024-06-26 13:30:55 +01:00
|
|
|
#!/usr/bin/env -S nvim -l
|
|
|
|
|
|
|
|
-- set stdpaths to use .tests
|
|
|
|
local root = vim.fn.fnamemodify("./.tests", ":p")
|
|
|
|
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
|
|
|
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
|
|
|
end
|
|
|
|
|
|
|
|
vim.opt.rtp:prepend(".")
|
|
|
|
|
|
|
|
vim.o.loadplugins = true -- enable since nvim -l disables plugins
|
|
|
|
|
|
|
|
-- Setup lazy.nvim
|
|
|
|
require("lazy").setup({
|
2024-06-26 20:38:28 +01:00
|
|
|
spec = {
|
|
|
|
"lunarmodules/busted", -- add busted
|
|
|
|
},
|
|
|
|
rocks = { hererocks = true },
|
2024-06-26 13:30:55 +01:00
|
|
|
})
|
|
|
|
|
2024-06-26 20:38:28 +01:00
|
|
|
local Config = require("lazy.core.config")
|
|
|
|
-- disable termnial output for the tests
|
|
|
|
Config.options.headless = {}
|
|
|
|
|
2024-06-26 13:30:55 +01:00
|
|
|
-- run busted
|
|
|
|
return pcall(require("busted.runner"), {
|
|
|
|
standalone = false,
|
|
|
|
}) or os.exit(1)
|