Interface To

Hierarchy

Index

Properties

Methods

Properties

public an: An

Assert typeof / instanceof.

public be: Be

public have: Have

public include: Assertion

public not: NotBase

public only: Only

Methods

public a(type: string): Assertion

Assert typeof.

Parameters

  • type: string

Returns

Assertion

public a(type: Function): Assertion

Assert instanceof.

Parameters

  • type: Function

Returns

Assertion

public above(n: number): Assertion

Assert numeric value above n.

Parameters

  • n: number

Returns

Assertion

public below(n: number): Assertion

Assert numeric value below n.

Parameters

  • n: number

Returns

Assertion

public contain(str: string): Assertion

Assert that string contains str.

Parameters

  • str: string

Returns

Assertion

public contain(obj: any): Assertion

Assert that the array contains obj.

Parameters

  • obj: any

Returns

Assertion

public empty(): Assertion

Checks if the array is empty.

Returns

Assertion

public eql(obj: any): Assertion

Checks if the obj sortof equals another.

Parameters

  • obj: any

Returns

Assertion

public equal(obj: any): Assertion

Checks if the obj exactly equals another.

Parameters

  • obj: any

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

  • n: number

Returns

Assertion

public key(keys: Array<string>): Assertion

Assert exact keys or inclusion of keys by using the .own modifier.

Parameters

  • keys: Array<string>

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

  • keys: Array<string>

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

  • n: number

Returns

Assertion

public lessThan(n: number): Assertion

Assert numeric value below n.

Parameters

  • n: number

Returns

Assertion

public match(regexp: RegExp): Assertion

Assert string value matches regexp.

Parameters

  • regexp: RegExp

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 string(str: string): Assertion

Parameters

  • str: string

Returns

Assertion

public string(obj: any): Assertion

Parameters

  • obj: any

Returns

Assertion

public throwError(fn?: (exception: any) => void)

Assert that the function throws.

Parameters

  • fn?: (exception: any) => void optional

    callback to match error string against

public throwError(regexp: RegExp)

Assert that the function throws.

Parameters

  • regexp: RegExp

    regexp to match error string against

public throwException(fn?: (exception: any) => void)

Assert that the function throws.

Parameters

  • fn?: (exception: any) => void optional

    callback to match error string against

public throwException(regexp: RegExp)

Assert that the function throws.

Parameters

  • regexp: RegExp

public within(start: number, finish: number): Assertion

Assert within start to finish (inclusive).

Parameters

  • start: number
  • finish: number

Returns

Assertion