diff --git a/src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap b/src/__tests__/volume/__snapshots__/mkdirSync.test.ts.snap index 86500631..976964a4 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 8574cf81..7a3700d8 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');