Namespace goog.testing
code »Interfaces
|
Classes
|
Global Functions
code »goog.testing.FunctionMock ( opt_functionName, opt_strictness ) ⇒ goog.testing.MockInterface
Class used to mock a function. Useful for mocking closures and anonymous
callbacks etc. Creates a function object that extends goog.testing.Mock.
goog.testing.MockInterface
code »goog.testing.GlobalFunctionMock ( functionName, opt_strictness ) ⇒ !goog.testing.MockInterface
Mocks a global / top-level function. Creates a goog.testing.MethodMock
in the global scope with the name specified by functionName.
!goog.testing.MockInterface
code »goog.testing.MethodMock ( scope, functionName, opt_strictness ) ⇒ !goog.testing.MockInterface
Mocks an existing function. Creates a goog.testing.FunctionMock
and registers it in the given scope with the name specified by functionName.
!goog.testing.MockInterface
code »goog.testing.createConstructorMock ( scope, constructorName, opt_strictness ) ⇒ !goog.testing.MockInterface
Convenience method for creating a mock for a constructor. Copies class
members to the mock.
When mocking a constructor to return a mocked instance, remember to create
the instance mock before mocking the constructor. If you mock the constructor
first, then the mock framework will be unable to examine the prototype chain
when creating the mock instance.
!goog.testing.MockInterface
code »goog.testing.createFunctionMock ( opt_functionName, opt_strictness ) ⇒ goog.testing.MockInterface
Convenience method for creating a mock for a function.
goog.testing.MockInterface
code »goog.testing.createGlobalFunctionMock ( functionName, opt_strictness ) ⇒ goog.testing.MockInterface
Convenience method for creating a mocks for a global / top-level function.
goog.testing.MockInterface
code »goog.testing.createMethodMock ( scope, functionName, opt_strictness ) ⇒ !goog.testing.MockInterface
Convenience method for creating a mock for a method.
!goog.testing.MockInterface
code »goog.testing.recordConstructor ( ctor ) ⇒ !Function
Same as goog.testing.recordFunction
but the recorded function will
have the same prototype and static fields as the original one. It can be
used with constructors.
!Function
goog.testing.recordFunction
but the recorded function will
have the same prototype and static fields as the original one. It can be
used with constructors.Parameters |
---|
|
Returns |
|
code »goog.testing.recordFunction ( opt_f ) ⇒ !Function
Wraps the function into another one which calls the inner function and
records its calls. The recorded function will have 3 static methods:
getCallCount
, getCalls
and getLastCall
but won't
inherit the original function's prototype and static fields.
!Function
getCallCount
, getCalls
and getLastCall
but won't
inherit the original function's prototype and static fields.Parameters |
---|
|
Returns |
|