From 9dc7007e3d75b7a6eca849f3fb8ed26c6341bdc6 Mon Sep 17 00:00:00 2001
From: streamich <streamich@gmail.com>
Date: Sat, 9 Feb 2019 21:02:38 +0100
Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20show=20directory=20path?=
 =?UTF-8?q?=20when=20throwing=20EISDIR=20in=20mkdir?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap | 2 +-
 src/volume.ts                                             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap b/src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap
index 86500631a..976964a43 100644
--- a/src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap
+++ b/src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap
@@ -1,5 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`mkdirSync throws when creating root directory 1`] = `"EISDIR: illegal operation on a directory, mkdir"`;
+exports[`mkdirSync throws when creating root directory 1`] = `"EISDIR: illegal operation on a directory, mkdir '/'"`;
 
 exports[`mkdirSync throws when re-creating existing directory 1`] = `"EEXIST: file already exists, mkdir '/new-dir'"`;
diff --git a/src/volume.ts b/src/volume.ts
index 8574cf810..7a3700d8d 100644
--- a/src/volume.ts
+++ b/src/volume.ts
@@ -1771,7 +1771,7 @@ export class Volume {
 
     // This will throw if user tries to create root dir `fs.mkdirSync('/')`.
     if (!steps.length) {
-      throwError(EISDIR, 'mkdir');
+      throwError(EISDIR, 'mkdir', filename);
     }
 
     const dir = this.getLinkParentAsDirOrThrow(filename, 'mkdir');