Skip to content

Commit

Permalink
DEV CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchhentgesspotify committed Oct 17, 2022
1 parent ac8ec97 commit 08ef4d6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ class ScriptTransformer {
const cacheFilenamePrefix = path
.basename(filename, path.extname(filename))
.replace(/\W/g, '');
return slash(path.join(cacheDir, `${cacheFilenamePrefix}_${cacheKey}`));
return slash(
path.join(cacheDir, `${cacheFilenamePrefix}_${cacheKey}`),
);
}

private _getFileCachePath(
Expand All @@ -240,7 +242,9 @@ class ScriptTransformer {
): Promise<string> {
const cacheKey = await this._getCacheKeyAsync(content, filename, options);

return this._createCachedFilename(filename, cacheKey);
const tmp = this._createCachedFilename(filename, cacheKey);
// createDirectory(path.dirname(tmp));
return tmp;
}

private _getTransformPath(filename: string) {
Expand Down Expand Up @@ -462,6 +466,7 @@ class ScriptTransformer {
const {transformer, transformerConfig = {}} =
this._getTransformer(filename) ?? {};
const cacheFilePath = this._getFileCachePath(filename, content, options);
createDirectory(path.dirname(cacheFilePath));
const sourceMapPath = `${cacheFilePath}.map`;
// Ignore cache if `config.cache` is set (--no-cache)
const code = this._config.cache ? readCodeCacheFile(cacheFilePath) : null;
Expand Down Expand Up @@ -522,6 +527,7 @@ class ScriptTransformer {
content,
options,
);
createDirectory(path.dirname(cacheFilePath));
const sourceMapPath = `${cacheFilePath}.map`;
// Ignore cache if `config.cache` is set (--no-cache)
const code = this._config.cache ? readCodeCacheFile(cacheFilePath) : null;
Expand Down

0 comments on commit 08ef4d6

Please sign in to comment.