test: trigger loading event manually for mason (#4343)

This commit is contained in:
kylo252 2023-08-27 09:00:07 +02:00 committed by GitHub
parent 10b9123b7d
commit 2f45be36de
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -143,7 +143,7 @@ function M.load_defaults()
local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf }) local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf })
if not (vim.fn.expand "%" == "" or buftype == "nofile") then if not (vim.fn.expand "%" == "" or buftype == "nofile") then
vim.api.nvim_del_augroup_by_name "_file_opened" vim.api.nvim_del_augroup_by_name "_file_opened"
vim.cmd "do User FileOpened" vim.api.nvim_exec_autocmds("User", { pattern = "FileOpened" })
require("lvim.lsp").setup() require("lvim.lsp").setup()
end end
end, end,

View file

@ -24,6 +24,9 @@ describe("lsp workflow", function()
local plugins = require "lvim.plugins" local plugins = require "lvim.plugins"
require("lvim.plugin-loader").load { plugins, lvim.plugins } require("lvim.plugin-loader").load { plugins, lvim.plugins }
-- trigger loading event manually for mason
vim.api.nvim_exec_autocmds("User", { pattern = "FileOpened" })
it("should be able to delete ftplugin templates", function() it("should be able to delete ftplugin templates", function()
if utils.is_directory(lvim.lsp.templates_dir) then if utils.is_directory(lvim.lsp.templates_dir) then
assert.equal(vim.fn.delete(lvim.lsp.templates_dir, "rf"), 0) assert.equal(vim.fn.delete(lvim.lsp.templates_dir, "rf"), 0)