fix(test): mock caches and everything else

This commit is contained in:
Barrett Ruth 2025-09-21 12:26:06 -04:00
parent 1822714a0c
commit 373e7f6e76
5 changed files with 51 additions and 5 deletions

View file

@ -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)

View file

@ -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

View file

@ -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)