Skip to content

Add non-reagent render namespace (avoid importing @testing-library/react) - #17

Merged
olecve merged 2 commits into
mainfrom
feature/render-wrapper
Jul 16, 2026
Merged

Add non-reagent render namespace (avoid importing @testing-library/react)#17
olecve merged 2 commits into
mainfrom
feature/render-wrapper

Conversation

@olecve

@olecve olecve commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Plain-React (non-Reagent) tests previously imported ["@testing-library/react" :as rtl] directly just to get render/cleanup — the library only wrapped those for Reagent (reagent.render/render!).

  • New react-testing-library-cljs.render namespace wrapping render, cleanup, and act, so consumers don't reach into the JS module.
  • Migrated the library's own tests (9 files) from the direct @testing-library/react import to the new namespace (aliased rtl, so call sites are unchanged).
  • Documented it in the README Features list.

The node-test-example keeps the direct import for now: it depends on the published 0.0.20, which predates this namespace. It'll adopt the wrapper once a release including it ships (or if we point it at local source).

Root validations green: fmt, lint, cljs-patrol (new namespace's docstrings pass), and all 49 tests.

olecve added 2 commits July 16, 2026 15:36
…react

Add react-testing-library-cljs.render wrapping render/cleanup/act from
@testing-library/react, so plain-React (non-Reagent) tests no longer
import the JS module directly. Migrate the library's own tests to it
(the reagent variant already had reagent.render).

The node-test-example keeps the direct import for now: it depends on the
published 0.0.20, which predates this namespace. It can adopt the wrapper
once a release including it ships.
Reference ../../src/main via :source-paths and drop the Clojars
dependency, so the example builds against the in-repo library at HEAD
with no publish step. This lets it adopt the new
react-testing-library-cljs.render namespace immediately (plain-react
test no longer imports @testing-library/react).

reagent-karma-example intentionally stays on the published Clojars
dependency to demonstrate that setup.
@olecve
olecve merged commit 30d1596 into main Jul 16, 2026
3 checks passed
@olecve
olecve deleted the feature/render-wrapper branch July 16, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant