Expect.js Assertions Flashcards

Learn the basic assertion methods. https://github.com/LearnBoost/expect.js

1
Q

ok

A

asserts that the value is truthy or not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

be( value ) or equal( value )

A

Asserts equality to the ‘Value’. Using ===

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

eql( value )

A

asserts loose equality that works with objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

a( typeof ) or an( typeof )

A

asserts typeof with support for array type and instanceof

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

match( regex )

A

asserts String regular expression match

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

contains( value )

A

asserts indexOf for an array or string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

length( number )

A

asserts array .length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

empty()

A

asserts that an array is empty or not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

property( key, value )

A

asserts presence of an own property (and value optionally)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

keys( value, …)

A

asserts the presence of a key. Supports the only modifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

throwException

A

asserts that the Function throws or not when called

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

within( range1, range2 )

A

asserts a number within a range

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

greaterThan( value )

A

asserts a value is greater then value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

lessThen( value )

A

asserts a value is less then.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

fail

A

explicity forces failure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly