How to use the jest-haste-map.getCacheFilePath function in jest-haste-map

To help you get started, we’ve selected a few jest-haste-map examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ddwhan0123 / ReactNativeDemo / RouteDemo / node_modules / jest-runtime / build / transform.js View on Github external
const getFileCachePath = (
filename,
config,
content,
instrument) =>
{
  const baseCacheDir = getCacheFilePath(
  config.cacheDirectory,
  'jest-transform-cache-' + config.name,
  VERSION);

  const cacheKey = getCacheKey(content, filename, config, instrument);
  // Create sub folders based on the cacheKey to avoid creating one
  // directory with many files.
  const cacheDir = path.join(baseCacheDir, cacheKey[0] + cacheKey[1]);
  const cachePath = path.join(
  cacheDir,
  path.basename(filename, path.extname(filename)) + '_' + cacheKey);

  createDirectory(cacheDir);

  return cachePath;
};

jest-haste-map

MIT
Latest version published 1 year ago

Package Health Score

88 / 100
Full package analysis

Similar packages