Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Dec 8, 2021
1 parent ff57bf0 commit 9e759b6
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Run tests
run: run-in-roblox --place test.rbxl --script ci.lua > test-out.txt
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 3

- name: Check test status
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions modules/component/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local Component = require(script.Parent)
Expand Down
2 changes: 2 additions & 0 deletions modules/enum-list/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local EnumList = require(script.Parent)
Expand Down
2 changes: 2 additions & 0 deletions modules/option/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local Option = require(script.Parent)
Expand Down
2 changes: 2 additions & 0 deletions modules/ser/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local Ser = require(script.Parent)
Expand Down
2 changes: 2 additions & 0 deletions modules/signal/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

local function AwaitCondition(predicate, timeout)
local start = os.clock()
timeout = (timeout or 10)
Expand Down
2 changes: 2 additions & 0 deletions modules/symbol/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local Symbol = require(script.Parent)
Expand Down
2 changes: 2 additions & 0 deletions modules/table-util/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local TableUtil = require(script.Parent)
Expand Down
10 changes: 6 additions & 4 deletions modules/timer/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local Timer = require(script.Parent)
Expand All @@ -22,19 +24,19 @@ return function()
end)

it("should tick appropriately", function()
local start = time()
local start = os.clock()
timer:Start()
timer.Tick:Wait()
local duration = (time() - start)
local duration = (os.clock() - start)
expect(duration).to.be.near(duration, 0.02)
end)

it("should start immediately", function()
local start = time()
local start = os.clock()
local stop = nil
timer.Tick:Connect(function()
if not stop then
stop = time()
stop = os.clock()
end
end)
timer:StartNow()
Expand Down
2 changes: 2 additions & 0 deletions modules/trove/init.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
print("Running test for " .. script.Parent.Name)

return function()

local Trove = require(script.Parent)
Expand Down

0 comments on commit 9e759b6

Please sign in to comment.