Skip to content

Migrate async tests to native ^:async; keep deftest-async as compat path - #12

Merged
olecve merged 5 commits into
mainfrom
feature/migrate-tests-native-async
Jul 16, 2026
Merged

Migrate async tests to native ^:async; keep deftest-async as compat path#12
olecve merged 5 commits into
mainfrom
feature/migrate-tests-native-async

Conversation

@olecve

@olecve olecve commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Now that shadow-cljs 3.4.11 (cljs 1.12.145) supports native async, moves the project's own async tests to native ^:async / await, while keeping deftest-async for older toolchains.

Migrated to native

  • screen_async_test — rewritten native; the redundant proof file native_async_test.cljs from the shadow-upgrade PR is removed (its coverage lives here).
  • within_native_async_testwithin_async_test — native.
  • user_event_promesa_testuser_event_async_test — native.

Kept deliberately

  • deftest-async + promesa stay: native ^:async requires shadow-cljs ≥ 3.4.x, so the macro remains the async-test path for projects on older toolchains. It is not deprecated.
  • New async_macro_test.cljs smoke-tests the macro so it stays covered in CI even though nothing else uses it now.

Suite 43 tests / 78 assertions, lint and fmt green. clj-kondo config net-unchanged.

Follow-up: document both approaches (native vs deftest-async) in the README.

olecve added 5 commits July 16, 2026 09:09
Move the project's own async tests from the deftest-async macro + promesa
to native ClojureScript async (^:async / await), now that shadow-cljs
3.4.11 (cljs 1.12.145) supports it:

- screen_async_test: rewritten native; the redundant proof file
  native_async_test.cljs is removed (its coverage lives here now).
- within_native_async_test -> within_async_test: native.
- user_event_promesa_test -> user_event_async_test: native.

deftest-async and promesa are intentionally retained: native ^:async
requires shadow-cljs >= 3.4.x, so the macro remains the async-test path
for older toolchains. Add async_macro_test.cljs as a smoke test so the
macro stays covered in CI even though nothing else uses it now.
Restore user_event_promesa_test.cljs alongside the native
user_event_async_test.cljs, so the deftest-async + promesa compat path
is exercised against the full range of user-event interactions (click,
type, clear, tab, keyboard, select-options), not just screen queries.
Make each first line a complete, capitalized sentence (per the bbatsov
Clojure style guide), fix the lowercase opening in user_event_promesa_test,
keep two-space continuation indentation, and wrap var references in
backticks.
Make the first line a complete sentence per the Clojure style guide, and
note that native ^:async / await is preferred on shadow-cljs 3.4+ while
this macro remains the compatibility path for older toolchains.
@olecve
olecve merged commit 7deee9b into main Jul 16, 2026
1 check passed
@olecve
olecve deleted the feature/migrate-tests-native-async branch July 16, 2026 07:13
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