The goog.testing.mockmatchers Namespace

The goog.testing.mockmatchers.ArgumentMatcher Class

A simple interface for executing argument matching. A match in this case is testing to see if a supplied object fits a given criteria. True is returned if the given criteria is met. … more

The goog.testing.mockmatchers.IgnoreArgument Class

A matcher that always returns true. It is useful when the user does not care for some arguments. For example: mockFunction('username', 'password', IgnoreArgument); … more

The goog.testing.mockmatchers.InstanceOf Class

A matcher that verifies that an argument is an instance of a given class. … more

The goog.testing.mockmatchers.ObjectEquals Class

A matcher that verifies that the argument is an object that equals the given expected object, using a deep comparison. … more

The goog.testing.mockmatchers.RegexpMatch Class

A matcher that verifies that an argument matches a given RegExp. … more

The goog.testing.mockmatchers.SaveArgument Class

A matcher that saves the argument that it is verifying so that your unit test can perform extra tests with this argument later. For example, if the argument is a callback method, the unit test can then later call this callback to test the asynchronous portion of the call. … more

The goog.testing.mockmatchers.TypeOf Class

A matcher that verifies that an argument is of a given type (e.g. "object"). … more

.flexibleArrayMatcher(expectedArr, arr, opt_expectation)

A function that checks to see if an array matches a given set of expectations. The expectations array can be a mix of ArgumentMatcher implementations and values. True will be returned if values are identical or if a matcher returns a positive result.

expectedArr {Array}
An array of expectations which can be either values to check for equality or ArgumentMatchers.
arr {Array}
The array to match.
opt_expectation {goog.testing.MockExpectation?=}
The expectation for this match.
returns {boolean}
Whether or not the given array matches the expectations.

.ignoreArgument {goog.testing.mockmatchers.IgnoreArgument}

An instance of the IgnoreArgument matcher. Returns true for all matches.

.isArray {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is an array.

.isArrayLike {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is a array-like. A NodeList is an example of a collection that is very close to an array.

.isBoolean {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is a boolean.

.isDateLike {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is a date-like.

.isFunction {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is a function.

.isNodeLike {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is like a DOM node.

.isNumber {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is a number.

.isObject {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is an object.

.isString {goog.testing.mockmatchers.ArgumentMatcher}

A matcher that verifies that an argument is a string.