Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force top-level graceful-fs to be 4.2.4, and add a sanity test
(This makes sure all the graceful-fs'es dedupe to the right version so there's only one copy of the cached cwd while jest executes)
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as path from 'path'; | ||
|
||
test('path.resolve is sane', async () => { | ||
// Reasons why this might not be true: | ||
// graceful-fs, which is used by Jest, hooks into process.cwd() and | ||
// process.chdir() and caches the values. Because... profit? | ||
|
||
const targetDir = path.join(__dirname, 'fixture'); | ||
|
||
process.chdir(targetDir); | ||
expect(process.cwd()).toEqual(targetDir); | ||
|
||
const resolved = path.resolve('.'); | ||
expect(resolved).toEqual(targetDir); | ||
}); |