From def1f0fb93f435b51ec0d71cdb519022d8360bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Exbrayat?= Date: Thu, 5 May 2022 12:44:38 +0200 Subject: [PATCH] refactor(core): declare TestModuleMetadata as an interface (#45891) This allows the documentation for the options `errorOnUnknownElements` and `errorOnUnknownProperties` to be displayed in the docs. They aren't currently displayed, as `TestModuleMetadata` is a type and not an interface. See https://next.angular.io/api/core/testing/TestModuleMetadata PR Close #45891 --- goldens/public-api/core/testing/index.md | 17 +++++++++++------ packages/core/testing/src/test_bed_common.ts | 12 ++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/goldens/public-api/core/testing/index.md b/goldens/public-api/core/testing/index.md index 385c8fef108..c87ce437d2a 100644 --- a/goldens/public-api/core/testing/index.md +++ b/goldens/public-api/core/testing/index.md @@ -221,15 +221,20 @@ export interface TestEnvironmentOptions { } // @public (undocumented) -export type TestModuleMetadata = { - providers?: any[]; +export interface TestModuleMetadata { + // (undocumented) declarations?: any[]; - imports?: any[]; - schemas?: Array; - teardown?: ModuleTeardownOptions; errorOnUnknownElements?: boolean; errorOnUnknownProperties?: boolean; -}; + // (undocumented) + imports?: any[]; + // (undocumented) + providers?: any[]; + // (undocumented) + schemas?: Array; + // (undocumented) + teardown?: ModuleTeardownOptions; +} // @public export function tick(millis?: number, tickOptions?: { diff --git a/packages/core/testing/src/test_bed_common.ts b/packages/core/testing/src/test_bed_common.ts index ce27e112eeb..3ed81137876 100644 --- a/packages/core/testing/src/test_bed_common.ts +++ b/packages/core/testing/src/test_bed_common.ts @@ -45,11 +45,11 @@ export const ComponentFixtureNoNgZone = new InjectionToken('Component /** * @publicApi */ -export type TestModuleMetadata = { - providers?: any[], - declarations?: any[], - imports?: any[], - schemas?: Array, +export interface TestModuleMetadata { + providers?: any[]; + declarations?: any[]; + imports?: any[]; + schemas?: Array; teardown?: ModuleTeardownOptions; /** * Whether NG0304 runtime errors should be thrown when unknown elements are present in component's @@ -65,7 +65,7 @@ export type TestModuleMetadata = { * @see https://angular.io/errors/NG8002 for the description of the error and how to fix it */ errorOnUnknownProperties?: boolean; -}; +} /** * @publicApi