-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Provide a --simple-output option #2471
Comments
@jlongster thanks for adding this issue. Something similar was already discussed here: #2292 and there's also a temporary solution: #2292 (comment) while we don't have |
Cool,thanks! While |
As a workaround you can redirect stderr (which holds results) to stdout CI=true npm test 2>&1 | grep fail -i But having --no-status, or --no-interactive would still be great to have |
Ah nice, thanks! I thought everything was piped to stdout because the |
A workaround we came up with is to create a file #!/bin/bash
if [ "`tty`" != "not a tty" ]
then
echo 'Interactive shell'
./node_modules/.bin/jest ./spec/$1/*
EXIT_CODE=$?
exit $EXIT_CODE
else
echo 'Non interactive shell'
./node_modules/.bin/jest ./spec/$1/* > ./jest-output.log 2>&1
EXIT_CODE=$?
cat ./jest-output.log
rm ./jest-output.log
exit $EXIT_CODE
fi while in "scripts": {
"test-unit": "sh test.sh unit",
"test-integration": "sh test.sh integration"
} This is obviously temporary until a proper fix is merged to master. |
I came across this issue today when trying to get debug (https://github.com/visionmedia/debug) output to appear while debugging a test case. Had to solve it using the workarounds in other issues, namely:
Without CI=true no output from the debug module will be seen (or it will be seen briefly if a test is slow, but jest will erase it). The watch/automatic mode of jest is really cool! Has really changed my workflows. But taking over stderr/stdout has also caused me to spend more time than I'd like to admit trying to have confidence in my debug output. |
I'm trying to run Jest inside a maven process, and it hangs every time, and I don't know but I suspect it's related to the clever output. 👍 |
I confirmed the ...
<configuration>
...
<environmentVariables>
<CI>true</CI>
</environmentVariables>
</configuration>
... |
I think for now we aren't interested in doing this but if anybody feels strongly, please send a PR :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
A feature!
What is the current behavior?
Currently Jest (as do many modern CLI tools) outputs fancy text to the terminal for a better experience. This does things like only painting part of the terminal, colors, and other stuff like that.
The problem is if you get too fancy you break interop with all other unix tools. For example, do
jest | less
and it won't work. You'll see lots of weird characters and the output is not paged.I really want to get a list of all currently failing tests. Just a raw list, don't want to see a huge amount of actual/expected output (the diffs can be very large). I'm migrating a test suite over to new code so my goal is to make all these tests pass. Right now it's very hard to track just the failing tests.
Doing
jest | grep FAIL
would work if I could grep the output, but I can't.What is the expected behavior?
Provide some sort of
--simple-output
which just dumps raw text and newlines to the terminal, without any of the fancy stuff. This would let me grep the output and the test failures, or do anything you want to with any of the normal unix tools.The text was updated successfully, but these errors were encountered: