summaryrefslogtreecommitdiff
path: root/tests/bootstrap_spec.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-09-09 18:53:21 +0200
committerGitHub <[email protected]>2021-09-09 18:53:21 +0200
commit38f53bf08c974791f3d51e8a9c7efe9373c8ce3a (patch)
tree3f2d5ff1f55bc6fbddc0259fc59cf64155c29edf /tests/bootstrap_spec.lua
parentac32f2e64d61291ba4969599827eef515712d5d8 (diff)
[Feature]: Add some very basic unit-tests (#1369)
Diffstat (limited to 'tests/bootstrap_spec.lua')
-rw-r--r--tests/bootstrap_spec.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/bootstrap_spec.lua b/tests/bootstrap_spec.lua
new file mode 100644
index 00000000..0fa35fe0
--- /dev/null
+++ b/tests/bootstrap_spec.lua
@@ -0,0 +1,37 @@
+local a = require "plenary.async_lib.tests"
+
+a.describe("initial start", function()
+ local uv = vim.loop
+ local home_dir = uv.os_homedir()
+ -- TODO: update once #1381 is merged
+ local lvim_config_path = home_dir .. "/.config/lvim"
+ local lvim_runtime_path = home_dir .. "/.local/share/lunarvim/lvim"
+
+ a.it("should not be reading default neovim directories in the home directoies", function()
+ local rtp_list = vim.opt.rtp:get()
+ assert.falsy(vim.tbl_contains(rtp_list, vim.fn.stdpath "config"))
+ end)
+
+ a.it("should be able to read lunarvim directories", function()
+ local rtp_list = vim.opt.rtp:get()
+ assert.truthy(vim.tbl_contains(rtp_list, lvim_runtime_path))
+ assert.truthy(vim.tbl_contains(rtp_list, lvim_config_path))
+ end)
+
+ a.it("should be able to run treesitter without errors", function()
+ assert.truthy(vim.treesitter.highlighter.active)
+ end)
+
+ a.it("should be able to load default packages without errors", function()
+ -- TODO: maybe there's a way to avoid hard-coding the names of the modules?
+ local startup_plugins = {
+ "packer",
+ "lspconfig",
+ "nlspsettings",
+ "null-ls",
+ }
+ for _, plugin in pairs(startup_plugins) do
+ assert.truthy(package.loaded[tostring(plugin)])
+ end
+ end)
+end)