This is a tiny assertion library (in the same space as
require("assert")) that is only a handful of lines, and exports a
var ist =// Assert that the argument is truthy// Assert that two values are the same// Assert that 2 is less than 3// Pass an arbitrary compare functionist // Ensure something throws
Throws a exception of class
value is falsy.
(a, b, compare)
b, and throws an
ist.Failure if the comparison
compare defaults to
==, but you can pass a string that
to compare in a different way.
Ensure that calling
f throws an exception, and optionally test
whether the exception matches your expectation.
matches may be a
regexp, which is matched against the exception's
message property, a
string, which should be the same as the
message, or a function that
takes an exception and returns a boolean.
This software is licensed under an MIT license.