bootstrap_spec.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. local a = require "plenary.async_lib.tests"
  2. a.describe("initial start", function()
  3. local uv = vim.loop
  4. local home_dir = uv.os_homedir()
  5. local lvim_config_path = get_config_dir() or home_dir .. "/.config/lvim"
  6. local lvim_runtime_path = get_runtime_dir() or home_dir .. "/.local/share/lunarvim"
  7. a.it("shoud be able to detect test environment", function()
  8. assert.truthy(os.getenv "LVIM_TEST_ENV")
  9. assert.falsy(package.loaded["impatient"])
  10. end)
  11. a.it("should not be reading default neovim directories in the home directoies", function()
  12. local rtp_list = vim.opt.rtp:get()
  13. assert.falsy(vim.tbl_contains(rtp_list, vim.fn.stdpath "config"))
  14. end)
  15. a.it("should be able to read lunarvim directories", function()
  16. local rtp_list = vim.opt.rtp:get()
  17. assert.truthy(vim.tbl_contains(rtp_list, lvim_runtime_path .. "/lvim"))
  18. assert.truthy(vim.tbl_contains(rtp_list, lvim_config_path))
  19. end)
  20. a.it("should be able to run treesitter without errors", function()
  21. assert.truthy(vim.treesitter.highlighter.active)
  22. end)
  23. a.it("should be able to load default packages without errors", function()
  24. -- TODO: maybe there's a way to avoid hard-coding the names of the modules?
  25. local startup_plugins = {
  26. "packer",
  27. "lspconfig",
  28. "nlspsettings",
  29. "null-ls",
  30. }
  31. for _, plugin in pairs(startup_plugins) do
  32. assert.truthy(package.loaded[tostring(plugin)])
  33. end
  34. end)
  35. end)