angular/packages/core/testing
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
..
src feat(core): add option to infer the tag names of components in tests (#62283) 2025-07-23 07:30:36 -04:00
BUILD.bazel build: remove all usages of the interop_deps attr for ts_project and ng_project (#62732) 2025-07-21 13:03:09 -04:00
index.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
PACKAGE.md docs: add api doc to sub-packages (#33801) 2019-11-20 14:48:50 -08:00
public_api.ts build: migrate platform-browser and platform-browser-dynamic package to use rules_js (#61623) 2025-05-23 15:14:00 -07:00