Skip to content

Commit

Permalink
Undo change to SearchSource.js due to jestjs#7146; address other feed…
Browse files Browse the repository at this point in the history
…back
  • Loading branch information
willsmythe committed Jan 14, 2019
1 parent abf9347 commit dcafcfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/jest-cli/src/SearchSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import testPathPatternToRegExp from './testPathPatternToRegexp';
import {escapePathForRegex} from 'jest-regex-util';
import {replaceRootDirInPath} from 'jest-config';
import {buildSnapshotResolver} from 'jest-snapshot';
import {sync as realpath} from 'realpath-native';

type SearchResult = {|
noSCM?: boolean,
Expand Down
15 changes: 7 additions & 8 deletions packages/jest-config/src/getCacheDirectory.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ import {sync as realpath} from 'realpath-native';

const getCacheDirectory = () => {
const {getuid} = process;
const tmpdir = path.join(realpath(os.tmpdir()), 'jest');
if (getuid == null) {
return path.join(realpath(os.tmpdir()), 'jest');
return tmpdir;
} else {
// On some platforms tmpdir() is `/tmp`, causing conflicts between different
// users and permission issues. Adding an additional subdivision by UID can
// help.
return `${tmpdir}_${getuid.call(process).toString(36)}`;
}
// On some platforms tmpdir() is `/tmp`, causing conflicts between different
// users and permission issues. Adding an additional subdivision by UID can
// help.
return path.join(
realpath(os.tmpdir()),
'jest_' + getuid.call(process).toString(36),
);
};

export default getCacheDirectory;

0 comments on commit dcafcfd

Please sign in to comment.