TDD Assertions Flashcards

These assertions are available for TDD assertions (assert).

1
Q

.isOk(object, [message])

A

assert.isOk(‘everything’, ‘everything is ok’)

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

.isNotOk(object, [message])

A

assert.isNotOk(false, ‘this will pass’)

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

.equal(actual, expected, [message])

A

assert.equal(3, 3, ‘vals equal’)

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

.notEqual(actual, expected, [message])

A

assert.notEqual(3, 4, ‘vals not equal’)

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

.strictEqual(actual, expected, [message])

A

assert.strictEqual(true, true, ‘bools strict eq’)

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

.notStrictEqual(actual, expected, [message])

A

assert.notStrictEqual(5, ‘5’, ‘not strict eq’)

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

.deepEqual(actual, expected, [message])

A

assert.deepEqual({ id: ‘1’ }, { id: ‘1’ })

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

.notDeepEqual(actual, expected, [message])

A

assert.notDeepEqual({ id: ‘1’ }, { id: ‘2’ })

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

.isAbove(valueToCheck, valueToBeAbove, [message])

A

assert.isAbove(6, 1, ‘6 greater than 1’)

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

.isAtLeast(valueToCheck, valueToBeAtLeast, [message])

A

assert.isAtLeast(5, 2, ‘5 gt or eq to 2’)

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

.isBelow(valueToCheck, valueToBeBelow, [message])

A

assert.isBelow(3, 6, ‘3 strict lt 6’)

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

.isAtMost(valueToCheck, valueToBeAtMost, [message])

A

assert.isAtMost(4, 4, ‘4 lt or eq to 4’)

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

.isTrue(value, [message])

A

assert.isTrue(true, ‘this val is true’)

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

.isNotTrue(value, [message])

A

assert.isNotTrue(‘tests are no fun’, ‘val not true’)

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

.isFalse(value, [message])

A

assert.isFalse(false, ‘val is false’)

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

.isNotFalse(value, [message])

A

assert.isNotFalse(‘tests are fun’, ‘val not false’)

17
Q

.isNull(value, [message])

A

assert.isNull(err, ‘there was no error’)

18
Q

.isNotNull(value, [message])

A

assert.isNotNull(‘hello’, ‘is not null’)

19
Q

.isNaN(value, [message])

A

assert.isNaN(NaN, ‘NaN is NaN’)

20
Q

.isNotNaN(value, [message])

A

assert.isNotNaN(5, ‘5 is not NaN’)

21
Q

.exists(value, [message])

A

assert.exists(5, ‘5 is not null or undefined’)

22
Q

.notExists(value, [message])

A

assert.notExists(null, ‘val is null or undefined’)

23
Q

.isUndefined(value, [message])

A

assert.isUndefined(undefined, ‘val is undefined’)

24
Q

.isDefined(value, [message])

A

assert.isDefined(‘hello’, ‘val has been defined’)

25
Q

.isFunction(value, [message])

A

assert.isFunction(x => x * x, ‘val is func’)

26
Q

.isNotFunction(value, [message])

A

assert.isNotFunction(5, ‘val not funct’)

27
Q

.isObject(value, [message])

A

assert.isObject({num: 5}, ‘val is object’)

28
Q

.isNotObject(value, [message])

A

assert.isNotObject(3, ‘val not object’)

29
Q

.isArray(value, [message])

A

assert.isArray([‘unit’, ‘e2e’], ‘val is array’)

30
Q

.isNotArray(value, [message])

A

assert.isNotArray(‘e2e’, ‘val not array’)

31
Q

.isString(value, [message])

A

assert.isString(‘e2e’, ‘val is string’)

32
Q

.isNotString(value, [message])

A

assert.isNotString(2, ‘val not string’)

33
Q

.isNumber(value, [message])

A

assert.isNumber(2, ‘val is number’)

34
Q

.isNotNumber(value, [message])

A

assert.isNotNumber(‘e2e’, ‘val not number’)

35
Q

.isBoolean(value, [message])

A

assert.isBoolean(true, ‘val is bool’)

36
Q

.isNotBoolean(value, [message])

A

assert.isNotBoolean(‘true’, ‘val not bool’)

37
Q

.typeOf(value, name, [message])

A

assert.typeOf(‘e2e’, ‘string’, ‘val is string’)

38
Q

.notTypeOf(value, name, [message])

A

assert.notTypeOf(‘e2e’, ‘number’, ‘val not number’)