Skip to content

Commit d3ee0f1

Browse files
authored
test(util): slightly decrease debounce delay to avoid test failures due to clock jitter (#18)
1 parent bea06de commit d3ee0f1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/nes/test_nes.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ T["nes"] = MiniTest.new_set({
99
pre_case = function()
1010
child.restart({ "-u", "scripts/minimal_init.lua" })
1111
child.lua_func(function()
12+
vim.g.copilot_nes_debounce = 450
1213
vim.lsp.config("copilot", {
1314
cmd = require("tests.mock_lsp").server,
1415
})

tests/test_util.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ T["debounce"]["debounces calls to a function"] = function()
1919
_G.called = _G.called + 1
2020
end
2121

22-
local debounced_fn = require("copilot-lsp.util").debounce(fn, 500)
22+
local debounced_fn = require("copilot-lsp.util").debounce(fn, 450)
2323
debounced_fn()
2424
end)
2525

@@ -46,7 +46,7 @@ T["debounce"]["function is called with final calls params"] = function()
4646
_G.called = a
4747
end
4848

49-
local debounced_fn = require("copilot-lsp.util").debounce(fn, 500)
49+
local debounced_fn = require("copilot-lsp.util").debounce(fn, 450)
5050
debounced_fn(1)
5151
debounced_fn(2)
5252
debounced_fn(3)
@@ -72,7 +72,7 @@ T["debounce"]["function is only called once"] = function()
7272
table.insert(_G.called, a)
7373
end
7474

75-
_G.debounced_fn = require("copilot-lsp.util").debounce(fn, 250)
75+
_G.debounced_fn = require("copilot-lsp.util").debounce(fn, 200)
7676
end)
7777

7878
child.lua_func(function()

0 commit comments

Comments
 (0)