Instantiating the test component within an NgZone will let us track async tasks in event handlers and change detection.
We can also do auto change detection when triggering events through dispatchEvent and not have to do fixture.detectChange() manually in the test.
New API:
ComponentFixture.autoDetectChanges() - This puts the fixture in auto detect mode that automatically calls detectChanges when the microtask queue is empty (Similar to how change detection is triggered in an actual application).
ComponentFixture.isStable() - This returns a boolean whether the fixture is currently stable or has some async tasks that need to be completed.
ComponentFixture.whenStable() - This returns a promise that is resolved when the fixture is stable after all async tasks are complete.
Closes#8301
When a component uses a list of directives, such as `ROUTER_DIRECTIVES`,
make `TestComponentBuilder#overrideDirective` work properly for members
of the list.
Closes#7397Closes#8217
The component fixture returned from the test component builder
now exports `nativeElement` and `componentInstance` members
directly. They are also still available on the `debugElement`.
See #5385
Change beforeEachBindings to beforeEachProviders but preserve the
@deprecated method beforeEachBindings, in order to keep a working
deprecation warning
All common directives, forms, and pipes have been moved out of angular2/core,
but we kept reexporting them to make transition easier.
This commit removes the reexports.
BREAKING CHANGE
Before
import {NgIf} from 'angular2/core';
After
import {NgIf} from 'angular2/common';
Closes#5362