Expect.js Assertions Flashcards
Learn the basic assertion methods. https://github.com/LearnBoost/expect.js
ok
asserts that the value is truthy or not
be( value ) or equal( value )
Asserts equality to the ‘Value’. Using ===
eql( value )
asserts loose equality that works with objects
a( typeof ) or an( typeof )
asserts typeof with support for array type and instanceof
match( regex )
asserts String regular expression match
contains( value )
asserts indexOf for an array or string
length( number )
asserts array .length
empty()
asserts that an array is empty or not
property( key, value )
asserts presence of an own property (and value optionally)
keys( value, …)
asserts the presence of a key. Supports the only modifier
throwException
asserts that the Function throws or not when called
within( range1, range2 )
asserts a number within a range
greaterThan( value )
asserts a value is greater then value.
lessThen( value )
asserts a value is less then.
fail
explicity forces failure.