Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Commit 7e3048d

Browse files
committed
fix: tests
1 parent 0117478 commit 7e3048d

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ jobs:
4040
- name: generate documentation
4141
run: make documentation-ci
4242

43-
- name: check docs diff
44-
run: exit $(git status --porcelain doc | wc -l | tr -d " ")
43+
- name: Commit changes
44+
uses: stefanzweifel/git-auto-commit-action@v4
45+
with:
46+
commit_message: "chore: Auto generate docs"
4547

4648
tests:
4749
needs:
@@ -51,7 +53,7 @@ jobs:
5153
timeout-minutes: 2
5254
strategy:
5355
matrix:
54-
neovim_version: ["v0.7.2", "v0.8.3", "v0.9.1", "nightly"]
56+
neovim_version: ["v0.9.1", "nightly"]
5557

5658
steps:
5759
- uses: actions/checkout@v3

lua/commit-msg-sg/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function M.setup(opts)
3131
on_attach_(client, bufnr)
3232
end
3333
end
34-
config.setup(opts)
34+
M.config = config.setup(opts)
3535
if
3636
config.options.default_prompt
3737
and config.options.default_prompt
@@ -123,4 +123,6 @@ function M.write()
123123
end)
124124
end
125125

126+
_G.CommitMsgSg = M
127+
126128
return M

tests/test_API.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ local T = MiniTest.new_set({
2525
-- Tests related to the `setup` method.
2626
T["setup()"] = MiniTest.new_set()
2727

28+
T["setup()"]["sets exposed methods and default options value"] = function()
29+
child.lua([[require('commit-msg-sg').setup()]])
30+
31+
-- global object that holds your plugin information
32+
eq_type_global(child, "_G.CommitMsgSg", "table")
33+
34+
-- config
35+
eq_type_global(child, "_G.CommitMsgSg.config", "table")
36+
37+
-- assert the value, and the type
38+
eq_config(child, "debug", false)
39+
eq_type_config(child, "debug", "boolean")
40+
end
41+
2842
T["setup()"]["overrides default values"] = function()
2943
child.lua([[require('commit-msg-sg').setup({
3044
-- write all the options with a value different than the default ones

0 commit comments

Comments
 (0)