bootstrap_spec.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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["lvim.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 pass basic checkhealth without errors", function()
  24. vim.cmd "checkhealth nvim"
  25. local errmsg = vim.fn.eval "v:errmsg"
  26. local exception = vim.fn.eval "v:exception"
  27. assert.equal("", errmsg) -- v:errmsg was not updated.
  28. assert.equal("", exception)
  29. end)
  30. end)