From a966cec07fd37fa384c8893010f4bbf7297a3ce7 Mon Sep 17 00:00:00 2001 From: ambar Date: Wed, 18 Nov 2020 22:14:03 +0800 Subject: [PATCH] feat: inject context to mock function --- lib/mock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mock.js b/lib/mock.js index 1f21837..1229982 100644 --- a/lib/mock.js +++ b/lib/mock.js @@ -25,13 +25,13 @@ const createMFS = () => { } } -const mock = async (generator, directory, {answers = {}} = {}) => { +const mock = async (generator, directory, {answers = {}, context} = {}) => { const mfs = createMFS() const noop = () => {} prompts.inject(answers) await create( {_: [generator, directory]}, - {mock: [{dest: mfs.dest}, {install: noop, gitInit: noop}]} + {mock: [{dest: mfs.dest}, {install: noop, gitInit: noop, ...context}]} ) return mfs }