From 7afee97d1b837cdc808b0a5e5206c306f5700263 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 14 Jun 2016 17:21:16 -0700 Subject: [PATCH] fix(platform-server): correctly import private DOMTestComponentRenderer --- .../platform-browser-dynamic/private_export_testing.ts | 10 ++++++++++ modules/@angular/platform-browser-dynamic/testing.ts | 2 ++ .../platform_browser_dynamic_testing_private.ts | 3 +++ modules/@angular/platform-server/testing/server.ts | 2 +- tools/public_api_guard/public_api_spec.ts | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 modules/@angular/platform-browser-dynamic/private_export_testing.ts create mode 100644 modules/@angular/platform-server/platform_browser_dynamic_testing_private.ts diff --git a/modules/@angular/platform-browser-dynamic/private_export_testing.ts b/modules/@angular/platform-browser-dynamic/private_export_testing.ts new file mode 100644 index 0000000000..99649bbb6a --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/private_export_testing.ts @@ -0,0 +1,10 @@ +import * as testing from './testing/dom_test_component_renderer'; + +export declare namespace __platform_browser_dynamic_private_types__ { + export type DOMTestComponentRenderer = testing.DOMTestComponentRenderer; + export var DOMTestComponentRenderer: typeof testing.DOMTestComponentRenderer; +} + +export var __platform_browser_dynamic_private__ = { + DOMTestComponentRenderer: testing.DOMTestComponentRenderer +}; diff --git a/modules/@angular/platform-browser-dynamic/testing.ts b/modules/@angular/platform-browser-dynamic/testing.ts index b84efb3653..62cfeacf68 100644 --- a/modules/@angular/platform-browser-dynamic/testing.ts +++ b/modules/@angular/platform-browser-dynamic/testing.ts @@ -5,6 +5,8 @@ import {TEST_BROWSER_APPLICATION_PROVIDERS, TEST_BROWSER_PLATFORM_PROVIDERS} fro import {BROWSER_APP_COMPILER_PROVIDERS} from './index'; import {DOMTestComponentRenderer} from './testing/dom_test_component_renderer'; +export * from './private_export_testing' + /** * Default platform providers for testing. */ diff --git a/modules/@angular/platform-server/platform_browser_dynamic_testing_private.ts b/modules/@angular/platform-server/platform_browser_dynamic_testing_private.ts new file mode 100644 index 0000000000..bc9af26f9d --- /dev/null +++ b/modules/@angular/platform-server/platform_browser_dynamic_testing_private.ts @@ -0,0 +1,3 @@ +import {__platform_browser_dynamic_private__ as r, __platform_browser_dynamic_private_types__ as t} from '@angular/platform-browser-dynamic/testing'; + +export var DOMTestComponentRenderer: typeof t.DOMTestComponentRenderer = r.DOMTestComponentRenderer; diff --git a/modules/@angular/platform-server/testing/server.ts b/modules/@angular/platform-server/testing/server.ts index 3ae70e654f..70dc52e1d4 100644 --- a/modules/@angular/platform-server/testing/server.ts +++ b/modules/@angular/platform-server/testing/server.ts @@ -2,10 +2,10 @@ import {MockLocationStrategy} from '@angular/common/testing'; import {COMPILER_PROVIDERS, DirectiveResolver, ViewResolver, XHR} from '@angular/compiler'; import {MockDirectiveResolver, MockViewResolver, TestComponentBuilder, TestComponentRenderer} from '@angular/compiler/testing'; import {APPLICATION_COMMON_PROVIDERS, APP_ID, NgZone, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, RootRenderer} from '@angular/core'; -import {DOMTestComponentRenderer} from '@angular/platform-browser-dynamic/testing'; import {BrowserDetection} from '@angular/platform-browser/testing'; import {AnimationDriver, NoOpAnimationDriver} from '../core_private'; +import {DOMTestComponentRenderer} from '../platform_browser_dynamic_testing_private'; import {Parse5DomAdapter} from '../src/parse5_adapter'; import {DOCUMENT, BROWSER_SANITIZATION_PROVIDERS, EventManager, EVENT_MANAGER_PLUGINS, ELEMENT_PROBE_PROVIDERS, DomEventsPlugin,} from '@angular/platform-browser'; diff --git a/tools/public_api_guard/public_api_spec.ts b/tools/public_api_guard/public_api_spec.ts index fb0af64105..c142c9c8e6 100644 --- a/tools/public_api_guard/public_api_spec.ts +++ b/tools/public_api_guard/public_api_spec.ts @@ -1656,6 +1656,7 @@ const PLATFORM_BROWSER_DYNAMIC = [ const PLATFORM_BROWSER_DYNAMIC_TESTING = [ 'const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS:Array', 'const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS:Array', + 'var __platform_browser_dynamic_private__:any', ];