Fork me on GitHub

I get

-> build target: :browser stage: :flush
invalid :module-hash-names value :duude
{:tag, :module-hash-names :duude}
ExceptionInfo: invalid :module-hash-names value :duude (browser.clj:411) (browser.clj:389) (browser.clj:421)


also for the cli arguments themselves order doesn't matter. they are all applied before the build is started.


I’m making an internal library project in a monorepo. We’re using deps.edn for dependencies and the library is then a local dependency. When working on it I find it the most convenient to use it from an app, so I can end-to-end test manually as I work. Is there a way I can make shadow-cljs auto-run the tests for the library while working like this? It rebuilds the app as I change stuff in the library implementation, but I can’t figure out how to make the same thing happen with the library tests…


@pez I assume putting a shadow-cljs.edn into the lib and running the tests there is not the answer you are looking for?


Well, that’s what I am doing now. It works. I was thinking it would be more convenient for my use case if the test-runner for the the “using” project would just pick up the tests of the library and run them as well. I might have misconfigured something when trying because only changes to the implementation of the library triggers shadow to rebuild, changes to the tests don’t…


(The misconfiguration is about my attempts to get the tests to run unified in the using app. I have the library tests auto-loaded with the separate test watcher way of doing things.)


well are the tests on the classpath of the main project?


if so they should be picked up when using :local/root?


I assume you are talking about a regular :node-test or :browser-test setup in the main project running as a watch?


Yes, :node-test . I have this: main-project/shadow-cljs.edn:

 {:app {,,,}
  :test {:target  :node-test, :output-to "target/test/test.js"
         :autorun true}}
 :deps {:aliases [:dev :test]}}
:deps {,,,
        library/library {:local/root "../library"}
{:paths ["src"]
 :aliases {:test {:extra-paths ["test"]
                  :extra-deps {thheller/shadow-cljs {:mvn/version "2.16.7"}}}}}
(The extra-deps is for the separate test runner use case).


well so the tests are not on the classpath?


since they are in the test folder which is not on the classpath when loading in the main project since that doesn't activate the :test alias


I though :deps {:aliases [:dev :test]} would activate that.


I actually don't know for sure but I don't think so


this isn't something shadow-cljs can control or change its a tools.deps thing


I would expect that it only activates those aliases for the project but not for any :local/root dependencies


I have one more clue. In one of my “using” apps tests are in test/cljs and trying this from there gives me a ExceptionInfo: Resource does not have expected namespace error from shadow-cljs.


same classpath issue if the paths don't match the expected names


Yes, but it seems that the alias is active, doesn’t it? I’ll ask in #tools-deps and see if someone have an idea. It’s not a big issue, running a separate test watcher works and has its advantages.


just open a REPL on the main project and run ( "one/of_your_tests.cljs")


in general I'd recommend running tests in the library itself


Thanks. I’ll stick with that.