Added unittest + basic python and lua unittests (#174)
--------- Co-authored-by: Danymat <d.danymat@gmail.com>
This commit is contained in:
27
tests/minimal_init.lua
Normal file
27
tests/minimal_init.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
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" })
|
||||
Reference in New Issue
Block a user