Files
neogen/tests/minimal_init.lua
Colin Kennedy fef1ab3932 Added unittest + basic python and lua unittests (#174)
---------

Co-authored-by: Danymat <d.danymat@gmail.com>
2024-07-23 18:18:14 +02:00

28 lines
882 B
Lua

local plugins = {
["https://github.com/nvim-treesitter/nvim-treesitter"] = os.getenv("NVIM_TREESITTER_DIRECTORY")
or "/tmp/nvim_treesitter",
["https://github.com/nvim-lua/plenary.nvim"] = os.getenv("PLENARY_DIRECTORY") or "/tmp/plenary.nvim",
}
local tests_directory = vim.fn.fnamemodify(vim.fn.expand("<sfile>"), ":h")
local plugin_root = vim.fn.fnamemodify(tests_directory, ":h")
vim.opt.runtimepath:append(plugin_root)
for url, directory in pairs(plugins) do
if vim.fn.isdirectory(directory) == 0 then
vim.fn.system({ "git", "clone", url, directory })
end
vim.opt.runtimepath:append(directory)
end
vim.cmd("runtime plugin/plenary.vim")
require("plenary.busted")
vim.cmd("runtime plugin/nvim-treesitter.lua")
-- Some tests require the Python parser
vim.cmd([[TSInstallSync! python]])
require("neogen").setup({ snippet_engine = "nvim" })