Skip to content

Commit

Permalink
feat: inject context to mock function
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Nov 18, 2020
1 parent 39dde19 commit a966cec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a966cec

Please sign in to comment.