8000 Update Value.spec.lua by Dionysusnu · Pull Request #165 · dphfox/Fusion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update Value.spec.lua #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/State/Value.spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local Package = game:GetService("ReplicatedStorage").Fusion
local Value = require(Package.State.Value)
local Computed = require(Package.State.Computed)
local ForValues = require(Package.State.ForValues)

local waitForGC = require(script.Parent.Parent.Utility.waitForGC)

Expand Down 5DFC Expand Up @@ -35,12 +35,13 @@ return function()

it("should not garbage-collect objects in use", function()
local value = setmetatable({ { 2 } }, { __mode = "kv" })
local computed = Computed(Value(value[1]), function(innerValue)
local transformed = ForValues(Value(value[1]), function(innerValue)
return innerValue[1] + 1
end)

waitForGC()

expect(value[1]).never.to.equal(nil)
expect(transformed:get()[1]).to.equal(3)
end)
end
0