Ver Fonte

dev: add bb dev:lint-and-test

rcmerci há 1 ano atrás
pai
commit
2b27969b05
2 ficheiros alterados com 19 adições e 0 exclusões
  1. 6 0
      bb.edn
  2. 13 0
      scripts/src/logseq/tasks/dev.clj

+ 6 - 0
bb.edn

@@ -136,6 +136,12 @@
   dev:lint
   dev:lint
   logseq.tasks.dev/lint
   logseq.tasks.dev/lint
 
 
+  dev:test
+  logseq.tasks.dev/test
+
+  dev:lint-and-test
+  logseq.tasks.dev/lint-and-test
+
   dev:gen-malli-kondo-config
   dev:gen-malli-kondo-config
   logseq.tasks.dev/gen-malli-kondo-config
   logseq.tasks.dev/gen-malli-kondo-config
 
 

+ 13 - 0
scripts/src/logseq/tasks/dev.clj

@@ -27,6 +27,19 @@
     (println cmd)
     (println cmd)
     (shell cmd)))
     (shell cmd)))
 
 
+(defn test
+  "Run tests. Pass args through to cmd 'yarn cljs:run-test'"
+  [& args]
+  (shell "yarn cljs:test")
+  (apply shell "yarn cljs:run-test" args))
+
+(defn lint-and-test
+  "Run all lint tasks, then run tests.
+  pass args through to cmd 'yarn cljs:run-test'"
+  [& args]
+  (lint)
+  (apply test args))
+
 
 
 (defn gen-malli-kondo-config
 (defn gen-malli-kondo-config
   "Generate clj-kondo type-mismatch config from malli schema
   "Generate clj-kondo type-mismatch config from malli schema