Skip to content

Commit 46e331a

Browse files
committed
make path finder do nothing on server integration test
1 parent 47423e0 commit 46e331a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/test_server_integration.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,29 @@ local function setup_test_environment()
1313
table.insert(_G.notifications, { message = message, level = level, opts = opts })
1414
end
1515
_G.server = require("eca.server").new()
16+
1617
end
1718

1819
local T = MiniTest.new_set({
1920
hooks = {
2021
pre_case = function()
2122
child.restart({ "-u", "scripts/minimal_init.lua" })
2223
child.lua_func(setup_test_environment)
24+
child.lua([[
25+
package.preload["eca.path_finder"] = function()
26+
local M = {}
27+
28+
function M.new()
29+
return setmetatable({}, { __index = M })
30+
end
31+
32+
function M.find(arg)
33+
return ":" -- do nothing
34+
end
35+
36+
return M
37+
end
38+
]])
2339
end,
2440
post_case = function()
2541
child.lua("if _G.server and _G.server.process then _G.server.process:kill() end")
@@ -39,7 +55,7 @@ end
3955

4056
T["server"] = MiniTest.new_set()
4157
T["server"]["start"] = function()
42-
child.lua("_G.server.start({cmd = {'fake'}})")
58+
child.lua("_G.server.start()")
4359
eq(child.lua_get("_G.server.process"), vim.NIL)
4460
child.lua([[
4561
_G.server:start()

0 commit comments

Comments
 (0)