feat(vitest): add suites, test and snapshot name in Story JSON parameters#376
Merged
Conversation
|
commit: |
c6e3230 to
1cc1d57
Compare
valentinpalkovic
approved these changes
Jun 1, 2026
AriPerkkio
commented
Jun 2, 2026
b4a37ff to
8d735d6
Compare
8d735d6 to
febea9c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: Milestone 1 of #353.
What Changed
Adds new
parameters.chromatic.vitestinto the Story JSON file:{ "title": "test/Accordion", "stories": [ { "name": "interactive / mouse / can be dragged / Snapshot #1", "globals": { "viewport": "w1280h720" }, "parameters": { "__id": "test-accordion-interactive-mouse-can-be-dragged--snapshot-1", "server": { "id": "test-accordion-interactive-mouse-can-be-dragged-snapshot-1" }, "chromatic": { "modes": { "w1280h720": { "viewport": "w1280h720" } }, + "vitest": { + "suites": ["interactive", "mouse"], + "test": "can be dragged", + "snapshot": "Snapshot #1" + } }, "viewport": { ... }, } } ] }parameters.chromatic.vitest.suites: string[]: contains the names ofdescribe()calls of the test case where the snapshot originated from. Can be an empty array if nodescribe()was used.parameters.chromatic.vitest.test: string: contains the name oftest()call of the test case where the snapshot originated from.parameters.chromatic.vitest.snapshot: string: contains the name oftakeSnapshot()orSnapshot #<running-number>if no name was passed.{ "suites": ["one", "two"], "test": "three", "snapshot": "four" }, { "suites": [], "test": "example of autosnapshot", "snapshot": "Snapshot #1" }Note: Screenshot below is using old implementation with

parameters.vitest. All parameters are inparameters.chromatic.vitestnow.How to test
parameterscontentparameters#376 (comment)