Skip to content

Commit 46a97dc

Browse files
committed
test: failing tests on win32 environments
1 parent a267b21 commit 46a97dc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_nodejs.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,17 @@ T["get_execute_command()"]["default node command, default server path"] = functi
111111
local nodejs = require("copilot.lsp.nodejs")
112112
eq(nodejs.setup(), true)
113113
local cmd = nodejs.get_execute_command()
114-
eq(cmd, { "node", stub.default_server_path, "--stdio" })
114+
eq(cmd, { "node", vim.fn.expand(stub.default_server_path), "--stdio" })
115115
end)
116116
eq(captured_path, stub.default_server_path)
117117
end
118118

119119
T["get_execute_command()"]["default node command, custom server path"] = function()
120120
stub.get_runtime_server_path(function()
121121
local nodejs = require("copilot.lsp.nodejs")
122-
eq(nodejs.setup(nil, stub.custom_server_path), true)
122+
eq(nodejs.setup(nil, vim.fn.expand(stub.custom_server_path)), true)
123123
local cmd = nodejs.get_execute_command()
124-
eq(cmd, { "node", stub.custom_server_path, "--stdio" })
124+
eq(cmd, { "node", vim.fn.expand(stub.custom_server_path), "--stdio" })
125125
end)
126126
end
127127

@@ -130,7 +130,7 @@ T["get_execute_command()"]["custom node command as string, default server path"]
130130
local nodejs = require("copilot.lsp.nodejs")
131131
eq(nodejs.setup("/usr/local/bin/node"), true)
132132
local cmd = nodejs.get_execute_command()
133-
eq(cmd, { "/usr/local/bin/node", stub.default_server_path, "--stdio" })
133+
eq(cmd, { "/usr/local/bin/node", vim.fn.expand(stub.default_server_path), "--stdio" })
134134
end)
135135
eq(captured_path, stub.default_server_path)
136136
end
@@ -149,7 +149,7 @@ T["get_execute_command()"]["custom node command as string with spaces, default s
149149
local nodejs = require("copilot.lsp.nodejs")
150150
nodejs.setup("/path to/node")
151151
local cmd = nodejs.get_execute_command()
152-
eq(cmd, { "/path to/node", stub.default_server_path, "--stdio" })
152+
eq(cmd, { "/path to/node", vim.fn.expand(stub.default_server_path), "--stdio" })
153153
end)
154154
eq(captured_path, stub.default_server_path)
155155
end
@@ -168,7 +168,7 @@ T["get_execute_command()"]["custom node command as table, default server path"]
168168
local nodejs = require("copilot.lsp.nodejs")
169169
nodejs.setup({ "mise", "x", "node@lts", "--", "node" })
170170
local cmd = nodejs.get_execute_command()
171-
eq(cmd, { "mise", "x", "node@lts", "--", "node", stub.default_server_path, "--stdio" })
171+
eq(cmd, { "mise", "x", "node@lts", "--", "node", vim.fn.expand(stub.default_server_path), "--stdio" })
172172
end)
173173
eq(captured_path, stub.default_server_path)
174174
end

0 commit comments

Comments
 (0)