Giter VIP home page Giter VIP logo

Comments (6)

jakemcc avatar jakemcc commented on July 23, 2024

Hey @didibus, thanks for taking the time to suggest this. It is always great to hear from a user of test-refresh.

What test-runner are you using?

My current thinking is this is a feature that probably won't get added and then supported forever since a similar goal can be achieve with the current implementation of test selectors.

Any reason why you don't use those?

from test-refresh.

didibus avatar didibus commented on July 23, 2024

Maybe I'm missing something about the test-selectors, but I thought they required you to add meta to your functions?

My build system test-runner uses filenames to distinguish integ from unit tests. So I need my lein setup to be the same. Is that achievable with test-selectors?

from test-refresh.

jakemcc avatar jakemcc commented on July 23, 2024

It is!

The test-selectors get the metadata map for the deftest. This includes a :name key that points towards the test symbol. Below is an example that would only run tests for symbols that contain "integration"

  :test-selectors {:integration (fn [m]
                                  (clojure.string/includes? (str (:name m))
                                                            "integration"))}

from test-refresh.

jakemcc avatar jakemcc commented on July 23, 2024

Let me know if something like that doesn't work out for you. If it doesn't, I'd be interested in digging deeper.

from test-refresh.

jakemcc avatar jakemcc commented on July 23, 2024

Below is a combination of selectors that would cause the default case to not run integration tests. It also adds looking at the namespace.

  :test-selectors {:default (fn [m]
                              (not (or (clojure.string/includes? (str (:ns m)) "integration")
                                       (clojure.string/includes? (str (:name m)) "integration"))))
                   :integration (fn [m]
                                  (or (clojure.string/includes? (str (:ns m)) "integration")
                                      (clojure.string/includes? (str (:name m)) "integration")))}

from test-refresh.

jakemcc avatar jakemcc commented on July 23, 2024

Wrote up a blog post talking about this

from test-refresh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.