fix(ci): fix tests
This commit is contained in:
parent
34b252f892
commit
0e3ec89f17
1 changed files with 9 additions and 0 deletions
|
|
@ -385,6 +385,9 @@ describe('cp command parsing', function()
|
||||||
local complete_fn
|
local complete_fn
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
package.loaded['cp'] = nil
|
||||||
|
package.loaded['cp.cache'] = nil
|
||||||
|
|
||||||
complete_fn = function(ArgLead, CmdLine, _)
|
complete_fn = function(ArgLead, CmdLine, _)
|
||||||
local constants = require('cp.constants')
|
local constants = require('cp.constants')
|
||||||
local platforms = constants.PLATFORMS
|
local platforms = constants.PLATFORMS
|
||||||
|
|
@ -398,6 +401,7 @@ describe('cp command parsing', function()
|
||||||
|
|
||||||
if num_args == 2 then
|
if num_args == 2 then
|
||||||
local candidates = {}
|
local candidates = {}
|
||||||
|
local cp = require('cp')
|
||||||
local context = cp.get_current_context()
|
local context = cp.get_current_context()
|
||||||
if context.platform and context.contest_id then
|
if context.platform and context.contest_id then
|
||||||
vim.list_extend(candidates, actions)
|
vim.list_extend(candidates, actions)
|
||||||
|
|
@ -460,6 +464,11 @@ describe('cp command parsing', function()
|
||||||
}
|
}
|
||||||
end)
|
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()
|
it('completes platforms and global actions when no contest context', function()
|
||||||
local result = complete_fn('', 'CP ', 3)
|
local result = complete_fn('', 'CP ', 3)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue