plugins_load_spec.lua 881 B

1234567891011121314151617181920212223242526272829303132333435
  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. a.it("should be able to load default packages without errors", function()
  6. loader:load { plugins, lvim.plugins }
  7. -- TODO: maybe there's a way to avoid hard-coding the names of the modules?
  8. local startup_plugins = {
  9. "packer",
  10. }
  11. for _, plugin in ipairs(startup_plugins) do
  12. assert.truthy(package.loaded[plugin])
  13. end
  14. end)
  15. a.it("should be able to load lsp packages without errors", function()
  16. loader:load { plugins, lvim.plugins }
  17. require("lvim.lsp").setup()
  18. local lsp_packages = {
  19. "lspconfig",
  20. "nlspsettings",
  21. "null-ls",
  22. }
  23. for _, plugin in ipairs(lsp_packages) do
  24. assert.truthy(package.loaded[plugin])
  25. end
  26. end)
  27. end)