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

Access to test console output in reporters should not depend on verbose option #5232

Closed
segrey opened this issue Jan 4, 2018 · 5 comments
Closed

Comments

@segrey
Copy link

segrey commented Jan 4, 2018

Do you want to request a feature or report a bug?

Looks like a bug

What is the current behavior?

Currently, testResult object passed to onTestResult(test, testResult, aggregatedResult) doesn't contain any info about console output. However, it's there if --verbose=false cli option passed (because BufferedConsole created here has getBuffer method returning actual buffer, and default Console has getBuffer method returning null).

What is the expected behavior?

Console output info is presented in testResult object always.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

node: 9.2.1
jest: 22.0.4

@SimenB
Copy link
Member

SimenB commented Jan 8, 2018

Sorta related: #5242

@segrey
Copy link
Author

segrey commented Jan 9, 2018

@SimenB Thanks for the idea, looks like overwriting console.{warn,log,info,error} in setupTestFrameworkScriptFile is good enough for me. Closing this issue, feel free to reopen if you think it makes sense to fix it.

Since it's needed for a tool (IntelliJ IDEA / WebStorm Jest test runner), user's config can't be modified to add a jasmine setup file to transformIgnorePatterns.
Is it legitimate to configure setupTestFrameworkScriptFile and transformIgnorePatterns in reporter's onTestStart? Please see the details in #4471 (comment). //cc @cpojer

@segrey segrey closed this as completed Jan 9, 2018
@SimenB
Copy link
Member

SimenB commented Jan 10, 2018

Is it legitimate to configure setupTestFrameworkScriptFile and transformIgnorePatterns in reporter's onTestStart?

If it works, yes. It feels hackish, though. And as a user of IntelliJ, I want the integration to be as good as possible 😀

I think IntelliJ's integration cannot use https://github.com/facebook/jest/tree/master/packages/jest-editor-support (as it's written in Java), right? If not, we should try to accomodate CLI options as much as possible.

@segrey
Copy link
Author

segrey commented Jan 10, 2018

@SimenB Yep, a bit hackish. Actually, the integration can use jest-editor-support as it has a JavaScript part. Though, currently, jest-editor-support is built upon --json cli option, so it doesn't provide more info than passing --reporters or --testResultsProcessor. Depending on jest-editor-support would require to bundle it in IDE (~2M installed with dependencies and compressed) and update on every release. Not sure there are enough benefits to switch to jest-editor-support at the moment.

@github-actions
Copy link

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.
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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants