2023-08-27 08:44:07 +02:00
|
|
|
describe("plugin-loader", function()
|
2021-10-10 21:07:41 +02:00
|
|
|
local plugins = require "lvim.plugins"
|
|
|
|
local loader = require "lvim.plugin-loader"
|
|
|
|
|
2022-04-12 11:18:17 +02:00
|
|
|
pcall(function()
|
|
|
|
lvim.log.level = "debug"
|
|
|
|
package.loaded["lvim.core.log"] = nil
|
|
|
|
end)
|
|
|
|
|
2023-08-27 08:44:07 +02:00
|
|
|
it("should be able to load default packages without errors", function()
|
2023-01-10 21:18:17 +01:00
|
|
|
vim.go.loadplugins = true
|
2022-03-24 16:16:38 +01:00
|
|
|
loader.load { plugins, lvim.plugins }
|
2021-10-03 16:13:46 +02:00
|
|
|
|
|
|
|
-- TODO: maybe there's a way to avoid hard-coding the names of the modules?
|
|
|
|
local startup_plugins = {
|
2023-01-10 21:18:17 +01:00
|
|
|
"lazy",
|
2021-10-03 16:13:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, plugin in ipairs(startup_plugins) do
|
|
|
|
assert.truthy(package.loaded[plugin])
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2023-08-27 08:44:07 +02:00
|
|
|
it("should be able to load lsp packages without errors", function()
|
2021-10-10 21:07:41 +02:00
|
|
|
require("lvim.lsp").setup()
|
2021-10-03 16:13:46 +02:00
|
|
|
|
|
|
|
local lsp_packages = {
|
|
|
|
"lspconfig",
|
|
|
|
"nlspsettings",
|
|
|
|
"null-ls",
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, plugin in ipairs(lsp_packages) do
|
|
|
|
assert.truthy(package.loaded[plugin])
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end)
|