Skip to content

Commit 9dc7007

Browse files
committed
fix: 🐛 show directory path when throwing EISDIR in mkdir
1 parent f77fa8b commit 9dc7007

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`mkdirSync throws when creating root directory 1`] = `"EISDIR: illegal operation on a directory, mkdir"`;
3+
exports[`mkdirSync throws when creating root directory 1`] = `"EISDIR: illegal operation on a directory, mkdir '/'"`;
44

55
exports[`mkdirSync throws when re-creating existing directory 1`] = `"EEXIST: file already exists, mkdir '/new-dir'"`;

src/volume.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ export class Volume {
17711771

17721772
// This will throw if user tries to create root dir `fs.mkdirSync('/')`.
17731773
if (!steps.length) {
1774-
throwError(EISDIR, 'mkdir');
1774+
throwError(EISDIR, 'mkdir', filename);
17751775
}
17761776

17771777
const dir = this.getLinkParentAsDirOrThrow(filename, 'mkdir');

0 commit comments

Comments
 (0)