-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix missing console.log messages (#3895)
* Ensure that console output is not lost in concurrent reporter * console.log integration test + naming
- Loading branch information
1 parent
b2b1f79
commit 04d05e5
Showing
3 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
integration_tests/__tests__/__snapshots__/console_log_output_when_run_in_band.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`prints console.logs when run with forceExit 1`] = ` | ||
" PASS __tests__/a-banana.js | ||
✓ banana | ||
" | ||
`; | ||
|
||
exports[`prints console.logs when run with forceExit 2`] = ` | ||
"Test Suites: 1 passed, 1 total | ||
Tests: 1 passed, 1 total | ||
Snapshots: 0 total | ||
Time: <<REPLACED>> | ||
Ran all test suites. | ||
" | ||
`; | ||
exports[`prints console.logs when run with forceExit 3`] = ` | ||
" console.log __tests__/a-banana.js:2 | ||
Hey | ||
" | ||
`; |
41 changes: 41 additions & 0 deletions
41
integration_tests/__tests__/console_log_output_when_run_in_band.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const path = require('path'); | ||
const skipOnWindows = require('skipOnWindows'); | ||
const {extractSummary, cleanup, writeFiles} = require('../utils'); | ||
const runJest = require('../runJest'); | ||
|
||
const DIR = path.resolve(__dirname, '../console_log_output_when_run_in_band'); | ||
|
||
skipOnWindows.suite(); | ||
|
||
beforeEach(() => cleanup(DIR)); | ||
afterAll(() => cleanup(DIR)); | ||
|
||
test('prints console.logs when run with forceExit', () => { | ||
writeFiles(DIR, { | ||
'__tests__/a-banana.js': ` | ||
test('banana', () => console.log('Hey')); | ||
`, | ||
'package.json': '{}', | ||
}); | ||
|
||
const {stderr, stdout, status} = runJest(DIR, [ | ||
'-i', | ||
'--ci=false', | ||
'--forceExit', | ||
]); | ||
const {rest, summary} = extractSummary(stderr); | ||
expect(status).toBe(0); | ||
expect(rest).toMatchSnapshot(); | ||
expect(summary).toMatchSnapshot(); | ||
expect(stdout).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters