thheller / thheller/shadow-cljs

Feature request: focus on tests

Open
#898 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
2.4k
Forks
192
Avg merge
3h 11m
Merged PRs (30d)
1

Description

Would it be possible for the test runners to allow focusing on single tests?

What I have in mind is similar to what lein-test-refresh does: https://github.com/jakemcc/lein-test-refresh#built-in-test-narrowing-test-selector. You mark one or more tests with a metadata flag, and then only those get executed.

I think that it should be possible to build this into https://github.com/thheller/shadow-cljs/blob/8169e663c0338ab01b31726b0cfcd7005563c581/src/main/shadow/test/env.clj, but I think it should be activated by a parameter so that you don't accidentally forget a focus mark and disable most tests of an automatic pipeline.

Contributor guide

Open the contributing guide

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 src/main/shadow/test/env.clj and compare the requested behavior with lein-test-refresh's test selector. Determine how a parameter should activate metadata-based focus selection without changing the default test run. Done means one or more marked tests run only when explicitly enabled, while automatic pipelines still execute the full suite by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.