fix(test): mock

This commit is contained in:
Barrett Ruth 2025-09-22 23:16:25 -04:00
parent 4b70a21210
commit de14552a3e

View file

@ -10,6 +10,25 @@ describe('Panel integration', function()
state = require('cp.state')
state.reset()
local mock_async_setup = {
setup_contest_async = function() end,
handle_full_setup_async = function(cmd)
state.set_platform(cmd.platform)
state.set_contest_id(cmd.contest)
state.set_problem_id(cmd.problem)
end,
setup_problem_async = function() end,
}
package.loaded['cp.async.setup'] = mock_async_setup
local mock_setup = {
set_platform = function(platform)
state.set_platform(platform)
return true
end,
}
package.loaded['cp.setup'] = mock_setup
cp = require('cp')
cp.setup({
contests = {