diff --git a/lib/index.js b/lib/index.js index a4eea19..47cce0c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -129,13 +129,13 @@ function restoreReadFileContext(binding) { /** * Swap out the fs bindings for a mock file system. * @param {Object} config Mock file system configuration. - * @param {Object} options Any filesystem options. + * @param {Object} [options={}] Any filesystem options. * @param {boolean} options.createCwd Create a directory for `process.cwd()` * (defaults to `true`). * @param {boolean} options.createTmp Create a directory for `os.tmpdir()` * (defaults to `true`). */ -exports = module.exports = function mock(config, options) { +exports = module.exports = function mock(config, options = {}) { const system = FileSystem.create(config, options); const binding = new Binding(system);