-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Option to silent stdout, or at least the yeoman ascii art when testing generator #472
Comments
Simply create a custom Environment and mock methods that are outputting content to the console (like |
We've been talking about it, and I think we're OK with adding this into core. If someone want to send a PR checking the argv passed to the process for That's the file needed to be modified: https://github.com/yeoman/generator/blob/master/lib/env/adapter.js |
@hemanth is assigned on this issue and should bring something up sometime :) BTW, don't use |
@SBoudrias Sure, will work on it. |
Can you elaborate?
You mean env variable? |
I don't like the So we'd need either an env variable - or a global. IMO, a global is allright and less error prone (no chances someone mute all his yeoman generators by error). |
@SBoudrias from what I can remember from the last meeting, you too don't want globals and it should rather be built into the interface or something. Can you expand on that? |
There was a suggestion for |
Yeah, it might be less error prone to call This is more secure as we're sure that no dependency author that we use will one day push an update setting The problem with using a Anoter solution, maybe we could allow user to provide a stream to write to. So then, you just need to pass a mute stream - but that'd allow you to assert stuff against the outputted string buffer on the dummy stream... |
@SBoudrias As this issue speaks specifically for testing, should we start pawing at |
@hemanth It is about testing, but it relate mostly to the UI Adapter module. This is where the work should be done first. |
@SBoudrias Was wondering the same. |
I like this. |
I created a gist showing how this can be achieved until it's implemented as part of Yeoman: https://gist.github.com/MethodGrab/09f3431942ca14b6805d |
Muting just yeomans output isn't enough. I have a test where I invoke installDependencies with bower/npm and get output from both commands. I had to resort to overwriting the spawn command. |
@peeter-tomberg You should really not run npm and bower during your tests. |
@SBoudrias I really like the idea of testing if my generator outputs a valid project. I have no idea how I could check if for example my requirejs build works without having to run npm / bower. |
+1 for this feature. |
@peeter-tomberg that should be a separate test. The generator will create something but that something should already be something you have and thats tested. although, its often broken by things put into a generator :D |
I tag this one as actionable and hard because it is doable, but there's a lot of part missing ATM. |
Do you think it would be a good idea to add a setting for log level ? To https://github.com/yeoman/generator/blob/master/lib/util/log.js |
@fernandopasik Maybe, but that's not a feature related to this issue. |
I was thinking of it for disabling the log util on testing. |
@fernandopasik I see what you mean, but these are really differents concepts - plus a correct solution should be able to hide more the only log. |
This is now the default (only on master, not yet released) when using |
👍 |
nice! thanks! |
I want to isolate my rspec output during an 'npm test' of my generator, so I'd like an option to hide the output of yeoman during the multiple test runs. Notice, this is not
npm test > /dev/null
because I want mocha's output, just not the ASCII art and file list.Sorry if this is basic, but a search for stdout/tests for yeoman revealed alot of noise about how it used to check stdout instead of fs in tests, and not an answer to how to silence it.
The text was updated successfully, but these errors were encountered: