Skip to content

Commit

Permalink
fix: don't return boolean if there's no coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeAbella authored and xixiaofinland committed Oct 2, 2024
1 parent 2d81c89 commit f69f8e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/sf/sub/test_sign.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ H.get_coverage = function()

local tbl = U.read_file_in_plugin_folder("test_result.json")
if not tbl then
return vim.notify_once("Local test_result.json not found.", vim.log.levels.WARN)
vim.notify_once("Local test_result.json not found.", vim.log.levels.WARN)
return nil
end

coverage = vim.tbl_get(tbl, "result", "coverage", "coverage")
if coverage == nil then
return vim.notify_once("Local test_result.json has no coverage element.", vim.log.levels.WARN)
vim.notify_once("Local test_result.json has no coverage element.", vim.log.levels.WARN)
return nil
end

cache = coverage
Expand Down

0 comments on commit f69f8e5

Please sign in to comment.