Replace <rootDir> prior to path.join().
Replace <rootDir> prior to path.join().

This allows outputDirectory to be formatted like <rootDir>/../some/dir. In that case, path.join() assumes the .. cancels out the <rootDir>, which seems entirely reasonable. Unfortunately, it means the final value is some/dir, and that ends up rooted at process.cwd(), which doesn't always match <rootDir>.

Handling the <rootDir> replacement first allevaites this problem.

palmerj3/jest-junit