npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@arichiardi/humane-test-output

v0.9.0

Published

* Humane test output for clojure.test

Downloads

2

Readme

#+STARTUP: hidestars showall

  • Humane test output for clojure.test

[[https://clojars.org/pjstadig/humane-test-output][https://clojars.org/pjstadig/humane-test-output/latest-version.svg]]

This library does two things: 1. Test output is pretty printed. 2. Equality assertions are also diffed.

Version 0.8.0 and later of humane-test-output requires Clojure 1.8.0 or later. ** IDEs This test output formatting works great with Emacs and cider 0.10 or lower, and when running Leiningen in a console. However, some IDEs are also bashing in their own versions of test formatting.

I do not recommend using this with cider 0.11.0 or greater or with Cursive, or LightTable, or any other IDE. ** Clojure To activate it you will need to call ~pjstadig.humane-test-output/activate!~. The preferred way to do this with Leiningen is to use an injection in the :user profile in your ~/.lein/profiles.clj:

#+BEGIN_EXAMPLE {:user {:dependencies [[pjstadig/humane-test-output "0.8.3"]] :injections [(require 'pjstadig.humane-test-output) (pjstadig.humane-test-output/activate!)]}} #+END_EXAMPLE

If you are on a mixed team and some members need to disable humane test output, they can define the ~INHUMANE_TEST_OUTPUT~ environment variable, though again it's better for each user to enable it in their own ~/.lein/profiles.clj.

Once humane-test-output is activated, instead of this: #+BEGIN_EXAMPLE FAIL in (a-test) (humane_test_output_test.clj:7) FIXME, I fail. expected: (= {:foo :bar, :baz :quux, :something "a long string?", :another-key "and another value"} {:fo :bar, :baz :quux, :something "a long string?", :another-key "and another value"}) actual: (not (= {:another-key "and another value", :foo :bar, :something "a long string?", :baz :quux} {:another-key "and another value", :something "a long string?", :fo :bar, :baz :quux}))

FAIL in (a-test) (humane_test_output_test.clj:11) FIXME, I fail. expected: (= {:foo :bar, :baz :quux} {:foo :bar, :baz :quux} {:fo :bar, :baz :quux}) actual: (not (= {:foo :bar, :baz :quux} {:foo :bar, :baz :quux} {:fo :bar, :baz :quux})) FAIL in (a-test) (humane_test_output_test.clj:14)

FIXME, I fail. expected: (list? foo) actual: (not (list? {:another-key "and another value", :foo :bar, :something "a long string?", :baz :quux})) #+END_EXAMPLE

You get this: #+BEGIN_EXAMPLE FAIL in (a-test) (humane_test_output_test.clj:7) FIXME, I fail. expected: {:another-key "and another value", :foo :bar, :something "a long string?", :baz :quux} actual: {:fo :bar} diff: - {:baz :quux, :something "a long string?", :foo :bar, :another-key "and another value"} + {:fo :bar}

FAIL in (a-test) (humane_test_output_test.clj:10) FIXME, I fail. expected: {:foo :bar, :baz :quux} actual: {:fo :bar, :baz :quux} diff: - {:foo :bar} + {:fo :bar}

FAIL in (a-test) (humane_test_output_test.clj:13) FIXME, I fail. expected: (list? foo) actual: (not (list? {:another-key "and another value", :foo :bar, :something "a long string?", :baz :quux})) #+END_EXAMPLE

BONUS FEATURE

A test containing ~(is (= oops-i-only-gave-one-argument))~ will throw an exception. ** ClojureScript It is not necessary to activate humane-test-output with ClojureScript, but the behavior should be much the same as with Clojure. ** License #+BEGIN_EXAMPLE Copyright © Paul Stadig and Outpace Systems, Inc. All rights reserved.

Some small bits of code were taken from clojure.test and modified, and are Copyright © Rich Hickey. All rights reserved.

Distributed under the Eclipse Public License, the same as Clojure. #+END_EXAMPLE ** Acknowledgements I am grateful for design and implementation assistance from Bryce Covert.

Thanks to Miloslav Nenadál for the ClojureScript implementation.