just ported cognitect-labs/test-runner to nbb https://github.com/nextjournal/nbb-test-runner
Maybe something like deps.cljs needs to be implemented for nbb as well
Mornin. Something like deps.cljs would be amazing
@mkvlr Afternoon. Replaced glob and fixed async issues with https://github.com/nextjournal/nbb-test-runner/pull/1
@cldwalker excellent, thank you!
we donβt need /-main here, do we?
yarn nbb -cp test -m nextjournal.test-runnerAh yep. Amended commit
@cdlwalker merged, thank you!
Great! If you'd ever need a CLI for the runner, happy to add one. Added one for nbb-logseq as described at https://github.com/logseq-cldwalker/nbb-test-runner/tree/add-cli#cli. It's handy for quickly running tests on small nbb-compatible, cljs repos with no deps
For example, I was able to pull up to https://github.com/logseq/logseq/tree/master/deps/common which uses cljs-test-runner and was able to run the test suite instantly. So much better than waiting for cljs-test-runner or even its watch mode
hm nice
Thank you very much for nbb-test-runner
@geraldodev thank you, glad to hear you find it useful
mk@mkair ~/d/nbb-test-runner (master)> yarn nbb -m nextjournal.test-runner --test-help
yarn run v1.22.19
$ /Users/mk/dev/nbb-test-runner/node_modules/.bin/nbb -m nextjournal.test-runner --test-help
USAGE:
clj -m nextjournal.test-runner <options>
-d, --dir DIRNAME Name of the directory containing tests. Defaults to "test".
-n, --namespace SYMBOL Symbol indicating a specific namespace to test.
-r, --namespace-regex REGEX Regex for namespaces to test.
-v, --var SYMBOL Symbol indicating the fully qualified name of a specific test.
-i, --include KEYWORD Run only tests that have this metadata keyword.
-e, --exclude KEYWORD Exclude tests with this metadata keyword.
-H, --test-help Display this help message
All options may be repeated multiple times for a logical OR effect.
If neither -n nor -r is supplied, use -r #".*-test$" (ns'es ending in '-test')
β¨ Done in 0.23s.Nice! Look forward to trying this out. I have enough nbb tests that I'd love to swap in a test runner
@cldwalker let me know how it goes for you
Sure. Looks like it depends on the glob lib. One weakness of the current nbb.edn approach is all consumers of a nbb.edn have to add those npm libs locally. When I have time I could rewrite the glob/sync with native node libs if you'd like
yeah, that would be nice, PR very welcome. I just pasted the code from the glob example in nbb.