Skip to content

Commit 17911bb

Browse files
Fix "clear" test in instance
1 parent 77a9f42 commit 17911bb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

spec/ergoterm/instance_spec.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,15 @@ describe(":clear", function()
600600
---@diagnostic disable-next-line: duplicate-set-field
601601
utils.is_windows = function() return false end
602602
local term = Terminal:new()
603+
local spy_chansend = spy.on(vim.fn, "chansend")
603604

604605
term:clear()
605606
vim.wait(100)
606607

607-
local lines = vim.api.nvim_buf_get_lines(term:get_state("bufnr"), 0, -1, false)
608-
assert.is_true(vim.tbl_contains(lines, "clear"))
608+
assert.spy(spy_chansend).was_called_with(
609+
term:get_state("job_id"),
610+
{ "clear", "" }
611+
)
609612
end)
610613

611614
it("delegates action option to send", function()

0 commit comments

Comments
 (0)