The goog.testing.mockmatchers.SaveArgument Class

goog.testing.mockmatchers.SaveArgument
> goog.testing.mockmatchers.ArgumentMatcher

goog.testing.mockmatchers.SaveArgument(opt_matcher, opt_matchName)

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.

opt_matcher {goog.testing.mockmatchers.ArgumentMatcher|Function=}
Argument matcher or matching function that will be used to validate the argument. By default, argument will always be valid.
opt_matchName {?string=}
The name expressing intent as part of an error message for when a match fails.

.arg {*}

Saved argument that was verified.

.matches(toVerify, opt_expectation)

A function that takes a match argument and an optional MockExpectation which (if provided) will get error information and returns whether or not it matches.

toVerify {*}
The argument that should be verified.
opt_expectation {goog.testing.MockExpectation?=}
The expectation for this match.
returns {boolean}
Whether or not a given argument passes verification.