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

Nested Test.only are ignored #638

Open
jfmengels opened this issue Jan 12, 2025 · 1 comment
Open

Nested Test.only are ignored #638

jfmengels opened this issue Jan 12, 2025 · 1 comment

Comments

@jfmengels
Copy link
Contributor

I really like to use Test.only when doing test-driven development, and I relatively often end up with nested Test.only (one on a describe and another one on a test inside it.

When this happens, the Test.only on the individual test is ignored, and the only one that is taken into account is the one on the describe, which is quite annoying.

SSCCE

module A exposing (tests)

import Expect
import Test exposing (..)


tests : Test
tests =
    describe "All tests"
        [ Test.only <|
            describe "Only tests"
                [ Test.only <| test "is correctly run" <| \() -> Expect.equal 1 1
                , test "is run but SHOULDN'T" <| \() -> Expect.equal 1 2
                ]
        , test "is correctly skipped" <| \() -> Expect.equal 1 2
        ]

This runs tests "is correctly run" and "is run but SHOULDN'T", though I would expect it only run the former test.

@jfmengels
Copy link
Contributor Author

Seems like I had already created an issue in the Elm package's issues: elm-explorations/test#128.

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