Skip to content

Commit

Permalink
refactor(core): declare TestModuleMetadata as an interface (#45891)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cexbrayat authored and AndrewKushnir committed May 9, 2022
1 parent cd5a273 commit def1f0f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 10 additions & 5 deletions goldens/public-api/core/testing/index.md
Expand Up @@ -221,15 +221,20 @@ export interface TestEnvironmentOptions {
}

// @public (undocumented)
export type TestModuleMetadata = {
providers?: any[];
export interface TestModuleMetadata {
// (undocumented)
declarations?: any[];
errorOnUnknownElements?: boolean;
errorOnUnknownProperties?: boolean;
// (undocumented)
imports?: any[];
// (undocumented)
providers?: any[];
// (undocumented)
schemas?: Array<SchemaMetadata | any[]>;
// (undocumented)
teardown?: ModuleTeardownOptions;
errorOnUnknownElements?: boolean;
errorOnUnknownProperties?: boolean;
};
}

// @public
export function tick(millis?: number, tickOptions?: {
Expand Down
12 changes: 6 additions & 6 deletions packages/core/testing/src/test_bed_common.ts
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit def1f0f

Please sign in to comment.