Skip to content

Commit a7aedde

Browse files
authored
Merge pull request #902 from CvX/test-collision
Avoid test collisions by using different directories in runInTempDirectory
2 parents b68f7ee + 11dfbde commit a7aedde

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
@@ -3,10 +3,10 @@ import path from 'path'
33

44
import rimraf from 'rimraf'
55

6-
const tmpPath = path.resolve(__dirname, '../__tmp')
7-
86
export default function(callback) {
97
return new Promise(resolve => {
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)