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()
|
package.preload['fzf-lua'] = function()
|
||||||
return {
|
return {
|
||||||
fzf_exec = function() end,
|
fzf_exec = function(_, _) end,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue