Home

# Library goog.testing

Function Summary

`createConstructorMock(?Object scope, string constructorName, number= 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.

| `createFunctionMock(string= opt_functionName, number= opt_strictness) ⇒ ?goog.testing.MockInterface` Convenience method for creating a mock for a function.
| `createGlobalFunctionMock(string functionName, number= opt_strictness) ⇒ ?goog.testing.MockInterface` Convenience method for creating a mocks for a global / top-level function.
| `createMethodMock(?Object scope, string functionName, number= opt_strictness) ⇒ ?goog.testing.MockInterface` Convenience method for creating a mock for a method.