search

goog.testing.FunctionMock

Provided By

Class used to mock a function. Useful for mocking closures and anonymous callbacks etc. Creates a function object that extends goog.testing.Mock.

FunctionMock( opt_functionName, opt_strictness ) goog.testing.MockInterface

Parameters
opt_functionNamestring=

The optional name of the function to mock. Set to '[anonymous mocked function]' if not passed in.

opt_strictnessnumber=

One of goog.testing.Mock.LOOSE or goog.testing.Mock.STRICT. The default is STRICT.

Returns
goog.testing.MockInterface

The mocked function.