From b3cfd165fbca4c8b595ed577027a5171e33a00e9 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun, 2 Jan 2022 14:53:01 +0100 Subject: refactor(test): cleanup test utilities (#2132) --- tests/specs/plugins_load_spec.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/specs/plugins_load_spec.lua (limited to 'tests/specs/plugins_load_spec.lua') diff --git a/tests/specs/plugins_load_spec.lua b/tests/specs/plugins_load_spec.lua new file mode 100644 index 00000000..08c96c12 --- /dev/null +++ b/tests/specs/plugins_load_spec.lua @@ -0,0 +1,35 @@ +local a = require "plenary.async_lib.tests" + +a.describe("plugin-loader", function() + local plugins = require "lvim.plugins" + local loader = require "lvim.plugin-loader" + + a.it("should be able to load default packages without errors", function() + loader:load { plugins, lvim.plugins } + + -- TODO: maybe there's a way to avoid hard-coding the names of the modules? + local startup_plugins = { + "packer", + } + + for _, plugin in ipairs(startup_plugins) do + assert.truthy(package.loaded[plugin]) + end + end) + + a.it("should be able to load lsp packages without errors", function() + loader:load { plugins, lvim.plugins } + + require("lvim.lsp").setup() + + local lsp_packages = { + "lspconfig", + "nlspsettings", + "null-ls", + } + + for _, plugin in ipairs(lsp_packages) do + assert.truthy(package.loaded[plugin]) + end + end) +end) -- cgit v1.2.3