mirror of
https://github.com/penpot/penpot.git
synced 2026-08-28 23:59:00 +00:00
✨ Add more testing related improvements
This commit is contained in:
parent
0d3a174f13
commit
bfa65547f8
@ -4,7 +4,7 @@
|
|||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"author": "Kaleidos INC Sucursal en España SL",
|
"author": "Kaleidos INC Sucursal en España SL",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@11.7.0+sha512.19cc852c120c7125760f2443ee6be0ca5b40f9f50598de1a09a1f177503e010e57c23c77646e01e761de59bf874fb22a3398c33ab9691fc13eb946b6f0f4d620",
|
"packageManager": "pnpm@11.9.0+sha512.bd682d5d03fe525ef7c9fd6780c6884d1e756ac4c9c9fe00c538782824310dcf90e3ddc4f53835f06dfaebd5085e41855e0bcbb3b60de2ac5bbab89e5036f03b",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"lint": "pnpm run lint:clj",
|
"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'\"",
|
"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",
|
"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:quiet": "node ./scripts/test-quiet.js",
|
||||||
"test:jvm": "clojure -M:dev:test"
|
"test:jvm": "clojure -M:dev:test"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,6 +168,10 @@
|
|||||||
(if (cljs.test/successful? m)
|
(if (cljs.test/successful? m)
|
||||||
(.exit js/process 0)
|
(.exit js/process 0)
|
||||||
(.exit js/process 1))))
|
(.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
|
#?(:cljs
|
||||||
(do
|
(do
|
||||||
@ -278,18 +282,20 @@
|
|||||||
:once-fixtures (:once fixtures)
|
:once-fixtures (:once fixtures)
|
||||||
:each-fixtures (:each fixtures))
|
:each-fixtures (:each fixtures))
|
||||||
summary (volatile! {:test 0 :pass 0 :fail 0 :error 0 :type :summary})]
|
summary (volatile! {:test 0 :pass 0 :fail 0 :error 0 :type :summary})]
|
||||||
(t/run-block
|
|
||||||
(concat [(fn [] (t/set-env! env))]
|
(t/set-env! env)
|
||||||
(t/test-vars-block vars)
|
|
||||||
[(fn []
|
(t/run-block
|
||||||
(vswap! summary
|
(concat (t/test-vars-block vars)
|
||||||
|
[(fn []
|
||||||
|
(vswap! summary
|
||||||
(partial merge-with +)
|
(partial merge-with +)
|
||||||
(:report-counters (t/get-and-clear-env!))))
|
(:report-counters (t/get-and-clear-env!))))
|
||||||
(fn []
|
(fn []
|
||||||
(t/set-env! env)
|
(t/set-env! env)
|
||||||
(t/do-report @summary)
|
(t/report @summary)
|
||||||
(t/report (assoc @summary :type :end-run-tests))
|
(t/report (assoc @summary :type :end-run-tests))
|
||||||
(t/clear-env!))]))))
|
(t/clear-env!))]))))
|
||||||
|
|
||||||
(defn- run-focused-test!
|
(defn- run-focused-test!
|
||||||
[focus]
|
[focus]
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import { spawnSync } from "node:child_process";
|
import { spawnSync } from "node:child_process";
|
||||||
|
|
||||||
const BUILD_STEPS = [
|
const BUILD_STEPS = [
|
||||||
{ label: "Building wasm", cmd: "pnpm", args: ["run", "build:wasm"] },
|
|
||||||
{ label: "Building test bundle", cmd: "pnpm", args: ["run", "build:test"] },
|
{ label: "Building test bundle", cmd: "pnpm", args: ["run", "build:test"] },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user