Skip to content

Commit

Permalink
Issue a deprecation warning if busted_command is set
Browse files Browse the repository at this point in the history
  • Loading branch information
MisanthropicBit committed Feb 6, 2025
1 parent 9dc788b commit 848f684
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/neotest-busted/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ end
function config.configure(user_config)
_user_config = vim.tbl_deep_extend("keep", user_config or {}, default_config)

if _user_config.busted_command ~= nil then
vim.notify_once(
"[neotest-busted]: busted_command is deprecated and will be removed in a future version",
vim.log.levels.WARN
)
end

-- Skip checking the executable when running setup to avoid the error
-- message as neotest loads all adapters so users will see an error in a
-- non-lua/neovim directory with a relative path in `busted_command`
Expand Down
7 changes: 7 additions & 0 deletions tests/config_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ describe("config", function()
assert
.stub(vim.notify_once).was
.called_with("[neotest-busted]: Invalid config: " .. tostring(error), vim.log.levels.ERROR)

if invalid_config_test.busted_command ~= nil then
assert.stub(vim.notify_once).was.called_with(
"[neotest-busted]: busted_command is deprecated and will be removed in a future version",
vim.log.levels.WARN
)
end
end

---@diagnostic disable-next-line: undefined-field
Expand Down

0 comments on commit 848f684

Please sign in to comment.