fix(closure): prevent closure renaming of testability interface (#11146)

This commit is contained in:
Alex Eagle
2016-08-29 13:08:28 -07:00
committed by Victor Berchet
parent d7de5c4f8e
commit 875e66409c
4 changed files with 16 additions and 30 deletions

View File

@ -21,7 +21,7 @@ export * from './src/zone';
export * from './src/render';
export * from './src/linker';
export {DebugElement, DebugNode, asNativeElements, getDebugNode} from './src/debug/debug_node';
export * from './src/testability/testability';
export {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from './src/testability/testability';
export * from './src/change_detection';
export * from './src/platform_core_providers';
export {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID} from './src/i18n/tokens';

View File

@ -11,7 +11,17 @@ import {Map, MapWrapper} from '../facade/collection';
import {scheduleMicroTask} from '../facade/lang';
import {NgZone} from '../zone/ng_zone';
/**
* Testability API.
* `declare` keyword causes tsickle to generate externs, so these methods are
* not renamed by Closure Compiler.
* @experimental
*/
export declare interface PublicTestability {
isStable(): boolean;
whenStable(callback: Function): void;
findProviders(using: any, provider: string, exactMatch: boolean): any[];
}
/**
* The Testability service provides testing hooks that can be accessed from
@ -20,7 +30,7 @@ import {NgZone} from '../zone/ng_zone';
* @experimental
*/
@Injectable()
export class Testability {
export class Testability implements PublicTestability {
/** @internal */
_pendingCount: number = 0;
/** @internal */