nbb

mkvlr 2023-03-29T19:57:38.336169Z

just ported cognitect-labs/test-runner to nbb https://github.com/nextjournal/nbb-test-runner

πŸŽ‰ 6
borkdude 2023-03-30T08:34:36.543309Z

Maybe something like deps.cljs needs to be implemented for nbb as well

πŸ‘ 1
2023-03-30T13:44:51.323559Z

Mornin. Something like deps.cljs would be amazing

2023-03-30T15:17:36.111549Z

@mkvlr Afternoon. Replaced glob and fixed async issues with https://github.com/nextjournal/nbb-test-runner/pull/1

πŸ’― 2
mkvlr 2023-03-30T15:40:49.429089Z

@cldwalker excellent, thank you!

mkvlr 2023-03-30T15:40:59.639659Z

we don’t need /-main here, do we?

mkvlr 2023-03-30T15:41:04.017999Z

yarn nbb -cp test -m nextjournal.test-runner

2023-03-30T15:44:34.441489Z

Ah yep. Amended commit

mkvlr 2023-03-30T16:01:17.392899Z

@cdlwalker merged, thank you!

2023-03-30T16:38:54.090119Z

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

2023-03-30T16:42:42.567449Z

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

borkdude 2023-03-30T17:11:19.080019Z

hm nice

2023-06-26T08:26:48.997829Z

Thank you very much for nbb-test-runner

mkvlr 2023-06-26T08:46:37.567889Z

@geraldodev thank you, glad to hear you find it useful

mkvlr 2023-03-29T19:58:01.562739Z

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.

2023-03-29T20:23:17.341819Z

Nice! Look forward to trying this out. I have enough nbb tests that I'd love to swap in a test runner

mkvlr 2023-03-29T20:31:55.460269Z

@cldwalker let me know how it goes for you

2023-03-29T20:43:35.074309Z

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

mkvlr 2023-03-29T20:45:07.008709Z

yeah, that would be nice, PR very welcome. I just pasted the code from the glob example in nbb.

πŸ‘ 1