Skip to content

Commit 5bf6cec

Browse files
committed
test: Check for deprecations more easily
1 parent 95ec3aa commit 5bf6cec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/debugprint.lua

+7-7
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ vim.notify = function(msg, _)
7777
notify_message = msg
7878
end
7979

80+
-- This also overrides the behaviour of vim.deprecate to only show warnings once
81+
-- within one NeoVim session
82+
vim.notify_once = vim.notify
83+
8084
-- FIXME: Switch to joinpath for more elegance once we stop supporting <0.10
8185
local DATA_PATH = vim.fn.stdpath("data") .. "/debugprint"
8286
local COUNTER_FILE = DATA_PATH .. "/counter"
@@ -2146,13 +2150,9 @@ describe("handle deprecated options, create_keymaps=true", function()
21462150
after_each(teardown)
21472151

21482152
it("basic", function()
2149-
-- This deprecation message will not be shown again after the test above
2150-
-- because these tests are run inside the same NeoVim instance and
2151-
-- vim.deprecate won't show the same notification twice.
2152-
--
2153-
-- assert.True(
2154-
-- notify_message:find("^`create_keymaps` option is deprecated") == 1
2155-
-- )
2153+
assert.True(
2154+
notify_message:find("^`create_keymaps` option is deprecated") == 1
2155+
)
21562156

21572157
local filename = init_file({
21582158
"foo",

0 commit comments

Comments
 (0)