✨ Align Vitest and Ember SDKs#285
Merged
Merged
Conversation
79e655e to
7894e2a
Compare
9deaf1d to
7771992
Compare
7894e2a to
80fdf3d
Compare
7771992 to
47dde46
Compare
80fdf3d to
568513e
Compare
47dde46 to
3d543fa
Compare
3d543fa to
e267dc0
Compare
Vizzly - Visual Test ResultsCLI Reporter - Waiting for buildNo builds received yet for this pull request.
|
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.
Why
This PR aligns the test-runner SDKs: Vitest and Ember. These integrations are close to the user’s actual test code, so the contract has to be exact. When someone calls
expect(...).toMatchScreenshot(...)orvizzlyScreenshot(...), they need to know which options affect browser capture, which options affect Vizzly comparison/routing, which options are metadata, and when a visual diff fails the test.Before this pass, that boundary was fuzzy. Vitest could pass Vizzly-only options toward browser screenshot APIs. Element captures could receive page-only
fullPagebehavior. Ember could not reliably bridge build ID, request timeout, viewport, threshold, and min-cluster settings from browser test code to the node screenshot server and then to Vizzly.The goal here is boring parity: Vitest, Ember, the JS client, and the CLI should describe the same screenshot in the same conceptual way.
What changed
Vitest
failOnDifffrom.vizzly/server.jsonand exposes it to the browser context with server URL and build ID.vizzlyPlugin()so screenshot behavior lives on matcher calls.properties,threshold,minClusterSize,failOnDiff,buildId, andrequestTimeout.fullPage.failOnDiffresolves to true.Ember
buildIdandrequestTimeoutfrom the screenshot server to Vizzly.fullPageon page captures and strips it from selector captures.threshold,minClusterSize,buildId,requestTimeout, viewport, and user properties in a stable payload.failOnDiffto override launcher/server settings.vizzly tdd startorvizzly run.Properties and options
This PR follows the core contract from #283.
propertiesis the user metadata bag. Options that change capture, comparison, routing, request timeout, build grouping, or failure behavior stay as explicit options.That is why the bridge code strips Vizzly-only fields before calling browser screenshot APIs and forwards them separately to Vizzly. It keeps browser capture behavior, comparison behavior, and metadata from quietly bleeding into one another.
Testing
failOnDiff.This is good boundary coverage for option flow. It still does not replace a product-level E2E visual-diff fixture that proves the whole CLI/API/UI loop with a real changed screenshot.
Verification
pnpm --dir clients/vitest test: 23 passed.git diff --checkand PR file-list checks for ✨ Align core SDK option contracts #283 through 📝 Document aligned SDK workflows #287.