64 lines
1.1 KiB
Plaintext
64 lines
1.1 KiB
Plaintext
|
|
p.location-badge.
|
|
exported from <a href='../test'>angular2/test</a>
|
|
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.36/modules/angular2/src/test_lib/test_lib.ts#L314-L325">angular2/src/test_lib/test_lib.ts (line 314)</a>
|
|
|
|
:markdown
|
|
This module is used for writing tests for applications written in Angular.
|
|
|
|
This module is not included in the `angular2` module; you must import the test module explicitly.
|
|
.l-main-section
|
|
h2 Members
|
|
.l-sub-section
|
|
h3 andReturn
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
andReturn(val: any)
|
|
|
|
:markdown
|
|
By chaining the spy with and.returnValue, all calls to the function will return a specific
|
|
value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 andCallFake
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
andCallFake(fn: Function)
|
|
|
|
:markdown
|
|
By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied
|
|
function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 reset
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
reset()
|
|
|
|
:markdown
|
|
removes all recorded calls
|
|
|
|
|
|
|
|
|
|
|
|
|