Skip to content

Commit 9b68a95

Browse files
committed
test(replay): better way to wait for all events
1 parent a63d04e commit 9b68a95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/unit/renderer_spec.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ describe('renderer', function()
126126
local expected = helpers.load_test_data(expected_path)
127127

128128
helpers.replay_events(events)
129-
vim.wait(200)
129+
vim.wait(1000, function()
130+
return vim.tbl_isempty(state.event_manager.throttling_emitter.queue)
131+
end)
130132

131133
local actual = helpers.capture_output(state.windows and state.windows.output_buf, output_window.namespace)
132134
assert_output_matches(expected, actual, name)
@@ -141,7 +143,6 @@ describe('renderer', function()
141143

142144
local session_data = helpers.load_session_from_events(events)
143145
renderer._render_full_session_data(session_data)
144-
vim.wait(200)
145146

146147
local actual = helpers.capture_output(state.windows and state.windows.output_buf, output_window.namespace)
147148
assert_output_matches(expected, actual, name)

0 commit comments

Comments
 (0)