Skip to content

Commit

Permalink
test(store): tweak _clear and _cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MunifTanjim committed Jan 4, 2024
1 parent 2de6572 commit 629f492
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lua/nougat/store/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ end
---@param target_type? ''|'buf'|'win'|'tab'
---@param target_name? string
function mod._clear(target_type, target_name)
-- wait a bit for pending tasks
vim.wait(10)

for store_type, store_by_name in pairs(registry) do
if store_type == (target_type or store_type) then
for name, store in pairs(store_by_name) do
Expand All @@ -182,6 +185,9 @@ end
---@param target_type? ''|'buf'|'win'|'tab'
---@param target_name? string
function mod._cleanup(target_type, target_name)
-- wait a bit for pending tasks
vim.wait(10)

for store_type, store_by_name in pairs(registry) do
if store_type == (target_type or store_type) then
for name in pairs(store_by_name) do
Expand Down
2 changes: 0 additions & 2 deletions tests/nougat/nut/git/status_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ describe("nut.git.status", function()
local nut

before_each(function()
vim.wait(0)

require("nougat.store")._clear()

bar = Bar("statusline")
Expand Down

0 comments on commit 629f492

Please sign in to comment.