-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
🐛 Bug Report
babel-jest's getCacheKey uses a variety of factors to generate the hash used for the cache, however currently doesn't include the list of options that were passed to the createTransformer constructor. This means there are incorrect cache hits even when the underlying options have changed.
To Reproduce
Steps to reproduce the behavior:
- Create a custom transformer that's referenced by
transformin the Jest config:
// transformer.js
const { createTransformer } = require('babel-jest');
const babelOptions = { presets: ['env'] };
module.exports = createTransformer(babelOptions);- Run jest
- Modify the value of
babelOptions(for example enabling babel preset-env'sdebugoption) - Run jest again
Expected behavior
When Jest is run the second time, the previous cache entries are not re-used, and the changed babel config is seen in the results.
I'll open a PR to update getCacheKey():
https://github.com/facebook/jest/blob/d05e53a641366fcd1c2532ea845ce6fc8ce42a65/packages/babel-jest/src/index.js#L85-L105
Metadata
Metadata
Assignees
Labels
No labels