To isolate specific tests while working on code, TestEZ provides FOCUS() and SKIP() functions. These allow you to run only the code blocks you are currently interested in or to bypass specific blocks entirely.
Using FOCUS() and SKIP() in describe blocks
You can call FOCUS() or SKIP() directly inside a describe block. Because describe blocks are executed immediately to build the test tree, these calls will affect all tests contained within that block.
Using itFOCUS and itSKIP for it blocks
FOCUS() and SKIP() do not work inside it blocks because the code inside an it block is not executed until the test runner actually runs the tests. To focus or skip a specific test case, use the specialized itFOCUS and itSKIP functions instead.
!!! warning
FOCUS and SKIP are intended exclusively for development. Do not check tests containing these calls into version control. Future versions of TestEZ may detect these in CI environments and fail the build to prevent accidental commits.
return function()
describe("new", function()
FOCUS()
it("does really important things", function()
-- This block will run!
end)
end)
itFOCUS("has all methods we expect", function()
-- Calling FOCUS() would be too late here, so we use itFOCUS instead.
-- This block will run, too
end)
describe("Format()", function()
it("formats things", function()
-- This block will never run!
end)
end)
end