Skip to content

Commit

Permalink
add cache breaker to make sure we can go back easily from this change…
Browse files Browse the repository at this point in the history
…, ex. revert
  • Loading branch information
Jean Lauliac committed Jul 20, 2017
1 parent f102dba commit 9752fe4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/jest-runtime/src/script_transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const configToJsonMap = new Map();
// Cache regular expressions to test whether the file needs to be preprocessed
const ignoreCache: WeakMap<ProjectConfig, ?RegExp> = new WeakMap();

// To reset the cache for specific changesets (rather than package version).
const CACHE_BREAKER = '1';

class ScriptTransformer {
static EVAL_RESULT_VARIABLE: string;
_config: ProjectConfig;
Expand Down Expand Up @@ -79,6 +82,7 @@ class ScriptTransformer {
.update(configString)
.update(instrument ? 'instrument' : '')
.update(mapCoverage ? 'mapCoverage' : '')
.update(CACHE_BREAKER)
.digest('hex');
}
}
Expand Down

0 comments on commit 9752fe4

Please sign in to comment.