Giter VIP home page Giter VIP logo

Comments (7)

grzm avatar grzm commented on August 26, 2024

I believe this only needs to be called once, not on every test run. Perhaps have a "setup-fn" that's specified in project.clj and called in leiningen.test-refresh/test-refresh?

from test-refresh.

jakemcc avatar jakemcc commented on August 26, 2024

Interesting problem.

Allowing a generic setup-fn would allow lein-test-refresh users to do whatever they want (depending on implementationeither prior to every test run or just once before running any tests). That is an interesting approach as it would let people do whatever they want and I think would enable some neat things. If implemented for solving this problem it does put quite a burden on user of lein-test-refresh. I think the function would need to be called in the com.jakemccrary.test-refresh/monitor-project as that is when code is being evaluated within the context of the project.

Another approach would be to add a :refresh-dirs option that is similar to the :watch-dirs option. This feels a lot easier for users.

I won't be able to give a shot at either solution until sometime later this week. I'd most likely accept a PR for :refresh-dirs immediately. I'd need to think about the setup-fn idea a bit before getting that feature into the codebase.

from test-refresh.

jakemcc avatar jakemcc commented on August 26, 2024

Actually, was thinking about some weirdness I've been seeing in one of my own projects and wondering if its because of this problem. Going to build out the first option today.

from test-refresh.

jakemcc avatar jakemcc commented on August 26, 2024

Released 0.16.1-SNAPSHOT with a :refresh-dirs option. Check the sample.project.clj for what it looks like.

Sort of wondering if :watch-dirs and :refresh-dirs should be collapsed into a single option. I'm having a difficult time coming up with a scenario in which you would set one and not the other.

from test-refresh.

grzm avatar grzm commented on August 26, 2024

Thanks! From my initial testing, setting :refresh-dirs with 0.16.1-SNAPSHOT works for me!

I don't know enough about how Figwheel does its compilation, but I wonder if Figwheel could be convinced to place its compilation someplace other than where the final JavaScript output ends up. Of course that's an issue for a different project :)

Thanks again for your quick response!

from test-refresh.

jakemcc avatar jakemcc commented on August 26, 2024

Just released a non-snapshot release, 0.17.0, with this feature.

from test-refresh.

grzm avatar grzm commented on August 26, 2024

Thanks!

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.