Migrate async tests to native ^:async; keep deftest-async as compat path - #12
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 keepingdeftest-asyncfor older toolchains.Migrated to native
screen_async_test— rewritten native; the redundant proof filenative_async_test.cljsfrom the shadow-upgrade PR is removed (its coverage lives here).within_native_async_test→within_async_test— native.user_event_promesa_test→user_event_async_test— native.Kept deliberately
deftest-async+promesastay: native^:asyncrequires shadow-cljs ≥ 3.4.x, so the macro remains the async-test path for projects on older toolchains. It is not deprecated.async_macro_test.cljssmoke-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.