Skip to content

Commit

Permalink
Adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Dec 10, 2024
1 parent 6632070 commit 9524f9a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
27 changes: 15 additions & 12 deletions modules/shake/init.test.luau
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ return function(ctx: Test.TestContext)
end
local shake2 = shake1:Clone()
ctx:Expect(shake2):ToBeA("table")
ctx:Expect(getmetatable(shake2)):ToBe(Shake)
ctx:Expect(getmetatable(shake2)):ToBe(getmetatable(shake1))
ctx:Expect(shake2):Not():ToBe(shake1)
local clonedFields = {
"Amplitude",
Expand All @@ -79,7 +79,7 @@ return function(ctx: Test.TestContext)
"RotationInfluence",
"TimeFunction",
}
for _, field in ipairs(clonedFields) do
for _, field in clonedFields do
ctx:Expect(shake1[field]):ToBe(shake2[field])
end
end)
Expand Down Expand Up @@ -249,16 +249,19 @@ return function(ctx: Test.TestContext)
ctx:Expect(connection.Connected):ToBe(false)
end)

ctx:Test("should bind to render step", function()
local shake = Shake.new()
shake.SustainTime = 0.1
shake:Start()
local bound = false
shake:BindToRenderStep("ShakeTest", Enum.RenderPriority.Last.Value, function()
bound = true
-- RenderStepped only works on the client:
if RunService:IsClient() and RunService:IsRunning() then
ctx:Test("should bind to render step", function()
local shake = Shake.new()
shake.SustainTime = 0.1
shake:Start()
local bound = false
shake:BindToRenderStep("ShakeTest", Enum.RenderPriority.Last.Value, function()
bound = true
end)
AwaitStop(shake)
ctx:Expect(bound):ToBe(true)
end)
AwaitStop(shake)
ctx:Expect(bound):ToBe(true)
end)
end
end)
end
3 changes: 0 additions & 3 deletions test/wally.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ name = "sleit/rbxutil"
version = "0.1.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
TestEZ = "roblox/testez@^0.4.1"

0 comments on commit 9524f9a

Please sign in to comment.