-
-
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
prevent newline on test runs - fixes #1781 #7167
Conversation
@@ -137,7 +137,7 @@ export default class Status { | |||
|
|||
// $FlowFixMe | |||
const width: number = process.stdout.columns; | |||
let content = '\n'; | |||
let content = process.argv.includes('--verbose') ? '\n' : ''; |
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.
you should have access to globalConfig
in here, which you can check for the verbose
flag
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.
seems like you don't, but you can pass it in here: https://github.com/facebook/jest/blob/d695ab38bf94851b025d2b9462c6a9c75ced02fe/packages/jest-cli/src/reporters/default_reporter.js#L43
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.
I can add it as an argument on the get
method to gain access but I wasn't sure that was the right solution. I can update it if that's preferred
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.
no, pass it into the constructor and assign it to this
CHANGELOG.md
Outdated
@@ -15,6 +15,7 @@ | |||
|
|||
### Fixes | |||
|
|||
- `[jest-cli]` Remove newline from initial test runs ([#7153](https://github.com/facebook/jest/pull/7153)) |
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.
not 7153, this is 7167
Woah! Looks too easy to be true cc @cpojer @aaronabramov |
@SimenB thanks for the fast 👁 issues fixed |
c8e0add
to
29d37bf
Compare
29d37bf
to
d9f0b0c
Compare
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.
Needs to be tested, but the code LGTM
I don’t think this works. In @thymikee‘s screenshot you can see the same test is printed both as passing and running at the same time. Terminal printing is weird. |
The same test being printed twice is a separated issue, we're probably tracking it somewhere, maybe @SimenB remembers |
I wonder if we could make it more deterministic by rendering this reporter with React: https://github.com/zamotany/react-slate. |
Passing and running happens if something else writes to
+1, that'd be awesome! |
@rogeliog you've played with fancy terminal rendering, thoughts here? |
Any updates needed? I think this does the trick |
hey folks, any outstanding reasons not to merge this? I believe all issues have been addressed? |
@aaronabramov what do you think? |
As said, I tried the same thing in the past and it definitely led to issues. |
* upstream/master: (391 commits) more precise circus asyncError types (jestjs#8150) Add typeahead watch plugin (jestjs#6449) fix: getTimerCount not taking immediates and ticks into account (jestjs#8139) website: add an additional filter predicate to backers (jestjs#7286) [🔥] Revised README (jestjs#8076) [jest-each] Fix test function type (jestjs#8145) chore: improve bug template labels for easier maintenance (jestjs#8141) Add documentation related to auto-mocking (jestjs#8099) Add support for bigint to pretty-format (jestjs#8138) Revert "Add fuzzing based tests in Jest (jestjs#8012)" chore: remove console.log chore: Improve description of optional arguments in ExpectAPI.md (jestjs#8126) Add fuzzing based tests in Jest (jestjs#8012) Move @types/node to the root package.json (jestjs#8129) chore: use property initializer syntax (jestjs#8117) chore: delete flow types from the repo (jestjs#8061) Move changelog entry to the proper version (jestjs#8115) Release 24.5.0 Expose throwOnModuleCollision (jestjs#8113) add matchers to expect type (jestjs#8093) ...
I've updated the PR to be even with master, but there newline is still there in watch mode. |
Closing - I'm gonna try to rewrite our reporting to use Ink which handles this for us |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This solves #1781 - removes newlines for all specs unless in verbose mode
Test plan
Looks good normal and
--verbose
🤷♂️