fix(test): mock caches and everything else
This commit is contained in:
parent
1822714a0c
commit
373e7f6e76
5 changed files with 51 additions and 5 deletions
|
|
@ -91,7 +91,8 @@ local function setup_problem(contest_id, problem_id, language)
|
|||
contest_id,
|
||||
problem_id
|
||||
),
|
||||
vim.log.levels.WARN
|
||||
vim.log.levels.INFO,
|
||||
true
|
||||
)
|
||||
|
||||
local scrape_result = scrape.scrape_problem(ctx)
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ function M.set_config(user_config)
|
|||
config = user_config
|
||||
end
|
||||
|
||||
function M.log(msg, level)
|
||||
function M.log(msg, level, override)
|
||||
level = level or vim.log.levels.INFO
|
||||
if not config or config.debug or level >= vim.log.levels.WARN then
|
||||
if not config or config.debug or level >= vim.log.levels.WARN or override then
|
||||
vim.notify(('[cp.nvim]: %s'):format(msg), level)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ local function get_contests_for_platform(platform)
|
|||
local platform_display_name = constants.PLATFORM_DISPLAY_NAMES[platform] or platform
|
||||
logger.log(
|
||||
('Scraping %s for contests, this may take a few seconds...'):format(platform_display_name),
|
||||
vim.log.levels.WARN
|
||||
vim.log.levels.INFO,
|
||||
true
|
||||
)
|
||||
|
||||
local plugin_path = utils.get_plugin_path()
|
||||
|
|
@ -125,7 +126,8 @@ local function get_problems_for_contest(platform, contest_id)
|
|||
platform_display_name,
|
||||
contest_id
|
||||
),
|
||||
vim.log.levels.WARN
|
||||
vim.log.levels.INFO,
|
||||
true
|
||||
)
|
||||
|
||||
local metadata_result = scrape.scrape_contest_metadata(platform, contest_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue