Skip to content

Commit

Permalink
Revert "Avoid writing to stdout in default reporter if --json is enab…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
mjesun authored Jun 30, 2017
1 parent 3a20b07 commit 33962dd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 132 deletions.
78 changes: 0 additions & 78 deletions packages/jest-cli/src/reporters/__tests__/default_reporter.test.js

This file was deleted.

18 changes: 3 additions & 15 deletions packages/jest-cli/src/reporters/default_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,10 @@ class DefaultReporter extends BaseReporter {
const flushBufferedOutput = () => {
const string = buffer.join('');
buffer = [];

// This is to avoid conflicts between random output and status text
this._clearStatus();
if (string) {
originalWrite.call(stream, string);
}
originalWrite.call(stream, string);
this._printStatus();

this._bufferedOutput.delete(flushBufferedOutput);
};

Expand Down Expand Up @@ -109,23 +105,15 @@ class DefaultReporter extends BaseReporter {

_clearStatus() {
if (isInteractive) {
if (this._globalConfig.useStderr) {
this._err(this._clear);
} else {
this._out(this._clear);
}
this._out(this._clear);
}
}

_printStatus() {
const {content, clear} = this._status.get();
this._clear = clear;
if (isInteractive) {
if (this._globalConfig.useStderr) {
this._err(content);
} else {
this._out(content);
}
this._out(content);
}
}

Expand Down
38 changes: 0 additions & 38 deletions packages/jest-resolve/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
# yarn lockfile v1


ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"

ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"

browser-resolve@^1.11.2:
version "1.11.2"
resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
Expand All @@ -20,26 +12,6 @@ builtin-modules@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"

chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"

escape-string-regexp@^1.0.2:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"

has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"

is-builtin-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
Expand All @@ -59,13 +31,3 @@ resolve@^1.3.2:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5"
dependencies:
path-parse "^1.0.5"

strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"

supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
2 changes: 1 addition & 1 deletion types/TestRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import type Runtime from 'jest-runtime';

export type Test = {|
context: Context,
duration: ?number,
path: Path,
duration: ?number,
|};

export type Reporter = {
Expand Down

0 comments on commit 33962dd

Please sign in to comment.