Skip to content

Instantly share code, notes, and snippets.

@Globegitter
Created March 21, 2019 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Globegitter/ef72bba83e12a21480f33be22877a641 to your computer and use it in GitHub Desktop.
Save Globegitter/ef72bba83e12a21480f33be22877a641 to your computer and use it in GitHub Desktop.
jest 24.5.0 symlink patches
diff --git a/node_modules/@jest/transform/build/ScriptTransformer.js b/node_modules/@jest/transform/build/ScriptTransformer.js
index 81397c7..7589de2 100644
--- a/node_modules/@jest/transform/build/ScriptTransformer.js
+++ b/node_modules/@jest/transform/build/ScriptTransformer.js
@@ -328,7 +328,7 @@ class ScriptTransformer {
}
transformSource(filepath, content, instrument) {
- const filename = this._getRealPath(filepath);
+ const filename = filepath;
const transform = this._getTransformer(filename);
diff --git a/node_modules/jest-haste-map/build/crawlers/node.js b/node_modules/jest-haste-map/build/crawlers/node.js
index e058039..e39bee7 100644
--- a/node_modules/jest-haste-map/build/crawlers/node.js
+++ b/node_modules/jest-haste-map/build/crawlers/node.js
@@ -165,7 +165,7 @@ function find(roots, extensions, ignore, callback) {
}
function findNative(roots, extensions, ignore, callback) {
- const args = Array.from(roots);
+ const args = Array.from(['-L'].concat(roots));
args.push('-type', 'f');
if (extensions.length) {
diff --git a/node_modules/jest-haste-map/build/index.js b/node_modules/jest-haste-map/build/index.js
index e171c09..f81b12c 100644
--- a/node_modules/jest-haste-map/build/index.js
+++ b/node_modules/jest-haste-map/build/index.js
@@ -338,7 +338,7 @@ class HasteMap extends _events().default {
roots: Array.from(new Set(options.roots)),
skipPackageJson: !!options.skipPackageJson,
throwOnModuleCollision: !!options.throwOnModuleCollision,
- useWatchman: options.useWatchman == null ? true : options.useWatchman,
+ useWatchman: false,
watch: !!options.watch
};
this._console = options.console || global.console;
diff --git a/node_modules/jest-resolve/build/defaultResolver.js b/node_modules/jest-resolve/build/defaultResolver.js
index 64e7387..b5b74d3 100644
--- a/node_modules/jest-resolve/build/defaultResolver.js
+++ b/node_modules/jest-resolve/build/defaultResolver.js
@@ -137,7 +137,7 @@ function resolveSync(target, options) {
if (result) {
// Dereference symlinks to ensure we don't create a separate
// module instance depending on how it was referenced.
- result = _fs().default.realpathSync(result);
+ // result = _fs().default.realpathSync(result);
}
return result;
diff --git a/node_modules/jest-resolve/build/nodeModulesPaths.js b/node_modules/jest-resolve/build/nodeModulesPaths.js
index 8d9d10f..5d55456 100644
--- a/node_modules/jest-resolve/build/nodeModulesPaths.js
+++ b/node_modules/jest-resolve/build/nodeModulesPaths.js
@@ -55,14 +55,7 @@ function nodeModulesPaths(basedir, options) {
} // The node resolution algorithm (as implemented by NodeJS and TypeScript)
// traverses parents of the physical path, not the symlinked path
- let physicalBasedir;
-
- try {
- physicalBasedir = (0, _realpathNative().sync)(basedirAbs);
- } catch (err) {
- // realpath can throw, e.g. on mapped drives
- physicalBasedir = basedirAbs;
- }
+ let physicalBasedir = basedirAbs;
const paths = [physicalBasedir];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment