Allow to throw on unknown properties in tests

feat(core): allow to throw on unknown properties in tests (#45853)
Allow to throw on unknown properties in testsfeatallow throw unknown properties tests core

Committed by cexbrayat

commit message
feat(core): allow to throw on unknown properties in tests (#45853)

Allows to provide a TestBed option to throw on unknown properties in templates:
 
```ts
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting(), {
    errorOnUnknownProperties: true
  }
);
```
 
The default value of `errorOnUnknownProperties` is `false`, so this is not a breaking change.
 
PR Close #45853

Editor assessment

An exemplar. The subject states the new capability - throwing on unknown properties in tests - and the body shows exact usage with a code block for the TestBed option and preempts the versioning question: the default is false, so the change is explicitly not breaking. Mechanism, example, and compatibility reasoning in one message, with an accurate feat(core) framing and clean hygiene. Homepage-worthy teaching. The pre-emptive not-breaking note shows the author reasoning about versioning on the reader's behalf, which is exemplary communication.

Browse categories

More feat examples · Back to search