Skip to content

Nested Test.only are ignored #638

@jfmengels

Description

@jfmengels

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions