Skip to content

Commit

Permalink
tests(lsp): add assertions for notify and notify_once not being called
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Oct 22, 2023
1 parent e8b3bb6 commit eb0baed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/lsp_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ describe('LSP client API', function()
if vim.fn.executable(ra_bin) ~= 0 then
it('Can spin up rust-analyzer.', function()
local lsp_start = stub(vim.lsp, 'start')
local notify_once = stub(vim, 'notify_once')
local notify = stub(vim, 'notify')
vim.cmd.e('test.rs')
vim.cmd.RustAnalyzer('start')
-- TODO: Use something less flaky, e.g. a timeout
uv.sleep(5000)
assert.stub(lsp_start).was_called()
assert.stub(notify_once).was_not_called()
assert.stub(notify).was_not_called()
end)
end
end)

0 comments on commit eb0baed

Please sign in to comment.