refactor(test): make helper test function more ergonomic

In my opinion, requiring user to access tests via `T["module_name"]`
was too fragile and typos prone.
This commit is contained in:
Olexandr Smirnov 2025-08-27 21:45:05 +03:00
parent 53ab4274c2
commit e90f766ea3
No known key found for this signature in database
8 changed files with 40 additions and 38 deletions

View file

@ -1,16 +1,16 @@
local t = require "spec.testutils"
local _, T = t.setup "config"
local _, T, config = t.setup "config"
T["config"]["can be called without any arguments passed"] = function()
config["can be called without any arguments passed"] = function()
---@diagnostic disable-next-line: missing-parameter
require("gopher").setup()
end
T["config"]["can be called with empty table"] = function()
config["can be called with empty table"] = function()
require("gopher").setup {}
end
T["config"]["should change option"] = function()
config["should change option"] = function()
local log_level = 1234567890
require("gopher").setup {
log_level = log_level,