rtfeldman / rtfeldman/node-test-runner

Nested Test.only are ignored

Open
#638 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
140
Forks
83
Avg merge
8h 25m
Merged PRs (30d)
5

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SSCCE in module A and run it through the node-test-runner test workflow to reproduce the nested Test.only behavior. Trace the handling of Test.only selections and verify that the completed behavior runs only “is correctly run,” while skipping “is run but SHOULDN'T” and “is correctly skipped”.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm, javascript, node.js
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.