plugins_load_spec.lua 964 B

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