Methods
public above(n: number): Assertion
Assert numeric value above n.
Parameters
Returns
Assertion
public below(n: number): Assertion
Assert numeric value below n.
Parameters
Returns
Assertion
public contain(str: string): Assertion
Assert that string contains str.
Parameters
Returns
Assertion
public contain(obj: any): Assertion
Assert that the array contains obj.
Parameters
Returns
Assertion
Checks if the array is empty.
Returns
Assertion
public eql(obj: any): Assertion
Checks if the obj sortof equals another.
Parameters
Returns
Assertion
public equal(obj: any): Assertion
Checks if the obj exactly equals another.
Parameters
Returns
Assertion
public fail(message?: string): Assertion
Assert a failure.
Parameters
-
message?: string optional
Returns
Assertion
public greaterThan(n: number): Assertion
Assert numeric value above n.
Parameters
Returns
Assertion
public key(keys: Array<string>): Assertion
Assert exact keys or inclusion of keys by using the .own
modifier.
Parameters
Returns
Assertion
public key(keys?: Array<string>): Assertion
Assert exact keys or inclusion of keys by using the .own
modifier.
Parameters
-
keys?: Array<string> optional
Returns
Assertion
public keys(keys: Array<string>): Assertion
Assert exact keys or inclusion of keys by using the .own
modifier.
Parameters
Returns
Assertion
public keys(keys?: Array<string>): Assertion
Assert exact keys or inclusion of keys by using the .own
modifier.
Parameters
-
keys?: Array<string> optional
Returns
Assertion
public length(n: number): Assertion
Assert property "length" exists and has value of n.
Parameters
Returns
Assertion
public lessThan(n: number): Assertion
Assert numeric value below n.
Parameters
Returns
Assertion
public match(regexp: RegExp): Assertion
Assert string value matches regexp.
Parameters
Returns
Assertion
public ok()
Check if the value is truthy
public property(name: string, val?: any): Assertion
Assert property name exists, with optional val.
Parameters
-
name: string
-
val?: any optional
Returns
Assertion
public throwError(fn?: (exception: any) => void)
Assert that the function throws.
Parameters
public throwError(regexp: RegExp)
Assert that the function throws.
Parameters
public throwException(fn?: (exception: any) => void)
Assert that the function throws.
Parameters
public throwException(regexp: RegExp)
Assert that the function throws.
Parameters
public within(start: number, finish: number): Assertion
Assert within start to finish (inclusive).
Parameters
-
start: number
-
finish: number
Returns
Assertion