@chromatic-com/vitest 0.0.1 → 0.0.2-3b19458-20260417125040

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/plugin.js +7 -4
  2. package/package.json +1 -1
package/dist/plugin.js CHANGED
@@ -4092,14 +4092,17 @@ function createCommands(options) {
4092
4092
  for (const [name, domSnapshot] of sessionSnapshots) {
4093
4093
  snapshotBuffers[name] = Buffer.from(JSON.stringify(domSnapshot));
4094
4094
  }
4095
+ const frame = await context.frame();
4096
+ const frameElement = await frame.frameElement();
4097
+ const viewport = await frameElement.evaluate((iframe) => ({
4098
+ width: iframe.parentElement?.clientWidth || 1920,
4099
+ height: iframe.parentElement?.clientHeight || 1080
4100
+ }));
4095
4101
  await writeTestResult({
4096
4102
  outputDir: resolve(context.project.config.root, options.outputDirectory),
4097
4103
  pageUrl: context.page.url(),
4098
4104
  titlePath: getNames(entity),
4099
- viewport: context.page.viewportSize() || {
4100
- width: 1920,
4101
- height: 1080
4102
- }
4105
+ viewport
4103
4106
  }, snapshotBuffers, archive, {
4104
4107
  delay: options.delay,
4105
4108
  diffIncludeAntiAliasing: options.diffIncludeAntiAliasing,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromatic-com/vitest",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-3b19458-20260417125040",
4
4
  "description": "Chromatic Visual Regression Testing for Vitest",
5
5
  "repository": {
6
6
  "type": "git",