plugins_load_spec.lua 913 B

12345678910111213141516171819202122232425262728293031323334353637
  1. describe("plugin-loader", function()
  2. local plugins = require "lvim.plugins"
  3. local loader = require "lvim.plugin-loader"
  4. pcall(function()
  5. lvim.log.level = "debug"
  6. package.loaded["lvim.core.log"] = nil
  7. end)
  8. it("should be able to load default packages without errors", function()
  9. vim.go.loadplugins = true
  10. loader.load { plugins, lvim.plugins }
  11. -- TODO: maybe there's a way to avoid hard-coding the names of the modules?
  12. local startup_plugins = {
  13. "lazy",
  14. }
  15. for _, plugin in ipairs(startup_plugins) do
  16. assert.truthy(package.loaded[plugin])
  17. end
  18. end)
  19. it("should be able to load lsp packages without errors", function()
  20. require("lvim.lsp").setup()
  21. local lsp_packages = {
  22. "lspconfig",
  23. "nlspsettings",
  24. "null-ls",
  25. }
  26. for _, plugin in ipairs(lsp_packages) do
  27. assert.truthy(package.loaded[plugin])
  28. end
  29. end)
  30. end)