diff options
| author | William Boman <william@redwill.se> | 2022-08-15 21:03:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-15 21:03:06 +0200 |
| commit | 3c62386a396ae0c1cd7adbaacc379eb4af072a65 (patch) | |
| tree | 4d00d20958839a04e6a996c11b97724c762e491a /tests/helpers | |
| parent | chore: update generated code (#295) (diff) | |
| download | mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.gz mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.bz2 mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.lz mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.xz mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.zst mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.zip | |
refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296)
Diffstat (limited to 'tests/helpers')
| -rw-r--r-- | tests/helpers/lua/luassertx.lua | 4 | ||||
| -rw-r--r-- | tests/helpers/lua/test_helpers.lua | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/helpers/lua/luassertx.lua b/tests/helpers/lua/luassertx.lua index 55ea0d72..3eba3fa4 100644 --- a/tests/helpers/lua/luassertx.lua +++ b/tests/helpers/lua/luassertx.lua @@ -3,9 +3,9 @@ local match = require "luassert.match" local a = require "mason-core.async" local function wait_for(_, arguments) - ---@type (fun()): Function to execute until it does not error. + ---@type (fun()) Function to execute until it does not error. local assertions_fn = arguments[1] - ---@type number: Timeout in milliseconds. Defaults to 5000. + ---@type number Timeout in milliseconds. Defaults to 5000. local timeout = arguments[2] timeout = timeout or 15000 diff --git a/tests/helpers/lua/test_helpers.lua b/tests/helpers/lua/test_helpers.lua index 57c0b4fe..fcb6a608 100644 --- a/tests/helpers/lua/test_helpers.lua +++ b/tests/helpers/lua/test_helpers.lua @@ -7,6 +7,7 @@ local InstallHandle = require "mason-core.installer.handle" local InstallContext = require "mason-core.installer.context" local registry = require "mason-registry" +-- selene: allow(unused_variable) function async_test(suspend_fn) return function() local ok, err = pcall(a.run_blocking, suspend_fn) @@ -16,6 +17,7 @@ function async_test(suspend_fn) end end +-- selene: allow(unscoped_variables, incorrect_standard_library_use) mockx = { just_runs = function() end, returns = function(val) @@ -30,13 +32,15 @@ mockx = { end, } +-- selene: allow(unused_variable) ---@param package_name string function InstallHandleGenerator(package_name) return InstallHandle.new(registry.get_package(package_name)) end +-- selene: allow(unused_variable) ---@param handle InstallHandle ----@param opts InstallContextOpts | nil +---@param opts InstallContextOpts? function InstallContextGenerator(handle, opts) local context = InstallContext.new(handle, opts or {}) context.spawn = setmetatable({}, { |
