Skip to content

Commit

Permalink
Force top-level graceful-fs to be 4.2.4, and add a sanity test
Browse files Browse the repository at this point in the history
(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
rix0rrr committed Apr 29, 2020
1 parent f479074 commit 39b9f9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -21,6 +21,7 @@
"jsii-rosetta": "^1.4.1",
"lerna": "^3.20.2",
"standard-version": "^7.1.0",
"graceful-fs": "^4.2.4",
"typescript": "~3.8.3"
},
"repository": {
Expand Down
15 changes: 15 additions & 0 deletions packages/decdk/test/sanity.test.ts
@@ -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);
});

0 comments on commit 39b9f9b

Please sign in to comment.