Skip to content

Commit f0131b6

Browse files
committed
fix(test): launch Windows protocol fixtures reliably
1 parent ca28e16 commit f0131b6

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎tests/e2e/astrocore_spec.lua‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ local T = MiniTest.new_set {
1414
}
1515

1616
local function terminal_sleep_command()
17-
if vim.fn.has "win32" == 1 then return "cmd /c exit 0" end
17+
if vim.fn.has "win32" == 1 then return "ping -n 3 127.0.0.1 > NUL" end
18+
return "sleep 10"
19+
end
20+
21+
local function terminal_job_command()
22+
if vim.fn.has "win32" == 1 then return { "cmd.exe", "/c", "ping -n 3 127.0.0.1 > nul" } end
1823
return "sleep 10"
1924
end
2025

@@ -257,6 +262,7 @@ T["AUTOCMD-03 tracks valid unique buffers across tabs deletion and terminal clos
257262
_G.astronvim_test_terminal_redraw_start = _G.astronvim_test_redraws
258263
local terminal_job = vim.fn.termopen(%s)
259264
vim.fn.jobstop(terminal_job)
265+
vim.fn.jobwait({ terminal_job }, 1000)
260266
261267
_G.astronvim_test_tracking = {
262268
first = first,
@@ -267,7 +273,7 @@ T["AUTOCMD-03 tracks valid unique buffers across tabs deletion and terminal clos
267273
stale = stale,
268274
terminal = terminal,
269275
}
270-
]=]):format(vim.inspect(terminal_sleep_command())))
276+
]=]):format(vim.inspect(terminal_job_command())))
271277

272278
helpers.wait_until(child, "vim.g.astronvim_test_terminal_closed == true", "terminal close")
273279

‎tests/e2e/dap_spec.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ T["DAP-E2E-03 runs and terminates a hermetic adapter through AstroNvim mappings"
8888
dap.adapters.astronvim_fixture = {
8989
type = "executable",
9090
command = nvim,
91-
args = { "-l", %s },
91+
args = { "--headless", "-l", %s },
9292
}
9393
local source = %s
9494
local launch_path = vim.fs.joinpath(vim.fs.dirname(source), ".vscode", "launch.json")

‎tests/e2e/lsp_spec.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ T["LSP-E2E-01 attaches a real local server, registers a capability, and formats"
2828
vim.env.ASTRONVIM_E2E_LSP_LOG = log_path
2929
local nvim = vim.env.ASTRONVIM_TEST_NVIM or vim.v.progpath
3030
vim.lsp.config("astronvim-e2e-lsp", {
31-
cmd = { nvim, "-l", server },
31+
cmd = { nvim, "--headless", "-l", server },
3232
root_dir = project,
3333
filetypes = { "text" },
3434
})

0 commit comments

Comments
 (0)