From 8d5a312585d7e3335b81e79beaae09b6be8518b8 Mon Sep 17 00:00:00 2001 From: Julie Ralph Date: Thu, 23 Jun 2016 15:52:18 -0700 Subject: [PATCH] chore(api): clean up compiler/testing api (#9520) Do not export MockXHR, which is a private helper. --- .../@angular/compiler/test/directive_normalizer_spec.ts | 2 +- modules/@angular/compiler/test/test_bindings.ts | 3 ++- modules/@angular/compiler/test/xhr_mock_spec.ts | 2 +- modules/@angular/compiler/testing.ts | 1 - tools/public_api_guard/compiler/testing.d.ts | 8 -------- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/modules/@angular/compiler/test/directive_normalizer_spec.ts b/modules/@angular/compiler/test/directive_normalizer_spec.ts index 7f50b7326a..fb0c6bd63f 100644 --- a/modules/@angular/compiler/test/directive_normalizer_spec.ts +++ b/modules/@angular/compiler/test/directive_normalizer_spec.ts @@ -10,7 +10,7 @@ import {CompileTemplateMetadata, CompileTypeMetadata} from '@angular/compiler/sr import {CompilerConfig} from '@angular/compiler/src/config'; import {DirectiveNormalizer} from '@angular/compiler/src/directive_normalizer'; import {XHR} from '@angular/compiler/src/xhr'; -import {MockXHR} from '@angular/compiler/testing'; +import {MockXHR} from '@angular/compiler/testing/xhr_mock'; import {ViewEncapsulation} from '@angular/core/src/metadata/view'; import {beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; diff --git a/modules/@angular/compiler/test/test_bindings.ts b/modules/@angular/compiler/test/test_bindings.ts index f7c44762a9..8f300c399f 100644 --- a/modules/@angular/compiler/test/test_bindings.ts +++ b/modules/@angular/compiler/test/test_bindings.ts @@ -8,7 +8,8 @@ import {ElementSchemaRegistry, UrlResolver, XHR} from '@angular/compiler'; import {createUrlResolverWithoutPackagePrefix} from '@angular/compiler/src/url_resolver'; -import {MockSchemaRegistry, MockXHR} from '@angular/compiler/testing'; +import {MockSchemaRegistry} from '@angular/compiler/testing'; +import {MockXHR} from '@angular/compiler/testing/xhr_mock'; export var TEST_PROVIDERS: any[] = [ {provide: ElementSchemaRegistry, useValue: new MockSchemaRegistry({}, {})}, diff --git a/modules/@angular/compiler/test/xhr_mock_spec.ts b/modules/@angular/compiler/test/xhr_mock_spec.ts index 2e8a0ae48c..e7b8bcac16 100644 --- a/modules/@angular/compiler/test/xhr_mock_spec.ts +++ b/modules/@angular/compiler/test/xhr_mock_spec.ts @@ -8,7 +8,7 @@ import {beforeEach, ddescribe, describe, expect, iit, inject, it,} from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; -import {MockXHR} from '@angular/compiler/testing'; +import {MockXHR} from '@angular/compiler/testing/xhr_mock'; import {PromiseWrapper} from '../src/facade/async'; import {isPresent} from '../src/facade/lang'; diff --git a/modules/@angular/compiler/testing.ts b/modules/@angular/compiler/testing.ts index cf83c05b84..fcc0ff94c1 100644 --- a/modules/@angular/compiler/testing.ts +++ b/modules/@angular/compiler/testing.ts @@ -8,6 +8,5 @@ export * from './testing/schema_registry_mock'; export * from './testing/view_resolver_mock'; -export * from './testing/xhr_mock'; export * from './testing/test_component_builder'; export * from './testing/directive_resolver_mock'; diff --git a/tools/public_api_guard/compiler/testing.d.ts b/tools/public_api_guard/compiler/testing.d.ts index 5a5d26728e..3ba36ffa09 100644 --- a/tools/public_api_guard/compiler/testing.d.ts +++ b/tools/public_api_guard/compiler/testing.d.ts @@ -51,14 +51,6 @@ export declare class MockViewResolver extends ViewResolver { resolve(component: Type): ViewMetadata; } -export declare class MockXHR extends XHR { - get(url: string): Promise; - expect(url: string, response: string): void; - when(url: string, response: string): void; - flush(): void; - verifyNoOutstandingExpectations(): void; -} - export declare class TestComponentBuilder { constructor(_injector: Injector); overrideTemplate(componentType: Type, template: string): TestComponentBuilder;