Open
Description
What happened?
If I change something in a testing lib the packages using them over setupFiles
or globalSetup
in vitest.config.ts
have a false cache hit.
The problem:
Project models
als all other projects miss the dependencies to testing files referenced in vitest.config.ts
.
What would you expect to happen?
If I change something in a testing lib the packages using them over setupFiles
or globalSetup
in vitest.config.ts
do not have a cache hit.
Possible Solutions:
- add
implicitDependencies
to all relevant testing targets - quick but not fine-grained also the biggest downside is our build and any other target in the project would be affected.⚠️ - add the used files from
vitest.config.ts
as targetinputs/namedInputs
- fine-grained but only maintainable over custom plugin that adds the inputs. But as the used filse insetupFiles
orglobalSetup
change it has to be dynamically detected.
What steps did you take?
- ✅ Test the project
modles
inpackages/models
and verify cache hit
# [existing outputs match the cache, left as is] <= ✅ this is correct. It should have a cache hit
nx run models:unit-test
- ✅ Apply any code change in the project
testing-setup
in foldertesting/setup
and save the change to your filesystem - ❌ Test the project
modles
inpackages/models
and verify NO cache hit -nx unit-test models
# [existing outputs match the cache, left as is] <= ❌ this is not correct. It should not have a cache hit
nx run models:unit-test
Code PushUp package version
No response
What operation system are you on?
MacOS
Node version
24