Skip to content
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

Feat: Maybe do something with nested suites? #4

Open
itsfrank opened this issue Nov 5, 2024 · 1 comment
Open

Feat: Maybe do something with nested suites? #4

itsfrank opened this issue Nov 5, 2024 · 1 comment

Comments

@itsfrank
Copy link
Owner

itsfrank commented Nov 5, 2024

Currently suites can be nested and they work, e.g.:

test.suite("A collection of test cases", function()
    test.case("case 1", function()
        check.is_true(false)
    end)

    test.suite("A nested suite", function()
        test.case("Case in a nested suite", function()
            check.is_true(false)
        end)
    end)
end)

This actually works fine, but there is no indication of the nesting in the output:

Screenshot 2024-11-05 at 10 52 23 AM

Would need to figure out 2 things:

  1. How to nicely report this, e.g. indent 1 level further? Combine suite names? etc..
  2. Interaction with focus/skip
    I think the most sensible way is for nested suites to inherit parent's focus/skip state?
    Focus in a nested suite should certainly not run parent suite's tests
@itsfrank
Copy link
Owner Author

itsfrank commented Nov 5, 2024

The use-case here is probably for data-driven testing where a collection of tests are run on each element, one could wrap the nested suite in a for loop or something? I haven't had a need for this yet, so I wont work on this for now, but open to revisiting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant