fix(ci): keep mocks for stubs, but ignore unused param

This commit is contained in:
Barrett Ruth 2025-09-21 11:42:53 -04:00
parent c1529c5d91
commit be143d408b
4 changed files with 16 additions and 16 deletions

View file

@ -6,7 +6,7 @@ describe('cp.fzf_lua', function()
package.preload['fzf-lua'] = function() package.preload['fzf-lua'] = function()
return { return {
fzf_exec = function() end, fzf_exec = function(_, _) end,
} }
end end
end) end)

View file

@ -40,7 +40,7 @@ describe('cp.picker', function()
describe('get_contests_for_platform', function() describe('get_contests_for_platform', function()
it('returns empty list when scraper fails', function() it('returns empty list when scraper fails', function()
vim.system = function() vim.system = function(_, _)
return { return {
wait = function() wait = function()
return { code = 1, stderr = 'test error' } return { code = 1, stderr = 'test error' }
@ -54,7 +54,7 @@ describe('cp.picker', function()
end) end)
it('returns empty list when JSON is invalid', function() it('returns empty list when JSON is invalid', function()
vim.system = function() vim.system = function(_, _)
return { return {
wait = function() wait = function()
return { code = 0, stdout = 'invalid json' } return { code = 0, stdout = 'invalid json' }
@ -68,7 +68,7 @@ describe('cp.picker', function()
end) end)
it('returns contest list when scraper succeeds', function() it('returns contest list when scraper succeeds', function()
vim.system = function() vim.system = function(_, _)
return { return {
wait = function() wait = function()
return { return {
@ -106,7 +106,7 @@ describe('cp.picker', function()
it('returns problems from cache when available', function() it('returns problems from cache when available', function()
local cache = require('cp.cache') local cache = require('cp.cache')
cache.load = function() end cache.load = function() end
cache.get_contest_data = function() cache.get_contest_data = function(_, _)
return { return {
problems = { problems = {
{ id = 'a', name = 'Problem A' }, { id = 'a', name = 'Problem A' },
@ -128,10 +128,10 @@ describe('cp.picker', function()
local scrape = require('cp.scrape') local scrape = require('cp.scrape')
cache.load = function() end cache.load = function() end
cache.get_contest_data = function() cache.get_contest_data = function(_, _)
return nil return nil
end end
scrape.scrape_contest_metadata = function() scrape.scrape_contest_metadata = function(_, _)
return { return {
success = true, success = true,
problems = { problems = {
@ -151,10 +151,10 @@ describe('cp.picker', function()
local scrape = require('cp.scrape') local scrape = require('cp.scrape')
cache.load = function() end cache.load = function() end
cache.get_contest_data = function() cache.get_contest_data = function(_, _)
return nil return nil
end end
scrape.scrape_contest_metadata = function() scrape.scrape_contest_metadata = function(_, _)
return { return {
success = false, success = false,
error = 'test error', error = 'test error',

View file

@ -129,7 +129,7 @@ describe('cp.scrape', function()
describe('system dependency checks', function() describe('system dependency checks', function()
it('handles missing uv executable', function() it('handles missing uv executable', function()
vim.fn.executable = function(cmd) vim.fn.executable = function(_)
return cmd == 'uv' and 0 or 1 return cmd == 'uv' and 0 or 1
end end
@ -140,7 +140,7 @@ describe('cp.scrape', function()
end) end)
it('handles python environment setup failure', function() it('handles python environment setup failure', function()
vim.system = function(cmd) vim.system = function(_)
if cmd[1] == 'ping' then if cmd[1] == 'ping' then
return { return {
wait = function() wait = function()
@ -172,7 +172,7 @@ describe('cp.scrape', function()
end) end)
it('handles network connectivity issues', function() it('handles network connectivity issues', function()
vim.system = function(cmd) vim.system = function(_)
if cmd[1] == 'ping' then if cmd[1] == 'ping' then
return { return {
wait = function() wait = function()
@ -231,7 +231,7 @@ describe('cp.scrape', function()
end) end)
it('handles subprocess execution failure', function() it('handles subprocess execution failure', function()
vim.system = function(cmd) vim.system = function(_)
if cmd[1] == 'ping' then if cmd[1] == 'ping' then
return { return {
wait = function() wait = function()
@ -262,7 +262,7 @@ describe('cp.scrape', function()
describe('json parsing', function() describe('json parsing', function()
it('handles invalid json output', function() it('handles invalid json output', function()
vim.system = function(cmd) vim.system = function(_)
if cmd[1] == 'ping' then if cmd[1] == 'ping' then
return { return {
wait = function() wait = function()
@ -290,7 +290,7 @@ describe('cp.scrape', function()
end) end)
it('handles scraper-reported failures', function() it('handles scraper-reported failures', function()
vim.system = function(cmd) vim.system = function(_)
if cmd[1] == 'ping' then if cmd[1] == 'ping' then
return { return {
wait = function() wait = function()

View file

@ -14,7 +14,7 @@ describe('cp.telescope', function()
package.preload['telescope.pickers'] = function() package.preload['telescope.pickers'] = function()
return { return {
new = function() new = function(_, _)
return { return {
find = function() end, find = function() end,
} }