Skip to content

Commit

Permalink
fix(core): temporarily remove @deprecated jsdoc tag for a TextBed.get…
Browse files Browse the repository at this point in the history
… overload (#30514)

PR #29290 introduced a new `TestBed.get` signature and deprecated the existing one.
This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see #29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it.

Refs #29905
Fixes FW-1336

PR Close #30514
  • Loading branch information
cexbrayat authored and jasonaden committed May 21, 2019
1 parent 6debe9d commit f6bf892
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/core/testing/src/test_bed.ts
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ export interface TestBed {
compileComponents(): Promise<any>; compileComponents(): Promise<any>;


get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any; get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;

// TODO: switch back to official deprecation marker once TSLint issue is resolved
// https://github.com/palantir/tslint/issues/4522
/** /**
* @deprecated from v8.0.0 use Type<T> or InjectionToken<T> * deprecated from v8.0.0 use Type<T> or InjectionToken<T>
* This does not use the deprecated jsdoc tag on purpose
* because it renders all overloads as deprecated in TSLint
* due to https://github.com/palantir/tslint/issues/4522.
*/ */
get(token: any, notFoundValue?: any): any; get(token: any, notFoundValue?: any): any;


Expand Down
2 changes: 1 addition & 1 deletion tools/public_api_guard/core/testing.d.ts
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface TestBed {
createComponent<T>(component: Type<T>): ComponentFixture<T>; createComponent<T>(component: Type<T>): ComponentFixture<T>;
execute(tokens: any[], fn: Function, context?: any): any; execute(tokens: any[], fn: Function, context?: any): any;
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any; get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
/** @deprecated */ get(token: any, notFoundValue?: any): any; get(token: any, notFoundValue?: any): any;
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void; initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void; overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void; overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
Expand Down

0 comments on commit f6bf892

Please sign in to comment.