fix(test): remove some tests

This commit is contained in:
Barrett Ruth 2025-09-19 00:34:29 -04:00
parent db6d28353a
commit f4b588c1ab
2 changed files with 9 additions and 46 deletions

View file

@ -253,49 +253,6 @@ describe('cp integration', function()
assert.is_true(found_uv_call)
end)
it('handles scraper communication properly', function()
vim.system = function(cmd)
if cmd[1] == 'ping' then
return {
wait = function()
return { code = 0 }
end,
}
elseif cmd[1] == 'uv' and cmd[2] == 'sync' then
return {
wait = function()
return { code = 0 }
end,
}
elseif cmd[1] == 'uv' and vim.tbl_contains(cmd, 'metadata') then
return {
wait = function()
return { code = 1, stderr = 'network error' }
end,
}
end
return {
wait = function()
return { code = 0 }
end,
}
end
cp.handle_command({ fargs = { 'atcoder', 'abc123' } })
local error_logged = false
for _, log_entry in ipairs(mock_log_messages) do
if
log_entry.level == vim.log.levels.WARN
and log_entry.msg:match('failed to load contest metadata')
then
error_logged = true
break
end
end
assert.is_true(error_logged)
end)
it('processes scraper output correctly', function()
vim.system = function(cmd)
if cmd[1] == 'ping' then

View file

@ -395,9 +395,15 @@ describe('cp test panel', function()
diffthis = function() end,
}
vim.cmd = setmetatable(cmd_table, {
__call = function(_, cmd_str) return end,
__index = function(_, key) return cmd_table[key] end,
__newindex = function(_, key, value) cmd_table[key] = value end,
__call = function(_, cmd_str)
return
end,
__index = function(_, key)
return cmd_table[key]
end,
__newindex = function(_, key, value)
cmd_table[key] = value
end,
})
end
vim.cmd.diffthis = function()