Giter VIP home page Giter VIP logo

missing.test.assertions's Introduction

missing.test.assertions

Clojars Project cljdoc badge

Library for checking absence of assertions in clojure.test tests.

Usage

Require missing.test.assertions in your test namespace(s).

Note that in a-test no assertions are made, but another-test has one assertion. So we expect a warning only about a-test.

(ns foo.core-test
  (:require [clojure.test :refer [deftest testing is]]
            [missing.test.assertions]))

(deftest a-test
  (testing "..."
    1))

(deftest another-test
  (testing (is 1)))

When executing the tests, the following warning will get printed to *err*:

WARNING: no assertions made in test a-test

Notes

  • This library works with Clojure and ClojureScript.
  • When registering your own clojure.test/report :begin-test-var and :end-test-var hooks, call missing.test.assertions/register! afterwards. This will redefine the missing.test.assertions hooks while your hooks keep working.
  • The default behavior in absence of test assertions is printing a message. If you want an exception, call (missing.test.assertions/register! {:throw? true}).

Test

JVM

lein test

or

clj -A:test

Node

script/test/node

Related projects

  • kaocha has this as a built-in feature

License

Copyright © 2019 Michiel Borkent

Distributed under the EPL License, same as Clojure. See LICENSE.

missing.test.assertions's People

Contributors

borkdude avatar

Stargazers

Mitesh avatar Orlin M Bozhinov avatar Kent OHASHI avatar Lee Read avatar Burin Choomnuan avatar  avatar Michael Salihi avatar Will Mruzek avatar Krisztián Szabó  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

clojure-land

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.