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

Snapshot menu #949

Merged
merged 17 commits into from Nov 20, 2022
Merged

Snapshot menu #949

merged 17 commits into from Nov 20, 2022

Conversation

connectdotz
Copy link
Collaborator

@connectdotz connectdotz commented Nov 20, 2022

This PR is to migrate the SnapshotCodeLens to TestExplorer's menu, adding the following features and fixing a few related issues:

  • able to update snapshots at any granular level (instead of always updating all snapshots before). (fixes Enhancement: Update individual snapshots #905)
  • retire SnapshotCodeLens, SnapshotPreview, and related settings.
  • removing the logic to detect and offer snapshot updates during the test run.
  • refactor TestResultProvider to
    • include snapshot parse result
    • be more efficient in terms of how often to parse the code
  • added new context menu in TestExplorer tree Update Snapshot, and Update Snapshot, View Snapshot in the editor gutter menu.
  • fix a bug that prevented viewing snapshots in parameterized or dynamic-name tests

@coveralls
Copy link

coveralls commented Nov 20, 2022

Pull Request Test Coverage Report for Build 3509285937

  • 246 of 247 (99.6%) changed or added relevant lines in 11 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.5%) to 96.863%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/TestResults/TestResultProvider.ts 97 98 98.98%
Files with Coverage Reduction New Missed Lines %
src/TestResults/TestResultProvider.ts 1 97.38%
Totals Coverage Status
Change from base Build 3494117280: 0.5%
Covered Lines: 3257
Relevant Lines: 3304

💛 - Coveralls

@connectdotz connectdotz merged commit ae5583d into jest-community:master Nov 20, 2022
@connectdotz connectdotz deleted the snapshot-menu branch November 20, 2022 22:36
legend1202 pushed a commit to legend1202/vscode-jest that referenced this pull request Jun 18, 2023
* add snapshot-provider

* added snapshot profile, menu and commands

* remove listener update-snapshot request

* refactor TestResultProvider and removed enableSnapshotUpdateMessages

* removed SnapshotCodeLenses

* fix publish parsed source file to test explorer

* fixes broken tests

* clean up console output messages

* upgrade jest-editor-support

* adding tests for changes

* use context menu for all snapshot operations

* adding tests for changes

* handle multiple snapshots in a given test

* rename testResolveProvider to testResultProvider

* upgrade jest-editor-support

* address lint error/warning
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.

Enhancement: Update individual snapshots
2 participants