Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest-config: use UID for default cache folder #3380

Merged
merged 1 commit into from
Apr 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/jest-config/src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ module.exports = ({
automock: false,
bail: false,
browser: false,
cacheDirectory: path.join(os.tmpdir(), 'jest'),
cacheDirectory: (() => {
if (process.getuid == null) {
return path.join(os.tmpdir(), 'jest');
}
// 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(os.tmpdir(), 'jest', process.getuid().toString(36));
})(),
clearMocks: false,
coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
coverageReporters: ['json', 'text', 'lcov', 'clover'],
Expand Down