Skip to content

Initializer APIs (input, output, queries) not integrating with TestBed.override in a jit & aot mix #57944

Closed

Description

@devversion

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

Activity

  1. added
    area: compiler
    on Sep 24, 2024
  2. modified the milestone: needsTriage on Sep 24, 2024
  3. added
    P3
    on Sep 24, 2024
  4. modified the milestones: needsTriage, Backlog on Sep 24, 2024
  5. changed the title [-]Initializer APIs (input, output, queries) not integrating with `TestBed.override`[/-] [+]Initializer APIs (input, output, queries) not integrating with `TestBed.override` in a jit & aot mix[/+] on Sep 24, 2024
  6. removed
    P3
    on Sep 24, 2024
  7. modified the milestones: Backlog, needsTriage on Sep 24, 2024
  8. added
    P3
    on Sep 24, 2024
  9. 12 remaining items

  10. added 3 commits that reference this issue on Sep 18, 2025
    02aa8b8
    e22d5c1
    341e7d1
  11. added a commit that references this issue on Sep 18, 2025
    ba40153
  12. added a commit that references this issue on Sep 18, 2025
    4c091ab
  13. added a commit that references this issue on Sep 19, 2025
    a04e6df
  14. added a commit that references this issue on Sep 29, 2025
    3879d25
  15. aravindsrj commented on Oct 9, 2025

    @aravindsrj

    Is this issue closed? #63957 still is open.

  16. crisbeto commented on Oct 9, 2025

    @crisbeto
    Member

    We had to roll it back, but I'm in the process of re-submitting it.

  17. added 2 commits that reference this issue on Oct 9, 2025
    ab98b24
    2c05977
  18. added a commit that references this issue on Oct 9, 2025
    8dec92f
  19. angular-automatic-lock-bot commented on Nov 9, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  20. locked and limited conversation to collaborators on Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: compilerbugcompiler: jitcore: inputs / outputscore: queriesstate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions