Skip to content

Commit

Permalink
Fix tests & CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gaymeowing committed Jul 28, 2024
1 parent b3a5676 commit e027599
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 474 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
run: |
find libs -name "*test.luau" | while read -r file; do
echo "Running test: $file"
lune "$file"
lune run "$file"
done
4 changes: 2 additions & 2 deletions libs/Ratelimit/ratelimit.test.luau
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local ratelimit = require("ratelimit")
local testkit = require("../testkit")
local testkit = require("../../testkit")

local TEST, CASE, CHECK, FINISH = testkit.test()

Expand All @@ -26,4 +26,4 @@ TEST("ratelimit", function()
end
end)

if not FINISH() then error(nil, 0) end
return FINISH
4 changes: 2 additions & 2 deletions libs/Url/url.test.luau
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local testkit = require("../testkit")
local testkit = require("../../testkit")
local url = require("url")

local TEST, CASE, CHECK, FINISH = testkit.test()
Expand Down Expand Up @@ -37,4 +37,4 @@ TEST("url", function()
end
end)

if not FINISH() then error(nil, 0) end
return FINISH
4 changes: 2 additions & 2 deletions libs/isempty/isempty.test.luau
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local testkit = require("../testkit")
local testkit = require("../../testkit")
local isempty = require("isempty")

local TEST, CASE, CHECK, FINISH = testkit.test()
Expand All @@ -13,4 +13,4 @@ TEST("isempty", function()
end
end)

if not FINISH() then error(nil, 0) end
return FINISH
24 changes: 24 additions & 0 deletions libs/race/race.test.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local testkit = require("../testkit")
local task = require("@lune/task")
local race = require("race")

local TEST, CASE, CHECK, FINISH = testkit.test()

TEST("RACE", function()
CASE("MAIN")

local result = race({
function(str: string)
task.wait(5)
return `{str}! i never return ;c`
end,
function(str: string)
task.wait(3)
return `{str}! i return!`
end
}, "yay")

CHECK(result == "yay! i return!")
end)

return FINISH
Loading

0 comments on commit e027599

Please sign in to comment.