Class: Mach

Mach

mach.js

Constructor

new Mach()

Source:

Members

(static) any

Creates a new Any used as a wild card expected argument for a Mock expectation.

Source:

(static) callback

Creates a new Callback used as an expected argument for a Mock expectation that has a callback.

Source:

Methods

(static) ignoreMockedCallsWhen()

Creates a scope in which unexpected and out of order function calls are ignored and only required calls are checked during execution. Consider using Expectation#andOtherCallsShouldBeIgnored or Expectation#withOtherCallsIgnored instead.

Source:

(static) match()

Alias for Mach#Same

Source:

(static) mockFunction(thing) → {Mock}

Creates a new Mock.

Parameters:
Name Type Description
thing function | string

Either an existing function to mock or the name for the mock.

Source:
Returns:

Mocked function.

Type
Mock

(static) mockObject(object, name)

Creates a new MockObject

Parameters:
Name Type Description
object object

Object to mock.

name string

Name for the mocked object.

Source:

(static) same(value, matcher) → {Same}

Creates a new Same which is used as an expected argument for a Mock expectation.

Parameters:
Name Type Description
value object

Expected argument to a Mock

matcher function

Custom equality function in the form (expected, actual) => boolean

Source:
Returns:

Same object to use as an expected argument in an expectation.

Type
Same