Skip to content
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

Avoid writing to stdout in default reporter if --json is enabled. Fixes #3941 #3945

Merged
merged 1 commit into from
Jun 30, 2017
Merged

Avoid writing to stdout in default reporter if --json is enabled. Fixes #3941 #3945

merged 1 commit into from
Jun 30, 2017

Conversation

mjesun
Copy link
Contributor

@mjesun mjesun commented Jun 30, 2017

Check #3941 for more details.

@codecov-io
Copy link

Codecov Report

Merging #3945 into master will decrease coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3945      +/-   ##
==========================================
- Coverage   58.06%   58.01%   -0.06%     
==========================================
  Files         196      196              
  Lines        6758     6764       +6     
  Branches        6        6              
==========================================
  Hits         3924     3924              
- Misses       2831     2837       +6     
  Partials        3        3
Impacted Files Coverage Δ
...ackages/jest-cli/src/reporters/default_reporter.js 4.41% <0%> (-0.43%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a509c7...375f1e3. Read the comment docs.

// This is to avoid conflicts between random output and status text
this._clearStatus();
originalWrite.call(stream, string);
string && originalWrite.call(stream, string);
Copy link
Member

Choose a reason for hiding this comment

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

if (string) {

pls

const testCase = {
context: {config: {rootDir: '/'}},
path: '/foo',
duration: 0,
Copy link
Member

Choose a reason for hiding this comment

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

please sort keys alphabetically.

duration: 0,
};
const testResult = {
testFilePath: '/foo'
Copy link
Member

Choose a reason for hiding this comment

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

comma

};

let DefaultReporter;
let stdout, stderr;
Copy link
Member

Choose a reason for hiding this comment

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

nit: only one var definition per let.

expect(stdout).toHaveBeenCalled();
});

test('when using stderr as output, no stdout call is done', () => {
Copy link
Member

Choose a reason for hiding this comment

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

"is made", maybe?

@cpojer
Copy link
Member

cpojer commented Jun 30, 2017

Sweet! Please run yarn test and make sure it passes.

@cpojer cpojer merged commit 68d747d into jestjs:master Jun 30, 2017
mjesun added a commit that referenced this pull request Jun 30, 2017
…led. Fixes #3941" (#3951)

* Revert "fix typo in snapshot testing documentation (#3948)"

This reverts commit d6998c2.

* Revert "Fix linting (#3946)"

This reverts commit 9426521.

* Revert "Avoid writing to stdout in default reporter if --json is enabled. Fixes #3941 (#3945)"

This reverts commit 68d747d.
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
…led. Fixes jestjs#3941" (jestjs#3951)

* Revert "fix typo in snapshot testing documentation (jestjs#3948)"

This reverts commit d6998c2.

* Revert "Fix linting (jestjs#3946)"

This reverts commit 9426521.

* Revert "Avoid writing to stdout in default reporter if --json is enabled. Fixes jestjs#3941 (jestjs#3945)"

This reverts commit 68d747d.
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants