Ukendio / jecs

A fast, portable Entity Component System for Luau
https://ukendio.github.io/jecs/
MIT License
146 stars 26 forks source link

Implement testkit FOCUS() #87

Closed alicesaidhi closed 2 months ago

alicesaidhi commented 3 months ago

Add FOCUS() to testkit to allow for focusing on certain tests.

usage:

TEST("focused test", function()
    FOCUS()

    do CASE "meow"
        CHECK("meow")
    end
end)

TEST("unfocused test", function()

    do CASE "ignored"

    end

    do CASE "focused meow"
        FOCUS()
        CHECK("meow")
    end
end)

this would output:

focused test
PASS│ meow

unfocused test
PASS│ focused meow

3/3 test cases passed in 0.584 ms.
2/2 focused test cases passed
0 fails
Ukendio commented 3 months ago

it should separate the general and the testkit changes into different PRs

Ukendio commented 3 months ago

Also I have changed my mind, I want FOCUS not to run the unfocused tests. Although I am not sure how that could be accomplished...

alicesaidhi commented 3 months ago

Also I have changed my mind, I want FOCUS not to run the unfocused tests. Although I am not sure how that could be accomplished...

not possible without changing syntax

it should separate the general and the testkit changes into different PRs

how would i even do this without force-pushing..

Ukendio commented 3 months ago

how would i even do this without force-pushing.. If you checked out from main then just need to reset and integrate these changes. But if you checked out from the benchmark branch then you have to rebase!

Ukendio commented 3 months ago

how would i even do this without force-pushing.. If you checked out from main then just need to reset and integrate these changes. But if you checked out from the benchmark branch then you have to rebase!

If you would prefer, I can do it myself and close this issue. But no contribution brownie points ☹️