Merge pull request #17012 from EdmundsEcho/fix-checkhealth

prevent checkhealth failure when plugin's check returns void
This commit is contained in:
zeertzjq
2022-02-11 05:50:49 +08:00
committed by GitHub
3 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
local M = {}
M.check = function()
return {}
end
return M

View File

@@ -153,6 +153,10 @@ describe('health.vim', function()
## report 2
- OK: nothing to see here
test_plug.submodule_empty: require("test_plug.submodule_empty.health").check()
========================================================================
- ERROR: The healthcheck report for "test_plug.submodule_empty" plugin is empty.
test_plug.submodule_failed: require("test_plug.submodule_failed.health").check()
========================================================================
- ERROR: Failed to run healthcheck for "test_plug.submodule_failed" plugin. Exception:
@@ -172,6 +176,16 @@ describe('health.vim', function()
]])
end)
it("... including empty reports", function()
command("checkhealth test_plug.submodule_empty")
helpers.expect([[
test_plug.submodule_empty: require("test_plug.submodule_empty.health").check()
========================================================================
- ERROR: The healthcheck report for "test_plug.submodule_empty" plugin is empty.
]])
end)
it("gracefully handles broken lua healthcheck", function()
command("checkhealth test_plug.submodule_failed")
local buf_lines = helpers.curbuf('get_lines', 0, -1, true)