-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First stab at handling console messages while a test runs #35
Conversation
- Refactor `interceptConsole()` so that it accepts a function as an argument - Add utility `pluralize()` method to correctly print out “message”/“messages” to the console
✅ Deploy Preview for h-test ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code seems ok ("console message" is a bit of an odd term, but not sure what else we could use. "Console output" is more fitting but not countable, so we can't say 3 console outputs.). Not a fan of the multiple sequential parens. I don't think the console messages need parens, a separator is probably fine, or even a comma.
Co-authored-by: Lea Verou <[email protected]>
We can change it later if we like for something else with ease.
I went with “messages.” Yeah, we can change it anytime. It's ready for your other review, then. |
…t runs (#35) * Refactor `interceptConsole()` so that it accepts a function as an argument * Add utility `pluralize()` method to correctly print out “message”/“messages” to the console * Move messages stats before time taken stats * Rename: “console message(s)” → “message(s)” We can change it later if we like for something else with ease. --------- Co-Authored-By: Lea Verou <[email protected]>
…t runs (#35) * Refactor `interceptConsole()` so that it accepts a function as an argument * Add utility `pluralize()` method to correctly print out “message”/“messages” to the console * Move messages stats before time taken stats * Rename: “console message(s)” → “message(s)” We can change it later if we like for something else with ease. --------- Co-Authored-By: Lea Verou <[email protected]>
In this PR, I tried to implement @LeaVerou's suggestion on handling console messages from tests, including (as an addition to the main algorithm):
interceptConsole()
so that it accepts a function as an argumentpluralize()
method to correctly print out “message”/“messages” to the consoleHere is what we have as a starting point:
Interactive.CLI.Console.messages.mp4
Let's improve it and make it more awesome together!