diff --git a/common/package.json b/common/package.json index d2129bb7ca..a90c163aaf 100644 --- a/common/package.json +++ b/common/package.json @@ -4,7 +4,7 @@ "license": "MPL-2.0", "author": "Kaleidos INC Sucursal en España SL", "private": true, - "packageManager": "pnpm@11.7.0+sha512.19cc852c120c7125760f2443ee6be0ca5b40f9f50598de1a09a1f177503e010e57c23c77646e01e761de59bf874fb22a3398c33ab9691fc13eb946b6f0f4d620", + "packageManager": "pnpm@11.9.0+sha512.bd682d5d03fe525ef7c9fd6780c6884d1e756ac4c9c9fe00c538782824310dcf90e3ddc4f53835f06dfaebd5085e41855e0bcbb3b60de2ac5bbab89e5036f03b", "type": "module", "repository": { "type": "git", @@ -29,7 +29,7 @@ "lint": "pnpm run lint:clj", "watch:test": "concurrently \"clojure -M:dev:shadow-cljs watch test\" \"nodemon -C -d 2 -w target/tests/ --exec 'node target/tests/test.js'\"", "build:test": "clojure -M:dev:shadow-cljs compile test", - "test:js": "pnpm run build:test && node target/tests/test.js", + "test:js": "[ -f target/tests/test.js ] || pnpm run build:test; node target/tests/test.js", "test:quiet": "node ./scripts/test-quiet.js", "test:jvm": "clojure -M:dev:test" } diff --git a/common/test/common_tests/runner.cljc b/common/test/common_tests/runner.cljc index ca32b93654..59a0c5e4ca 100644 --- a/common/test/common_tests/runner.cljc +++ b/common/test/common_tests/runner.cljc @@ -168,6 +168,10 @@ (if (cljs.test/successful? m) (.exit js/process 0) (.exit js/process 1)))) +#?(:cljs + (defmethod t/report [:cljs.test/default :begin-test-var] [m] + (let [v (:var m)] + (println (str " ▸ " (:ns (meta v)) "/" (:name (meta v))))))) #?(:cljs (do @@ -278,18 +282,20 @@ :once-fixtures (:once fixtures) :each-fixtures (:each fixtures)) summary (volatile! {:test 0 :pass 0 :fail 0 :error 0 :type :summary})] - (t/run-block - (concat [(fn [] (t/set-env! env))] - (t/test-vars-block vars) - [(fn [] - (vswap! summary + + (t/set-env! env) + + (t/run-block + (concat (t/test-vars-block vars) + [(fn [] + (vswap! summary (partial merge-with +) (:report-counters (t/get-and-clear-env!)))) - (fn [] - (t/set-env! env) - (t/do-report @summary) - (t/report (assoc @summary :type :end-run-tests)) - (t/clear-env!))])))) + (fn [] + (t/set-env! env) + (t/report @summary) + (t/report (assoc @summary :type :end-run-tests)) + (t/clear-env!))])))) (defn- run-focused-test! [focus] diff --git a/frontend/scripts/test-quiet.js b/frontend/scripts/test-quiet.js index 7b5ad068ae..b1be0dd682 100644 --- a/frontend/scripts/test-quiet.js +++ b/frontend/scripts/test-quiet.js @@ -1,7 +1,6 @@ import { spawnSync } from "node:child_process"; const BUILD_STEPS = [ - { label: "Building wasm", cmd: "pnpm", args: ["run", "build:wasm"] }, { label: "Building test bundle", cmd: "pnpm", args: ["run", "build:test"] }, ];