Skip to content

[Bug]: Declaration of TestComponent with signal input breaks jest.mock #2530

Open
@MillerSvt

Description

@MillerSvt

Version

14.1.0

Steps to reproduce

  1. clone https://github.com/MillerSvt/jest-preset-angular-bug-repro
  2. run npm i
  3. run nx test app

Expected behavior

Test pass, jest.mock works in test-with-input.spec.ts

Actual behavior

jest.mock not works in test-with-input.spec.ts. Test fails.

Additional context

Temporary workaround

Declare TestComponent in separate file.

Environment

Need to install the following packages:
[email protected]
Ok to proceed? (y) y

  System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.12.2/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
  npmPackages:
    jest: ^29.4.1 => 29.7.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions