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

feat: add clearTestResults option #1071

Conversation

ladariha
Copy link

Adds option to clear test results on new test run as discussed in #1060

  • README.MD updated
  • unit test updated
  • please note: I did not increase version in package.json - I don't know the release process, if you have it automatic in merge etc. (this also means in README.MD I guess the supported version of this new setting)

@connectdotz
Copy link
Collaborator

connectdotz commented Sep 27, 2023

@ladariha Thanks for the PR. A few things come to mind:

  1. we already have a setting jest.autoClearTerminal, not sure if we should create yet another setting to control the test results tab. Maybe we can rename the settings to autoClearOutput so it applies to both?
  2. We are in the process of cleaning up and better organizing the settings (they are getting harder to discover). I am thinking maybe we should move this autoClearOutput to the new runMode (proposal: introduce "jest.runMode" to consolidate and simplify settings #1058), given the revealOutput is already there.
  3. Also, it seems you only check it in the test-provider runTests(), which is triggered by UI/TestExplorer. But we also have background auto-runs that will not go through test-provider. You can take a look at how autoClearTerminal was implemented (Add clearTerminal setting #1014) to get some idea.
  4. There is also a separate thread about better supporting the Test Results tab (No output in Test Results tab, and no coverage when coverage enabled #1051). Considering these Test Results tab related issues, I am wondering if we should expand the jest.TestExplorer setting to add a new option useTestResults: boolean. If false, we will just hide the test results tab; if true, then the output content and settings should just apply to both the terminal and the test-results tab...

Anyway, as you can see there are a few options for this feature. Feel free to join the discussion (#1058) so we can discuss further.

@ladariha
Copy link
Author

I apologize for long response time. I more than happy to merge the feature with autoClearTerminal and also the background auto-runs issue you mentioned. Please give me a week to finish it

Regarding the point 2 and 4

  • I don't really have deeper knowledge here so I cannot participate in discussions about refactoring and future improvements.

@connectdotz
Copy link
Collaborator

The change I listed above is definitely too broad for this PR. I am working on an output overhaul PR to address them, which will include clearing output for the terminal and/or test-results panel, along with other changes. I can ping you for testing/discussion if you are interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants