jest icon indicating copy to clipboard operation
jest copied to clipboard

[Bug]: module is not mocked if there's signal input in spec file (angular)

Open daryakalenik opened this issue 7 months ago • 1 comments

Version

29.7.0

Steps to reproduce

  1. Go to https://stackblitz.com/edit/stackblitz-starters-dxkhs1?file=src%2Fapp%2Fapp.component.spec.ts
  2. run 'npm run test'
  3. the second test should fail
  4. comment or delete TestComponent from spec file
  5. the second test now passes

Expected behavior

I expect my tests to use mocked service - cause service is mocked using jest.mock(...)

Actual behavior

For some reason if there's signal input (or output) in the spec file mocked service is not working & jest uses the actual one

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 PRO 4750G with Radeon Graphics
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: 29.7.0 => 29.7.0

daryakalenik avatar Jul 09 '24 21:07 daryakalenik