feat(upgrade): enable Angular 1 unit testing of upgrade module

- New method `UpgradeAdapter.registerForNg1Tests(modules)` declares the
  Angular 1 upgrade module and provides it to the `angular.mock.module()`
  helper.
  This prevents the need to bootstrap the entire hybrid for every test.

Closes #5462, #12675
This commit is contained in:
Eudes Petonnet-Vincent
2016-11-03 22:25:13 +00:00
committed by Victor Berchet
parent 86c50983d7
commit 2fc0560988
2 changed files with 56 additions and 2 deletions

View File

@ -4,6 +4,7 @@ export declare class UpgradeAdapter {
bootstrap(element: Element, modules?: any[], config?: angular.IAngularBootstrapConfig): UpgradeAdapterRef;
downgradeNg2Component(type: Type<any>): Function;
downgradeNg2Provider(token: any): Function;
registerForNg1Tests(modules?: string[]): UpgradeAdapterRef;
upgradeNg1Component(name: string): Type<any>;
upgradeNg1Provider(name: string, options?: {
asToken: any;