bootstrap_spec.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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("should be able to detect test environment", function()
  8. assert.truthy(os.getenv "LVIM_TEST_ENV")
  9. assert.falsy(package.loaded["lvim.impatient"])
  10. end)
  11. a.it("should not be reading default neovim directories in the home directories", 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 pass basic checkhealth without errors", function()
  24. vim.cmd "set cmdheight&"
  25. vim.cmd "checkhealth nvim"
  26. local errmsg = vim.fn.eval "v:errmsg"
  27. local exception = vim.fn.eval "v:exception"
  28. assert.equal("", errmsg) -- v:errmsg was not updated.
  29. assert.equal("", exception)
  30. end)
  31. end)