diff --git a/.changeset/tidy-cameras-share.md b/.changeset/tidy-cameras-share.md deleted file mode 100644 index 1969ce34..00000000 --- a/.changeset/tidy-cameras-share.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'storybook-addon-vis': patch ---- - -Gate the auto-snapshot hooks on the Vitest browser global instead of a general test-environment check. - -`beforeAll` and `beforeEach` guarded on `isRunningInTest()` from `@repobuddy/test`, which treats any -`HeadlessChrome` user agent as a test run. Browsing Storybook with a headless browser — driving it -with Playwright to debug a story, for example — therefore entered the snapshot setup path, where the -`vitest/browser` command proxy is empty, and failed with `commands.setupVisSuite is not a function` -so the preview never rendered. - -Both hooks now check `__vitest_browser__`, the same signal the command proxy itself uses, so they -run exactly when the Vitest commands they depend on are present. This also covers a non-browser -Vitest run (jsdom or node), which passed the old guard and hit the same empty proxy. - -`@repobuddy/test` is no longer a runtime dependency of this package. diff --git a/packages/storybook-addon-vis/CHANGELOG.md b/packages/storybook-addon-vis/CHANGELOG.md index 80223494..024fb060 100644 --- a/packages/storybook-addon-vis/CHANGELOG.md +++ b/packages/storybook-addon-vis/CHANGELOG.md @@ -1,5 +1,23 @@ # CHANGE LOG +## 4.2.4 + +### Patch Changes + +- [#836](https://github.com/repobuddy/visual-testing/pull/836) [`e135d00`](https://github.com/repobuddy/visual-testing/commit/e135d0086a4e20008edb88f65946f1ab8cc47500) Thanks [@unional](https://github.com/unional)! - Gate the auto-snapshot hooks on the Vitest browser global instead of a general test-environment check. + + `beforeAll` and `beforeEach` guarded on `isRunningInTest()` from `@repobuddy/test`, which treats any + `HeadlessChrome` user agent as a test run. Browsing Storybook with a headless browser — driving it + with Playwright to debug a story, for example — therefore entered the snapshot setup path, where the + `vitest/browser` command proxy is empty, and failed with `commands.setupVisSuite is not a function` + so the preview never rendered. + + Both hooks now check `__vitest_browser__`, the same signal the command proxy itself uses, so they + run exactly when the Vitest commands they depend on are present. This also covers a non-browser + Vitest run (jsdom or node), which passed the old guard and hit the same empty proxy. + + `@repobuddy/test` is no longer a runtime dependency of this package. + ## 4.2.3 ### Patch Changes diff --git a/packages/storybook-addon-vis/package.json b/packages/storybook-addon-vis/package.json index 266e1933..a11f6fe3 100644 --- a/packages/storybook-addon-vis/package.json +++ b/packages/storybook-addon-vis/package.json @@ -1,6 +1,6 @@ { "name": "storybook-addon-vis", - "version": "4.2.3", + "version": "4.2.4", "description": "Storybook Vitest visual testing addon", "keywords": [ "image-snapshot",