This is more of an issue report but with a full example to better illustrate the issue.
Have you given some thought to how we force jest to run the transformer again on every file that is affected by a change?
Imagine this case:
Given Compound.svelte which imports Sample.svelte
If I change something in Sample.svelte that affects how Compound.svelte behaves and therefore changes actual values in Compound.spec.jsjest will only re-transform Sample.svelte. This means Compound.svelte will still return the same test result.
You can try this by checking out this branch and
run jest (fills transform cache, passes)
change the initial value of clicks in Sample.svelte to 1
run jest again and now only Sample.svelte will fail while Compound.svelte still passes
run yarn jest --clearCache
run yarn test and now both cases will fail
jest --no-cache does only work if you run it on all tests. Once you add a pattern to it or let it run only on changed files we observe the same behavior as with cache.
It is not an issue with jest not re-running. If I only run Compound.spec.js it will still re-run if I make changes to Sample.svelte.
This is more of an issue report but with a full example to better illustrate the issue.
Have you given some thought to how we force
jest
to run the transformer again on every file that is affected by a change?Imagine this case:
Compound.svelte
which importsSample.svelte
Sample.svelte
that affects howCompound.svelte
behaves and therefore changes actual values inCompound.spec.js
jest
will only re-transformSample.svelte
. This meansCompound.svelte
will still return the same test result.jest
(fills transform cache, passes)clicks
inSample.svelte
to1
jest
again and now onlySample.svelte
will fail whileCompound.svelte
still passesyarn jest --clearCache
yarn test
and now both cases will failjest --no-cache
does only work if you run it on all tests. Once you add a pattern to it or let it run only on changed files we observe the same behavior as with cache.It is not an issue with jest not re-running. If I only run
Compound.spec.js
it will still re-run if I make changes toSample.svelte
.