-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugcompiler: jitcore: inputs / outputscore: queriesstate: has PR
Milestone
Description
Investigation result of: #57668
TestBed.overrideComponent seems to not work well with signal inputs, queries, output, or other non-decorator APIs.
That is because the setClassMetadata calls (generated for JIT) are used to re-compile the component with the overrides — but there is no decorator for the e.g. input() calls, hence this metadata is lost.
Options I could see:
- Smartly merging directly with the original component metadata in TestBed.
- Will be hard to detect output as it's non-distinguishable from decorator outputs.
- I guess, we could fully re-use inputs, queries etc. metadata instead of relying on prop decorators..?
- Adding synthetic prop decorators to
setClassMetadata.- Would be great to re-use the JIT transforms.. but those need an import manager; so needs a bit of refactoring!
Note: I do think this may not be a problem in Angular CLI applications because full tests are compiled with JIT transforms in place! Here it fails because we mix AOT targets with JIT targets; without any JIT transforms
sheikalthaf and ankypant
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugcompiler: jitcore: inputs / outputscore: queriesstate: has PR