Skip to content

Commit 14e8af7

Browse files
committed
ci: initial attempt at busted tests
1 parent c8e2947 commit 14e8af7

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

.busted

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
return {
2+
_all = {
3+
coverage = false,
4+
lpath = "lua/?.lua;lua/?/init.lua",
5+
pattern = "module%.lua$",
6+
auto_insulate = false,
7+
},
8+
default = {
9+
verbose = true,
10+
},
11+
tests = {
12+
verbose = true,
13+
},
14+
}

.github/workflows/luarocks.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
2525
with:
2626
version: ${{ env.LUAROCKS_VERSION }}
27-
test_interpreters: null
27+
test_interpreters: |
28+
neovim-stable
2829
dependencies: |
2930
nvim-nio ~> 1.7
3031
lua-utils.nvim == 1.0.2

lua/neorg/core/modules.lua

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ local utils = require("neorg.core.utils")
4545
--- @field setup? fun(): neorg.module.setup? Function that is invoked before any other loading occurs. Should perform preliminary startup tasks.
4646
--- @field replaced? boolean If `true`, this means the module is a replacement for a core module. This flag is set automatically whenever `setup().replaces` is set to a value.
4747
--- @field on_event fun(event: neorg.event) A callback that is invoked any time an event the module has subscribed to has fired.
48+
--- @field tests function A function for running tests.
4849

4950
local modules = {}
5051

lua/neorg/modules/core/integrations/treesitter/module.lua

+8
Original file line numberDiff line numberDiff line change
@@ -911,4 +911,12 @@ module.events.subscribed = {
911911
},
912912
}
913913

914+
module.tests = function()
915+
describe("initial test to see if CI works (cannot be tested on a branch, must be tested on main, `act` doesn't work here, help)", function()
916+
it("should be working", function()
917+
assert.truthy("Yessir.")
918+
end)
919+
end)
920+
end
921+
914922
return module

0 commit comments

Comments
 (0)