From d61b9df7197e1b60295f9444284c7547b482be38 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 20 Feb 2022 13:51:00 -0500 Subject: [PATCH] Document mock options as an optional parameter --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);