diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf3fbe9..ab273e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,12 @@ jobs: with: version: "2026.05.25" + - uses: DeLaGuardo/setup-clojure@master + with: + cli: latest + - run: npm ci - run: npm run fmt:check - run: npm run lint + - run: npm run patrol - run: npm test diff --git a/.gitignore b/.gitignore index c06f85c..fc83c8c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ /checkouts /dev-resources/public/js/* /out +/.cpcache /.clj-kondo/.cache /.clj-kondo/imports /.lsp diff --git a/deps.edn b/deps.edn new file mode 100644 index 0000000..edf4029 --- /dev/null +++ b/deps.edn @@ -0,0 +1,8 @@ +{:aliases + {:patrol + {:deps {io.github.olecve/cljs-patrol + {:git/tag "v0.0.17" + :git/sha "1616b8d0daec1ffa7d8cec6f9ce08348d837202a"}} + :main-opts ["-m" "cljs-patrol.core" + "--fail-on" "all" + "src/main"]}}} diff --git a/package.json b/package.json index 9ec285d..d3be979 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "test": "npx shadow-cljs compile test && node out/test.js", "test:watch": "npx shadow-cljs watch test --config-merge \"{:autorun true}\"", "lint": "clj-kondo --lint src", + "patrol": "clojure -M:patrol", "fmt": "prettier --write \"**/*.{clj,cljs,cljc,edn}\"", "fmt:check": "prettier --check \"**/*.{clj,cljs,cljc,edn}\"" }, diff --git a/src/main/react_testing_library_cljs/user_event.cljs b/src/main/react_testing_library_cljs/user_event.cljs index 4f7ddd3..ad6555e 100644 --- a/src/main/react_testing_library_cljs/user_event.cljs +++ b/src/main/react_testing_library_cljs/user_event.cljs @@ -51,8 +51,8 @@ ([^js user element] (.unhover user element)) ([^js user element options] (.unhover user element (clj->js options)))) (defn type - "Types text into an element character by character, simulating the full - keyboard event sequence for each character. + "Types text into an element one character at a time. + Simulates the full keyboard event sequence for each character. See [type](https://testing-library.com/docs/user-event/utility/#type)." ([^js user element text] (.type user element text)) @@ -90,8 +90,8 @@ ([^js user] (.tab user)) ([^js user options] (.tab user (clj->js options)))) (defn keyboard - "Simulates keyboard events for the given key descriptor string, - e.g. {Enter}, a, {{a}}. + "Simulates keyboard events for the given key descriptor string. + For example `{Enter}`, `a`, or `{{a}}`. See [keyboard](https://testing-library.com/docs/user-event/keyboard)." ([^js user text] (.keyboard user text))