fix(test): fix mocks
This commit is contained in:
parent
79e1f1096b
commit
2707df28ce
1 changed files with 4 additions and 7 deletions
|
|
@ -12,16 +12,11 @@ describe('cp command parsing', function()
|
||||||
}
|
}
|
||||||
package.loaded['cp.log'] = mock_logger
|
package.loaded['cp.log'] = mock_logger
|
||||||
|
|
||||||
local mock_async_setup = {
|
|
||||||
setup_contest_async = function() end,
|
|
||||||
handle_full_setup_async = function() end,
|
|
||||||
setup_problem_async = function() end,
|
|
||||||
}
|
|
||||||
package.loaded['cp.async.setup'] = mock_async_setup
|
|
||||||
local mock_setup = {
|
local mock_setup = {
|
||||||
set_platform = function()
|
set_platform = function()
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
|
setup_contest = function() end,
|
||||||
navigate_problem = function() end,
|
navigate_problem = function() end,
|
||||||
}
|
}
|
||||||
package.loaded['cp.setup'] = mock_setup
|
package.loaded['cp.setup'] = mock_setup
|
||||||
|
|
@ -33,6 +28,9 @@ describe('cp command parsing', function()
|
||||||
get_contest_id = function()
|
get_contest_id = function()
|
||||||
return 'abc123'
|
return 'abc123'
|
||||||
end,
|
end,
|
||||||
|
is_run_panel_active = function()
|
||||||
|
return false
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
package.loaded['cp.state'] = mock_state
|
package.loaded['cp.state'] = mock_state
|
||||||
|
|
||||||
|
|
@ -53,7 +51,6 @@ describe('cp command parsing', function()
|
||||||
|
|
||||||
after_each(function()
|
after_each(function()
|
||||||
package.loaded['cp.log'] = nil
|
package.loaded['cp.log'] = nil
|
||||||
package.loaded['cp.async.setup'] = nil
|
|
||||||
package.loaded['cp.setup'] = nil
|
package.loaded['cp.setup'] = nil
|
||||||
package.loaded['cp.state'] = nil
|
package.loaded['cp.state'] = nil
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue