refactor(core): remove withBody from public testing API (#25171)
PR Close #25171
This commit is contained in:
parent
aafd502bcb
commit
6e2a1877ab
|
@ -27,6 +27,7 @@ ts_library(
|
|||
"//packages/platform-browser-dynamic",
|
||||
"//packages/platform-browser/animations",
|
||||
"//packages/platform-browser/testing",
|
||||
"//packages/private/testing",
|
||||
"//packages/router",
|
||||
"//packages/router/testing",
|
||||
"@rxjs",
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
*/
|
||||
|
||||
import {ApplicationModule, ApplicationRef, DoCheck, InjectFlags, InjectorType, Input, OnInit, PlatformRef, TestabilityRegistry, Type, defineInjector, inject, ɵE as elementStart, ɵNgModuleDef as NgModuleDef, ɵRenderFlags as RenderFlags, ɵT as text, ɵdefineComponent as defineComponent, ɵe as elementEnd, ɵi1 as interpolation1, ɵt as textBinding} from '@angular/core';
|
||||
import {getTestBed, withBody} from '@angular/core/testing';
|
||||
import {getTestBed} from '@angular/core/testing';
|
||||
import {BrowserModule, EVENT_MANAGER_PLUGINS, platformBrowser} from '@angular/platform-browser';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
|
||||
import {BROWSER_MODULE_PROVIDERS} from '../../platform-browser/src/browser';
|
||||
import {APPLICATION_MODULE_PROVIDERS} from '../src/application_module';
|
||||
|
|
|
@ -38,6 +38,7 @@ ts_library(
|
|||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {withBody} from '@angular/core/testing';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ ts_library(
|
|||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ ts_library(
|
|||
":injection",
|
||||
"//packages:types",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ ts_library(
|
|||
"//packages:types",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {ɵwhenRendered as whenRendered} from '@angular/core';
|
||||
import {withBody} from '@angular/core/testing';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ ts_library(
|
|||
"//packages/platform-browser",
|
||||
"//packages/platform-browser/animations",
|
||||
"//packages/platform-browser/testing",
|
||||
"//packages/private/testing",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {withBody} from '@angular/core/testing';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, DoCheck} from '../../src/core';
|
||||
import {getRenderedText, whenRendered} from '../../src/render3/component';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {NgForOf, NgForOfContext} from '@angular/common';
|
||||
import {Component, ContentChild, Directive, EventEmitter, Injectable, Input, NgModule, OnDestroy, Optional, Output, Pipe, PipeTransform, QueryList, SimpleChanges, TemplateRef, Type, ViewChild, ViewContainerRef, defineInjectable, defineInjector} from '@angular/core';
|
||||
import {withBody} from '@angular/core/testing';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
|
||||
import * as r3 from '../../../src/render3/index';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {withBody} from '@angular/core/testing';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
|
||||
describe('testing', () => {
|
||||
describe('withBody', () => {
|
||||
|
|
|
@ -19,4 +19,3 @@ export * from './test_bed';
|
|||
export * from './before_each';
|
||||
export * from './metadata_override';
|
||||
export * from './private_export_testing';
|
||||
export * from './render3';
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
exports_files(["package.json"])
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "testing",
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
),
|
||||
module_name = "@angular/private/testing",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
],
|
||||
)
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './src/render3';
|
|
@ -62,6 +62,7 @@ System.config({
|
|||
'@angular/platform-server': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/private/testing': {main: 'index.js', defaultExtension: 'js'},
|
||||
'@angular/elements': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js'},
|
||||
'rxjs/operators': {main: 'index.js', defaultExtension: 'js'},
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
export declare function async(fn: Function): (done: any) => any;
|
||||
|
||||
/** @experimental */
|
||||
export declare function cleanupDocument(): void;
|
||||
|
||||
export declare class ComponentFixture<T> {
|
||||
changeDetectorRef: ChangeDetectorRef;
|
||||
componentInstance: T;
|
||||
|
@ -30,9 +27,6 @@ export declare const ComponentFixtureNoNgZone: InjectionToken<boolean[]>;
|
|||
/** @experimental */
|
||||
export declare function discardPeriodicTasks(): void;
|
||||
|
||||
/** @experimental */
|
||||
export declare function ensureDocument(): void;
|
||||
|
||||
/** @experimental */
|
||||
export declare function fakeAsync(fn: Function): (...args: any[]) => any;
|
||||
|
||||
|
@ -147,9 +141,6 @@ export declare type TestModuleMetadata = {
|
|||
/** @experimental */
|
||||
export declare function tick(millis?: number): void;
|
||||
|
||||
/** @experimental */
|
||||
export declare function withBody<T extends Function>(html: string, blockFn: T): T;
|
||||
|
||||
/** @experimental */
|
||||
export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
|
||||
export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
|
||||
|
|
Loading…
Reference in New Issue