# Namespace goog.testing.mockmatchers

code »

## Classes

goog.testing.mockmatchers.ArgumentMatcher A simple interface for executing argument matching. goog.testing.mockmatchers.IgnoreArgument A matcher that always returns true. goog.testing.mockmatchers.InstanceOf A matcher that verifies that an argument is an instance of a given class. goog.testing.mockmatchers.ObjectEquals A matcher that verifies that the argument is an object that equals the given expected object, using a deep comparison. goog.testing.mockmatchers.RegexpMatch A matcher that verifies that an argument matches a given RegExp. goog.testing.mockmatchers.SaveArgument A matcher that saves the argument that it is verifying so that your unit test can perform extra tests with this argument later. goog.testing.mockmatchers.TypeOf A matcher that verifies that an argument is of a given type (e.g.

Show:Public Protected Private

## Global Functions

code »goog.testing.mockmatchers.flexibleArrayMatcher ( expectedArr, arr, opt_expectation ) ⇒ `boolean`

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.

Parameters
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
Whether or not the given array matches the expectations.

## Global Properties

code »goog.testing.mockmatchers.ignoreArgument : `goog.testing.mockmatchers.IgnoreArgument`

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

code »goog.testing.mockmatchers.isArray : `goog.testing.mockmatchers.ArgumentMatcher`

A matcher that verifies that an argument is an array.

code »goog.testing.mockmatchers.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.

code »goog.testing.mockmatchers.isBoolean : `goog.testing.mockmatchers.ArgumentMatcher`

A matcher that verifies that an argument is a boolean.

code »goog.testing.mockmatchers.isDateLike : `goog.testing.mockmatchers.ArgumentMatcher`

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

code »goog.testing.mockmatchers.isFunction : `goog.testing.mockmatchers.ArgumentMatcher`

A matcher that verifies that an argument is a function.

code »goog.testing.mockmatchers.isNodeLike : `goog.testing.mockmatchers.ArgumentMatcher`

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

code »goog.testing.mockmatchers.isNumber : `goog.testing.mockmatchers.ArgumentMatcher`

A matcher that verifies that an argument is a number.

code »goog.testing.mockmatchers.isObject : `goog.testing.mockmatchers.ArgumentMatcher`

A matcher that verifies that an argument is an object.

code »goog.testing.mockmatchers.isString : `goog.testing.mockmatchers.ArgumentMatcher`

A matcher that verifies that an argument is a string.