angular/packages/platform-browser/testing/src
Kristiyan Kostadinov cec91c0035 feat(core): add option to infer the tag names of components in tests (#62283)
Currently when testing a component using `TestBed.createComponent`, we always create the component as a `div` which isn't aligned with the runtime. The runtime tries to parse out the tag name from the first selector in `@Component` and only falls back to `div` if there isn't one. This behavior difference can cause components to not behave like they would in production which reduces the usefulness of the tests.

These changes add the `inferTagName` option to `TestBed.createComponent` and `TestBed.configureTestingModule` that allows apps to opt into inferring the tag name from the selector in the same way as the runtime. Currently the new option is set to `false`, but we intend to change it to `true` in a future version.

PR Close #62283
2025-07-23 07:30:36 -04:00
..
browser.ts refactor: add explicit types for exports relying on inferred call return type (#61312) 2025-05-13 22:45:18 +00:00
dom_test_component_renderer.ts feat(core): add option to infer the tag names of components in tests (#62283) 2025-07-23 07:30:36 -04:00
testing.ts fix(platform-browser): ensure platformBrowserTesting includes platformBrowser providers (#60480) 2025-03-20 12:33:12 -07:00