jest
jest copied to clipboard
[Bug]: module is not mocked if there's signal input in spec file (angular)
Version
29.7.0
Steps to reproduce
- Go to https://stackblitz.com/edit/stackblitz-starters-dxkhs1?file=src%2Fapp%2Fapp.component.spec.ts
- run 'npm run test'
- the second test should fail
- comment or delete TestComponent from spec file
- 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