build: ts-api-guardian should support interface with value types (#27223)

This fixes an issue where a value would hide the type.

```
export interface Foo {
  someMethod(): void;
}

export const Foo: Function = ...;
```

In the above example the `Foo` constant will hide the `interface Foo` symbol.
This change properly saves the interface in addition to the type.

PR Close #27223
This commit is contained in:
Miško Hevery
2018-11-26 14:44:45 -08:00
committed by Jason Aden
parent 23b06af940
commit 60e403bf6d
10 changed files with 252 additions and 139 deletions

View File

@ -20,6 +20,9 @@ const UNDEFINED = new Object();
let _nextRootElementId = 0;
/**
* @publicApi
*/
export interface TestBed {
platform: PlatformRef;
@ -35,16 +38,12 @@ export interface TestBed {
*
* Test modules and platforms for individual platforms are available from
* '@angular/<platform_name>/testing'.
*
* @publicApi
*/
initTestEnvironment(
ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
/**
* Reset the providers for the test injector.
*
* @publicApi
*/
resetTestEnvironment(): void;
@ -119,8 +118,6 @@ export class TestBedViewEngine implements Injector, TestBed {
*
* Test modules and platforms for individual platforms are available from
* '@angular/<platform_name>/testing'.
*
* @publicApi
*/
static initTestEnvironment(
ngModule: Type<any>|Type<any>[], platform: PlatformRef,
@ -132,8 +129,6 @@ export class TestBedViewEngine implements Injector, TestBed {
/**
* Reset the providers for the test injector.
*
* @publicApi
*/
static resetTestEnvironment(): void { _getTestBedViewEngine().resetTestEnvironment(); }
@ -291,8 +286,6 @@ export class TestBedViewEngine implements Injector, TestBed {
*
* Test modules and platforms for individual platforms are available from
* '@angular/<platform_name>/testing'.
*
* @publicApi
*/
initTestEnvironment(
ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void {
@ -308,8 +301,6 @@ export class TestBedViewEngine implements Injector, TestBed {
/**
* Reset the providers for the test injector.
*
* @publicApi
*/
resetTestEnvironment(): void {
this.resetTestingModule();