diff --git a/.luacheckrc b/.luacheckrc index cfd0d448..2bb24248 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -26,8 +26,9 @@ stds.testez = { read_globals = { "describe", "it", "itFOCUS", "itSKIP", - "FOCUS", "SKIP", "HACK_NO_XPCALL", + "FOCUS", "SKIP", "expect", + "beforeEach", "afterEach", "beforeAll", "afterAll", } } diff --git a/bin/run-tests.server.lua b/bin/run-tests.server.lua index cc51dabb..d4df9f36 100644 --- a/bin/run-tests.server.lua +++ b/bin/run-tests.server.lua @@ -12,14 +12,15 @@ Roact.setGlobalConfig({ ["elementTracing"] = true, ["propValidation"] = true, }) -local results = TestEZ.TestBootstrap:run(ReplicatedStorage.Roact, TestEZ.Reporters.TextReporter) +local results = TestEZ.TestBootstrap:run( + { ReplicatedStorage.Roact }, + TestEZ.Reporters.TextReporter +) -local statusCode = results.failureCount == 0 and 0 or 1 +local statusCode = (results.failureCount == 0 and #results.errors == 0) and 0 or 1 if __LEMUR__ then - if results.failureCount > 0 then - os.exit(statusCode) - end + os.exit(statusCode) elseif isRobloxCli then - ProcessService:Exit(statusCode) + ProcessService:ExitAsync(statusCode) end \ No newline at end of file diff --git a/bin/spec.lua b/bin/spec.lua index b6d0f792..616a10f4 100644 --- a/bin/spec.lua +++ b/bin/spec.lua @@ -5,7 +5,7 @@ -- If you add any dependencies, add them to this table so they'll be loaded! local LOAD_MODULES = { {"src", "Roact"}, - {"modules/testez/lib", "TestEZ"}, + {"modules/testez/src", "TestEZ"}, } -- This makes sure we can load Lemur and other libraries that depend on init.lua diff --git a/modules/testez b/modules/testez index 5acef965..25d957d4 160000 --- a/modules/testez +++ b/modules/testez @@ -1 +1 @@ -Subproject commit 5acef9659a177d446800e986b60e4613a35eb418 +Subproject commit 25d957d4d5c4c02a52843ef43e72f21f973c2908 diff --git a/place.project.json b/place.project.json index 7807792f..96dc18f4 100644 --- a/place.project.json +++ b/place.project.json @@ -11,7 +11,7 @@ }, "TestEZ": { - "$path": "modules/testez/lib" + "$path": "modules/testez" } }, diff --git a/src/RobloxRenderer.spec.lua b/src/RobloxRenderer.spec.lua index 4735f78f..99e3a1af 100644 --- a/src/RobloxRenderer.spec.lua +++ b/src/RobloxRenderer.spec.lua @@ -1,4 +1,6 @@ return function() + local ReplicatedStorage = game:GetService("ReplicatedStorage") + local assertDeepEqual = require(script.Parent.assertDeepEqual) local Binding = require(script.Parent.Binding) local Children = require(script.Parent.PropMarkers.Children) @@ -950,6 +952,17 @@ return function() describe("Integration Tests", function() + local temporaryParent = nil + beforeEach(function() + temporaryParent = Instance.new("Folder") + temporaryParent.Parent = ReplicatedStorage + end) + + afterEach(function() + temporaryParent:Destroy() + temporaryParent = nil + end) + it("should not allow re-entrancy in updateChildren", function() local configValues = { tempFixUpdateChildrenReEntrancy = true, @@ -1007,7 +1020,7 @@ return function() end local parent = Instance.new("ScreenGui") - parent.Parent = game.CoreGui + parent.Parent = temporaryParent local tree = createElement(ParentComponent) @@ -1101,7 +1114,7 @@ return function() end local parent = Instance.new("ScreenGui") - parent.Parent = game.CoreGui + parent.Parent = temporaryParent local tree = createElement(ParentComponent) @@ -1235,7 +1248,7 @@ return function() end local parent = Instance.new("ScreenGui") - parent.Parent = game.CoreGui + parent.Parent = temporaryParent local tree = createElement(ParentComponent) @@ -1335,7 +1348,7 @@ return function() end local parent = Instance.new("ScreenGui") - parent.Parent = game.CoreGui + parent.Parent = temporaryParent local tree = createElement(ParentComponent)