From b1f81f350ba99ef5e6fc41d3901e8d925c981747 Mon Sep 17 00:00:00 2001 From: lread Date: Tue, 9 Dec 2025 13:48:33 -0500 Subject: [PATCH 1/2] docs: readme: describe bb tasks Triggered by a question on Slack, I've briefly described current bb tasks for this project. --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 10ba20f..da50dbd 100644 --- a/README.md +++ b/README.md @@ -109,12 +109,36 @@ These functions will follow symbolic links unless you pass in `{:nofollow-links Some babashka.fs functions accept the `:follow-links` option. These function will _not_ follow symbolic links unless you pass in `{:follow-links true}`. -## Test +## Test & Dev -``` clojure +To run all tests +``` $ bb test-all ``` +### Default Tests +To run default tests only: +``` +bb test +``` +To fire up a REPL when working on these tests, run `bb dev`. + +### Scratch CWD Tests +We setup a separate task for tests that need/prefer to be run from a scratch current working directory. +To run these tests only: +``` +bb test-cwd +``` +The scratch current working directory is `target/test-cwd`. +To fire up a REPL for these tests, run `bb dev-cwd`. +Note that the `.nrepl-port` file will be generated under `target/test-cwd/`, so you'll have to type the REPL port in manually when connecting. + +### API Docs +This project generates API docs with quickdoc, to regenerate `API.md`: +``` +shell quickdoc +``` + ## License Copyright © 2020-2025 Michiel Borkent From 4b1ee9863fcbc5f35e591853ba60a77217bd184d Mon Sep 17 00:00:00 2001 From: lread Date: Tue, 9 Dec 2025 15:24:24 -0500 Subject: [PATCH 2/2] doc: readme: describe cognitect test-runner opts Also add a note on why we have to 2 REPL launchers. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index da50dbd..05261d2 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,11 @@ To run default tests only: ``` bb test ``` +You can also use [cognitect test-runner](https://github.com/cognitect-labs/test-runner?tab=readme-ov-file#invoke-with-clojure--m-clojuremain) options, for example, to run a single test: +``` +bb test --var babashka.fs-test/walk-test +``` + To fire up a REPL when working on these tests, run `bb dev`. ### Scratch CWD Tests @@ -129,10 +134,18 @@ To run these tests only: ``` bb test-cwd ``` +As above, cognitect test-runner options work: +``` +bb test-cwd --var babashka.fs-cwd-test/es-copy-test +``` + The scratch current working directory is `target/test-cwd`. To fire up a REPL for these tests, run `bb dev-cwd`. Note that the `.nrepl-port` file will be generated under `target/test-cwd/`, so you'll have to type the REPL port in manually when connecting. +> [!NOTE] +> We currently have 2 REPL launcher tasks, `dev` and `dev-cwd`, because they each rely on a different current working directory. + ### API Docs This project generates API docs with quickdoc, to regenerate `API.md`: ```