mirror of
https://github.com/0x5eal/semver-luau.git
synced 2024-12-12 15:00:36 +00:00
chore(lune): include frktest-powered test runner
This commit is contained in:
parent
9871570c66
commit
b6d006e1bc
1 changed files with 24 additions and 0 deletions
24
.lune/test.luau
Normal file
24
.lune/test.luau
Normal file
|
@ -0,0 +1,24 @@
|
|||
--> Run tests using frktest runner
|
||||
|
||||
local fs = require("@lune/fs")
|
||||
local process = require("@lune/process")
|
||||
|
||||
local frktest = require("@pkg/frktest")
|
||||
|
||||
-- HACK: Cast require to allow for dynamic paths in strict mode
|
||||
-- A more proper solution would be to use luau.load instead, but
|
||||
-- frktest requires its global state to be modified by test suites
|
||||
local require = require :: (path: string) -> () -> ()
|
||||
|
||||
if process.args[1] ~= nil then
|
||||
require("../tests/" .. process.args[1])()
|
||||
else
|
||||
for _, test in fs.readDir("tests") do
|
||||
require("../tests/" .. test)()
|
||||
end
|
||||
end
|
||||
|
||||
frktest.reporters.lune.init()
|
||||
if not frktest.core.run() then
|
||||
process.exit(1)
|
||||
end
|
Loading…
Reference in a new issue