From b923599d0428357a2fce16503da56075f61954fb Mon Sep 17 00:00:00 2001 From: Vhyrro Date: Tue, 21 May 2024 18:13:00 +0200 Subject: [PATCH] chore(busted): move tests to separate file for simplicity --- .busted | 3 +-- lua/neorg/core/modules.lua | 1 - .../modules/core/integrations/treesitter/module.lua | 11 ----------- .../modules/core/integrations/treesitter/tests.lua | 10 ++++++++++ 4 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 lua/neorg/modules/core/integrations/treesitter/tests.lua diff --git a/.busted b/.busted index 0c3d6e0f7..c3a5c6566 100644 --- a/.busted +++ b/.busted @@ -2,8 +2,7 @@ return { _all = { coverage = false, lpath = "lua/?.lua;lua/?/init.lua", - pattern = "module%.lua$", - -- auto_insulate = false, + pattern = "tests%.lua$", ROOT = { "lua/" }, }, default = { diff --git a/lua/neorg/core/modules.lua b/lua/neorg/core/modules.lua index d2b18e18b..793837cfc 100644 --- a/lua/neorg/core/modules.lua +++ b/lua/neorg/core/modules.lua @@ -45,7 +45,6 @@ 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 = {} diff --git a/lua/neorg/modules/core/integrations/treesitter/module.lua b/lua/neorg/modules/core/integrations/treesitter/module.lua index 1cb7057fb..6964ec808 100644 --- a/lua/neorg/modules/core/integrations/treesitter/module.lua +++ b/lua/neorg/modules/core/integrations/treesitter/module.lua @@ -911,15 +911,4 @@ 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 diff --git a/lua/neorg/modules/core/integrations/treesitter/tests.lua b/lua/neorg/modules/core/integrations/treesitter/tests.lua new file mode 100644 index 000000000..a8358dbfe --- /dev/null +++ b/lua/neorg/modules/core/integrations/treesitter/tests.lua @@ -0,0 +1,10 @@ +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() + local _ = require("neorg.modules.core.integrations.treesitter.module") + + it("should be working", function() + assert.truthy("Yessir.") + end) + end +)