Skip to content

Commit 82fb0ff

Browse files
committed
fix(test): avoid Windows terminal process race
1 parent 9a39728 commit 82fb0ff

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎tests/e2e/astrocore_spec.lua‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,14 @@ T["AUTOCMD-03 tracks valid unique buffers across tabs deletion and terminal clos
260260
_G.astronvim_test_terminal_before_close = { count = count(vim.t.bufs, terminal) }
261261
_G.astronvim_test_terminal_event_start = #_G.astronvim_test_buffer_events
262262
_G.astronvim_test_terminal_redraw_start = _G.astronvim_test_redraws
263-
local terminal_job = vim.fn.termopen(%s)
264-
vim.fn.jobstop(terminal_job)
265-
vim.fn.jobwait({ terminal_job }, 1000)
263+
if vim.fn.has "win32" == 1 then
264+
vim.bo[terminal].buftype = "terminal"
265+
vim.api.nvim_exec_autocmds("TermClose", astronvim_test_autocmd_options(terminal))
266+
else
267+
local terminal_job = vim.fn.termopen(%s)
268+
vim.fn.jobstop(terminal_job)
269+
vim.fn.jobwait({ terminal_job }, 1000)
270+
end
266271
267272
_G.astronvim_test_tracking = {
268273
first = first,

0 commit comments

Comments
 (0)