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
This commit is contained in:
Cédric Exbrayat 2022-05-05 12:44:38 +02:00 committed by Andrew Kushnir
parent cd5a273edb
commit def1f0fb93
2 changed files with 17 additions and 12 deletions

View file

@ -221,15 +221,20 @@ export interface TestEnvironmentOptions {
}
// @public (undocumented)
export type TestModuleMetadata = {
providers?: any[];
export interface TestModuleMetadata {
// (undocumented)
declarations?: any[];
imports?: any[];
schemas?: Array<SchemaMetadata | any[]>;
teardown?: ModuleTeardownOptions;
errorOnUnknownElements?: boolean;
errorOnUnknownProperties?: boolean;
};
// (undocumented)
imports?: any[];
// (undocumented)
providers?: any[];
// (undocumented)
schemas?: Array<SchemaMetadata | any[]>;
// (undocumented)
teardown?: ModuleTeardownOptions;
}
// @public
export function tick(millis?: number, tickOptions?: {

View file

@ -45,11 +45,11 @@ export const ComponentFixtureNoNgZone = new InjectionToken<boolean[]>('Component
/**
* @publicApi
*/
export type TestModuleMetadata = {
providers?: any[],
declarations?: any[],
imports?: any[],
schemas?: Array<SchemaMetadata|any[]>,
export interface TestModuleMetadata {
providers?: any[];
declarations?: any[];
imports?: any[];
schemas?: Array<SchemaMetadata|any[]>;
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