fix(ci): keep mocks for stubs, but ignore unused param
This commit is contained in:
parent
c1529c5d91
commit
be143d408b
4 changed files with 16 additions and 16 deletions
|
|
@ -6,7 +6,7 @@ describe('cp.fzf_lua', function()
|
|||
|
||||
package.preload['fzf-lua'] = function()
|
||||
return {
|
||||
fzf_exec = function() end,
|
||||
fzf_exec = function(_, _) end,
|
||||
}
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ describe('cp.picker', function()
|
|||
|
||||
describe('get_contests_for_platform', function()
|
||||
it('returns empty list when scraper fails', function()
|
||||
vim.system = function()
|
||||
vim.system = function(_, _)
|
||||
return {
|
||||
wait = function()
|
||||
return { code = 1, stderr = 'test error' }
|
||||
|
|
@ -54,7 +54,7 @@ describe('cp.picker', function()
|
|||
end)
|
||||
|
||||
it('returns empty list when JSON is invalid', function()
|
||||
vim.system = function()
|
||||
vim.system = function(_, _)
|
||||
return {
|
||||
wait = function()
|
||||
return { code = 0, stdout = 'invalid json' }
|
||||
|
|
@ -68,7 +68,7 @@ describe('cp.picker', function()
|
|||
end)
|
||||
|
||||
it('returns contest list when scraper succeeds', function()
|
||||
vim.system = function()
|
||||
vim.system = function(_, _)
|
||||
return {
|
||||
wait = function()
|
||||
return {
|
||||
|
|
@ -106,7 +106,7 @@ describe('cp.picker', function()
|
|||
it('returns problems from cache when available', function()
|
||||
local cache = require('cp.cache')
|
||||
cache.load = function() end
|
||||
cache.get_contest_data = function()
|
||||
cache.get_contest_data = function(_, _)
|
||||
return {
|
||||
problems = {
|
||||
{ id = 'a', name = 'Problem A' },
|
||||
|
|
@ -128,10 +128,10 @@ describe('cp.picker', function()
|
|||
local scrape = require('cp.scrape')
|
||||
|
||||
cache.load = function() end
|
||||
cache.get_contest_data = function()
|
||||
cache.get_contest_data = function(_, _)
|
||||
return nil
|
||||
end
|
||||
scrape.scrape_contest_metadata = function()
|
||||
scrape.scrape_contest_metadata = function(_, _)
|
||||
return {
|
||||
success = true,
|
||||
problems = {
|
||||
|
|
@ -151,10 +151,10 @@ describe('cp.picker', function()
|
|||
local scrape = require('cp.scrape')
|
||||
|
||||
cache.load = function() end
|
||||
cache.get_contest_data = function()
|
||||
cache.get_contest_data = function(_, _)
|
||||
return nil
|
||||
end
|
||||
scrape.scrape_contest_metadata = function()
|
||||
scrape.scrape_contest_metadata = function(_, _)
|
||||
return {
|
||||
success = false,
|
||||
error = 'test error',
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ describe('cp.scrape', function()
|
|||
|
||||
describe('system dependency checks', function()
|
||||
it('handles missing uv executable', function()
|
||||
vim.fn.executable = function(cmd)
|
||||
vim.fn.executable = function(_)
|
||||
return cmd == 'uv' and 0 or 1
|
||||
end
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ describe('cp.scrape', function()
|
|||
end)
|
||||
|
||||
it('handles python environment setup failure', function()
|
||||
vim.system = function(cmd)
|
||||
vim.system = function(_)
|
||||
if cmd[1] == 'ping' then
|
||||
return {
|
||||
wait = function()
|
||||
|
|
@ -172,7 +172,7 @@ describe('cp.scrape', function()
|
|||
end)
|
||||
|
||||
it('handles network connectivity issues', function()
|
||||
vim.system = function(cmd)
|
||||
vim.system = function(_)
|
||||
if cmd[1] == 'ping' then
|
||||
return {
|
||||
wait = function()
|
||||
|
|
@ -231,7 +231,7 @@ describe('cp.scrape', function()
|
|||
end)
|
||||
|
||||
it('handles subprocess execution failure', function()
|
||||
vim.system = function(cmd)
|
||||
vim.system = function(_)
|
||||
if cmd[1] == 'ping' then
|
||||
return {
|
||||
wait = function()
|
||||
|
|
@ -262,7 +262,7 @@ describe('cp.scrape', function()
|
|||
|
||||
describe('json parsing', function()
|
||||
it('handles invalid json output', function()
|
||||
vim.system = function(cmd)
|
||||
vim.system = function(_)
|
||||
if cmd[1] == 'ping' then
|
||||
return {
|
||||
wait = function()
|
||||
|
|
@ -290,7 +290,7 @@ describe('cp.scrape', function()
|
|||
end)
|
||||
|
||||
it('handles scraper-reported failures', function()
|
||||
vim.system = function(cmd)
|
||||
vim.system = function(_)
|
||||
if cmd[1] == 'ping' then
|
||||
return {
|
||||
wait = function()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ describe('cp.telescope', function()
|
|||
|
||||
package.preload['telescope.pickers'] = function()
|
||||
return {
|
||||
new = function()
|
||||
new = function(_, _)
|
||||
return {
|
||||
find = function() end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue