Skip to content

Commit

Permalink
test: fix LSP diagnostic warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Jan 17, 2024
1 parent 4d8e7ac commit 6380530
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"workspace": {
"library": [
"$VIMRUNTIME"
"$VIMRUNTIME",
"${3rd}/busted/library",
"${3rd}/luassert/library"
]
},
"runtime": {
Expand Down
11 changes: 0 additions & 11 deletions tests/.luarc.json

This file was deleted.

8 changes: 4 additions & 4 deletions tests/bar_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ describe('[bar]', function()
return vim.fn.char2nr('a')
end)
winbar:pick()
vim.fn.getchar:revert()
assert.spy(agent).was_called()
vim.fn.getchar:revert() ---@diagnostic disable-line: undefined-field
assert.spy(agent).was.called(1)
end)
it('picks directly', function()
local agent = spy.on(winbar.components[2], 'on_click')
winbar.in_pick_mode = true
winbar:pick(2)
assert.spy(agent).was_called()
assert.spy(agent).was.called(1)
end)
it('gets the component according to given position', function()
-- sym1 has width 0 and is at the beginning of the bar
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('[bar]', function()
assert.is_nil(rawget(_G.dropbar.bars[winbar.buf], winbar.win))
assert.is_nil(rawget(_G.dropbar.callbacks[winbar.buf], winbar.win))
for _, agent in ipairs(agents) do
assert.spy(agent).was_called()
assert.spy(agent).was.called(1)
end
end)
end)
Expand Down
8 changes: 4 additions & 4 deletions tests/menu_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ describe('[menu]', function()
local agent2 = spy.on(sub_menu_it, 'close')
local agent3 = spy.on(sub_sub_menu_it, 'close')
vim.api.nvim_win_close(menu_it.win, true)
assert.spy(agent1).was.called()
assert.spy(agent2).was.called()
assert.spy(agent3).was.called()
assert.spy(agent1).was.called(1)
assert.spy(agent2).was.called(1)
assert.spy(agent3).was.called(1)
end)
it('closing current menu will set cursor to parent menu', function()
sub_sub_menu_it:close()
Expand Down Expand Up @@ -546,7 +546,7 @@ describe('[menu]', function()

menu_it:fuzzy_find_close()

assert.spy(gc_metamethod).was.called()
assert.spy(gc_metamethod).was.called(1)
end)
end)
end)

0 comments on commit 6380530

Please sign in to comment.