Skip to content

Commit 11dfbde

Browse files
committed
Use process.env.JEST_WORKER_ID
1 parent ec4294d commit 11dfbde

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jest/runInTempDirectory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import rimraf from 'rimraf'
55

66
export default function(callback) {
77
return new Promise(resolve => {
8-
const timestamp = new Date().valueOf()
9-
const tmpPath = path.resolve(__dirname, `../__tmp_${timestamp}`)
8+
const workerId = process.env.JEST_WORKER_ID
9+
const tmpPath = path.resolve(__dirname, `../__tmp_${workerId}`)
1010
const currentPath = process.cwd()
1111

1212
rimraf.sync(tmpPath)

0 commit comments

Comments
 (0)