forked from zbirenbaum/copilot.lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_command.lua
More file actions
39 lines (33 loc) · 1.07 KB
/
test_command.lua
File metadata and controls
39 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local child_helper = require("tests.child_helper")
local child = child_helper.new_child_neovim("test_suggestion")
local u = require("tests.utils")
local reference_screenshot = MiniTest.expect.reference_screenshot
local T = MiniTest.new_set({
hooks = {
pre_once = function() end,
pre_case = function()
child.run_pre_case()
child.bo.readonly = false
end,
post_once = child.stop,
},
})
T["command()"] = MiniTest.new_set()
T["command()"]["version works"] = function()
child.configure_copilot()
child.cmd("Copilot version")
local result = child.cmd_capture("mess")
u.expect_match(result, ".*copilot language server.*copilot%.lua.*Node%.js.*language%-server%.js.*")
end
T["command()"]["panel toggle - open works"] = function()
child.configure_copilot()
child.cmd("Copilot panel toggle")
reference_screenshot(child.get_screenshot())
end
T["command()"]["panel toggle - close works"] = function()
child.configure_copilot()
child.cmd("Copilot panel toggle")
child.cmd("Copilot panel toggle")
reference_screenshot(child.get_screenshot())
end
return T