fix(ci): fix tests

This commit is contained in:
Barrett Ruth 2025-09-21 15:41:32 -04:00
parent 34b252f892
commit 0e3ec89f17

View file

@ -385,6 +385,9 @@ describe('cp command parsing', function()
local complete_fn
before_each(function()
package.loaded['cp'] = nil
package.loaded['cp.cache'] = nil
complete_fn = function(ArgLead, CmdLine, _)
local constants = require('cp.constants')
local platforms = constants.PLATFORMS
@ -398,6 +401,7 @@ describe('cp command parsing', function()
if num_args == 2 then
local candidates = {}
local cp = require('cp')
local context = cp.get_current_context()
if context.platform and context.contest_id then
vim.list_extend(candidates, actions)
@ -460,6 +464,11 @@ describe('cp command parsing', function()
}
end)
after_each(function()
package.loaded['cp'] = nil
package.loaded['cp.cache'] = nil
end)
it('completes platforms and global actions when no contest context', function()
local result = complete_fn('', 'CP ', 3)