Skip to content

Commit

Permalink
ci: initial attempt at busted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed May 21, 2024
1 parent c8e2947 commit 14e8af7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
_all = {
coverage = false,
lpath = "lua/?.lua;lua/?/init.lua",
pattern = "module%.lua$",
auto_insulate = false,
},
default = {
verbose = true,
},
tests = {
verbose = true,
},
}
3 changes: 2 additions & 1 deletion .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
version: ${{ env.LUAROCKS_VERSION }}
test_interpreters: null
test_interpreters: |
neovim-stable
dependencies: |
nvim-nio ~> 1.7
lua-utils.nvim == 1.0.2
Expand Down
1 change: 1 addition & 0 deletions lua/neorg/core/modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ local utils = require("neorg.core.utils")
--- @field setup? fun(): neorg.module.setup? Function that is invoked before any other loading occurs. Should perform preliminary startup tasks.
--- @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.
--- @field on_event fun(event: neorg.event) A callback that is invoked any time an event the module has subscribed to has fired.
--- @field tests function A function for running tests.

local modules = {}

Expand Down
8 changes: 8 additions & 0 deletions lua/neorg/modules/core/integrations/treesitter/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -911,4 +911,12 @@ module.events.subscribed = {
},
}

module.tests = function()
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()
it("should be working", function()
assert.truthy("Yessir.")
end)
end)
end

return module

0 comments on commit 14e8af7

Please sign in to comment.