Skip to content

Commit

Permalink
Remove all special characters from filename prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
etr2460 committed Apr 22, 2019
1 parent 6f47664 commit 0737f6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -19,7 +19,7 @@
- `[jest-haste-map]` Fix the `mapper` option which was incorrectly ignored ([#8299](https://github.com/facebook/jest/pull/8299))
- `[jest-jasmine2]` Fix describe return value warning being shown if the describe function throws ([#8335](https://github.com/facebook/jest/pull/8335))
- `[jest-environment-jsdom]` Re-declare global prototype of JSDOMEnvironment ([#8352](https://github.com/facebook/jest/pull/8352))
- `[jest-transform]` Replace colons in transform cache filenames to support Windows ([#8353](https://github.com/facebook/jest/pull/8353))
- `[jest-transform]` Replace special characters in transform cache filenames to support Windows ([#8353](https://github.com/facebook/jest/pull/8353))

### Chore & Maintenance

Expand Down
3 changes: 1 addition & 2 deletions packages/jest-transform/src/ScriptTransformer.ts
Expand Up @@ -94,7 +94,6 @@ export default class ScriptTransformer {
rootDir: this._config.rootDir,
}),
)
.update(filename)
.update(CACHE_VERSION)
.digest('hex');
} else {
Expand Down Expand Up @@ -125,7 +124,7 @@ export default class ScriptTransformer {
const cacheDir = path.join(baseCacheDir, cacheKey[0] + cacheKey[1]);
const cacheFilenamePrefix = path
.basename(filename, path.extname(filename))
.replace(/:/g, '_COLON_');
.replace(/\W/g, '');
const cachePath = slash(
path.join(cacheDir, cacheFilenamePrefix + '_' + cacheKey),
);
Expand Down

0 comments on commit 0737f6b

Please sign in to comment.