Skip to content

Add RunContext test helpers (Fix #498)#506

Merged
addyosmani merged 2 commits intoyeoman:masterfrom
SBoudrias:testHelpers
Feb 21, 2014
Merged

Add RunContext test helpers (Fix #498)#506
addyosmani merged 2 commits intoyeoman:masterfrom
SBoudrias:testHelpers

Conversation

@SBoudrias
Copy link
Copy Markdown
Member

Followup complete implementation of the ideas presented in issue #498.

@SBoudrias
Copy link
Copy Markdown
Member Author

BTW, I didn't wanted to add promises or any extra async handler, so I manage a basic counter to delay the generator from running until async actions ends. It may seems sketchy, but I believe it'll work in this context.

Also, we use #then() method for callback, and it is not related to a promise implementation. Maybe we should rename it to #after() in order to make it less ambiguous. What do you think?

Inquirer API allow a single prompt item to be passed as parameter.
`mockPrompt` must also work with this signature.
Comment thread lib/test/run-context.js Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think a note on where this is relative to would be good

@SBoudrias
Copy link
Copy Markdown
Member Author

Fixed documentation and tests.

@eddiemonge
Copy link
Copy Markdown
Member

after seems too much like the action that occurs after a test is run, and not after a generator is run.

@SBoudrias
Copy link
Copy Markdown
Member Author

@eddiemonge Any suggestion as to how we should name it?

@eddiemonge
Copy link
Copy Markdown
Member

I don't know. onEnd onDone generated

@SBoudrias
Copy link
Copy Markdown
Member Author

Ok, gone with .onEnd()

addyosmani added a commit that referenced this pull request Feb 21, 2014
Add RunContext test helpers (Fix #498)
@addyosmani addyosmani merged commit ca2de21 into yeoman:master Feb 21, 2014
@addyosmani
Copy link
Copy Markdown
Member

onEnd() WFM too. Thanks for addressing the feedback from the meeting, Simon!

@SBoudrias SBoudrias deleted the testHelpers branch February 21, 2014 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants