Back

successful? (clj)

(source)

function

(successful? summary)
Returns true if the given test summary indicates all tests were successful, false otherwise.

Examples

penpot/penpot
(ns common-tests.setup
  (:require
   [clojure.test :as t]))

(defmethod t/report [:cljs.test/default :end-run-tests]
  [m]
  (if (t/successful? m)
    (set! (.-exitCode js/process) 0)
    (set! (.-exitCode js/process) 1)))
clojure/core.typed
(ns clojure.core.typed.test.testnew
  (:require [clojure.core.typed :as t] 
            [clojure.test :refer :all]                
            [clojure.core.typed.test.test-utils :refer :all]
            [clojure.core.typed.test.destructure]))

(deftest function?-test
  (is-tc-e (function? function?) Boolean
             :requires [[clojure.test :refer [function?]]])
  (is-tc-err (function? function?) String
             :requires [[clojure.test :refer [function?]]]))
  
(deftest assert-any-test
  (is-tc-e (assert-any "Hi" (= 4 (+ 2 2))) Any
           :requires [[clojure.test :refer [assert-any]]]))
           
(deftest do-report-test
  (is-tc-e #(do-report 1)
           :requires [[clojure.test :refer [do-report]]]))
            
(deftest run-tests-test
  (is-tc-e #(run-tests) [-> (Map Any Any)]
           :requires [[clojure.test :refer [run-tests]]])
  (is-tc-err #(run-tests) [-> String]
             :requires [[clojure.test :refer [run-tests]]]))
            
(deftest run-all-tests-test
  (is-tc-e #(run-all-tests) [-> (Map Any Any)]
           :requires [[clojure.test :refer [run-all-tests]]])
  (is-tc-e #(run-all-tests #"asdf") [-> (Map Any Any)]
           :requires [[clojure.test :refer [run-all-tests]]])
  (is-tc-err #(run-all-tests) [:-> String]
             :requires [[clojure.test :refer [run-all-tests]]]))
            
(deftest successful?-test
  (is-tc-e #(successful? {}) [-> Boolean]
           :requires [[clojure.test :refer [successful?]]]))
            
(deftest compose-fixtures-test
  (is-tc-e (compose-fixtures (fn [a :- [-> Any]] (a)) 
                             (fn [b :- [-> Any]] (b)))
           [[-> Any] -> Any]
           :requires [[clojure.test :refer [compose-fixtures]]]))
           
(deftest testing-vars-str-test
  (is-tc-e #(testing-vars-str {}) [-> String]
           :requires [[clojure.test :refer [testing-vars-str]]])
  (is-tc-err (testing-vars-str 1) Int
             :requires [[clojure.test :refer [testing-vars-str]]]))
           
(deftest testing-contexts-str-test
  (is-tc-e (testing-contexts-str)  String
           :requires [[clojure.test :refer [testing-contexts-str]]])
  (is-tc-err (testing-contexts-str) (Map Any Any)
             :requires [[clojure.test :refer [testing-contexts-str]]])
  (is-tc-err (testing-contexts-str 1)  String
             :requires [[clojure.test :refer [testing-contexts-str]]]))
typedclojure/typedclojure
(ns clojure.core.typed.test.testnew
  (:require [typed.clojure :as t]
            [clojure.test :refer :all]
            [typed.clj.checker.test-utils :refer :all]))

(deftest function?-test
  (is-tc-e (function? function?) t/Bool
           :requires [[clojure.test :refer [function?]]])
  (is-tc-err (function? function?) t/Str
             :requires [[clojure.test :refer [function?]]]))
  
(deftest assert-any-test
  (is-tc-e (assert-any "Hi" (= 4 (+ 2 2))) t/Any
           :requires [[clojure.test :refer [assert-any]]]))
           
(deftest do-report-test
  (is-tc-e #(do-report 1)
           :requires [[clojure.test :refer [do-report]]]))
            
(deftest run-tests-test
  (is-tc-e #(run-tests) [-> (t/Map t/Any t/Any)]
           :requires [[clojure.test :refer [run-tests]]])
  (is-tc-err #(run-tests) [-> t/Str]
             :requires [[clojure.test :refer [run-tests]]]))
            
(deftest run-all-tests-test
  (is-tc-e #(run-all-tests) [-> (t/Map t/Any t/Any)]
           :requires [[clojure.test :refer [run-all-tests]]])
  (is-tc-e #(run-all-tests #"asdf") [-> (t/Map t/Any t/Any)]
           :requires [[clojure.test :refer [run-all-tests]]])
  (is-tc-err #(run-all-tests) [:-> t/Str]
             :requires [[clojure.test :refer [run-all-tests]]]))
            
(deftest successful?-test
  (is-tc-e #(successful? {}) [-> t/Bool]
           :requires [[clojure.test :refer [successful?]]]))
            
(deftest compose-fixtures-test
  (is-tc-e (compose-fixtures (fn [a :- [-> t/Any]] (a)) 
                             (fn [b :- [-> t/Any]] (b)))
           [[-> t/Any] -> t/Any]
           :requires [[clojure.test :refer [compose-fixtures]]]))
           
(deftest testing-vars-str-test
  (is-tc-e #(testing-vars-str {}) [-> t/Str]
           :requires [[clojure.test :refer [testing-vars-str]]])
  (is-tc-err (testing-vars-str 1) t/Int
             :requires [[clojure.test :refer [testing-vars-str]]]))
           
(deftest testing-contexts-str-test
  (is-tc-e (testing-contexts-str) t/Str
           :requires [[clojure.test :refer [testing-contexts-str]]])
  (is-tc-err (testing-contexts-str) (t/Map t/Any t/Any)
             :requires [[clojure.test :refer [testing-contexts-str]]])
  (is-tc-err (testing-contexts-str 1) t/Str
             :requires [[clojure.test :refer [testing-contexts-str]]]))
funcool/struct
(ns struct.tests
  (:require #?(:cljs [cljs.test :as t]
               :clj [clojure.test :as t])
            [struct.core :as st]))

#?(:cljs
   (defmethod t/report [:cljs.test/default :end-run-tests]
     [m]
     (if (t/successful? m)
       (set! (.-exitCode js/process) 0)
       (set! (.-exitCode js/process) 1))))
j-cr/speck
(ns speck.v1.core-test
  (:require [speck.v1.core :as speck :refer [|]]
            [clojure.test :as test :refer [deftest testing is are]]
            [clojure.spec.alpha :as s]
            ;; [clojure.spec.test.alpha :as s.test]
            ;; [orchestra.spec.test :as orchestra]
            ))

;; --------------------------------------------------------------------------------
;; (if (test/successful? (test/run-tests)) :ok :FAIL)