Skip to content

Commit 5f54f91

Browse files
committed
ci: fix tests
1 parent 8ff441d commit 5f54f91

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

tests/color_spec.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ describe("Override config with color utility", function()
1515

1616
one_monokai.setup(expected)
1717

18-
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
18+
vim.schedule(function()
19+
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
1920

20-
assert.equal("#41143a", ("#%06x"):format(hl.fg))
21+
assert.equal("#41143a", ("#%06x"):format(hl.fg))
22+
end)
2123
end)
2224

2325
it("could use lighten utility", function()
@@ -34,8 +36,10 @@ describe("Override config with color utility", function()
3436

3537
one_monokai.setup(expected)
3638

37-
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
39+
vim.schedule(function()
40+
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
3841

39-
assert.equal("#c094b9", ("#%06x"):format(hl.fg))
42+
assert.equal("#c094b9", ("#%06x"):format(hl.fg))
43+
end)
4044
end)
4145
end)

tests/config_spec.lua

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ describe("Override config", function()
4343
end)
4444

4545
it("should change default highlights", function()
46-
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
46+
vim.schedule(function()
47+
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
4748

48-
assert.equal(expected.colors.lmao, ("#%06x"):format(hl.fg))
49-
assert.is_true(hl.italic)
49+
assert.equal(expected.colors.lmao, ("#%06x"):format(hl.fg))
50+
assert.is_true(hl.italic)
51+
end)
5052
end)
5153

5254
it("should disable all italics", function()
@@ -83,10 +85,12 @@ describe("Override wrong config", function()
8385
end)
8486

8587
it("should fallback to default highlights", function()
86-
local default = require "one_monokai.highlights.groups"
87-
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
88+
vim.schedule(function()
89+
local default = require "one_monokai.highlights.groups"
90+
local hl = vim.api.nvim_get_hl(0, { name = "Normal" })
8891

89-
assert.equal(default.Normal.fg, ("#%06x"):format(hl.fg))
90-
assert.is_nil(hl.italic)
92+
assert.equal(default.Normal.fg, ("#%06x"):format(hl.fg))
93+
assert.is_nil(hl.italic)
94+
end)
9195
end)
9296
end)

0 commit comments

Comments
 (0)