From ec4294d124e41cee8aad102b462f79f2739f90eb Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Wed, 8 May 2019 21:47:52 +0200 Subject: [PATCH] Avoid test collisions by using different directories in runInTempDirectory --- jest/runInTempDirectory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jest/runInTempDirectory.js b/jest/runInTempDirectory.js index c6d025eb3..cddd8246c 100644 --- a/jest/runInTempDirectory.js +++ b/jest/runInTempDirectory.js @@ -3,10 +3,10 @@ import path from 'path' import rimraf from 'rimraf' -const tmpPath = path.resolve(__dirname, '../__tmp') - export default function(callback) { return new Promise(resolve => { + const timestamp = new Date().valueOf() + const tmpPath = path.resolve(__dirname, `../__tmp_${timestamp}`) const currentPath = process.cwd() rimraf.sync(tmpPath)