Skip to content

storybook-addon-vis changelog

4.3.5

Patch Changes

  • #962 1847b46 Thanks @unional! - Point the package readmes and the review-image-snapshot-failures skill at the documentation website. Each readme now has install, minimal configuration, an example, a version compatibility table, and links to the matching website pages. The skill links the “Reviewing Failures with Agents” page on the website instead of a source file.
  • Updated dependencies [1847b46]:
    • vitest-plugin-vis@5.2.2

4.3.4

Patch Changes

  • #947 25d682c Thanks @unional! - Include CHANGELOG.md in the published package.
  • Updated dependencies [25d682c]:
    • vitest-plugin-vis@5.2.1

4.3.3

Patch Changes

  • #920 6c2e58e Thanks @unional! - When an image snapshot mismatches, find the changed regions and write a review image.

    The failure message now lists the changed regions (Changed:) and points to a review image (Review:). The review image (<name>.review.png, next to the diff) places the baseline, result, and diff crops of each region side by side, so a person or a coding agent can see what changed without opening the full images. The regions are also written to <name>.regions.json next to the diff. The review image is skipped, and the message says why, when the image size changed, there are more than 5 regions, or the regions cover more than half of the image.

    Set reviewImage: false in vis() or toMatchImageSnapshot() to not write the review image.

    The Storybook Vis panel does not list the review image as a diff.

  • #926 013d9b6 Thanks @unional! - Ship an llms.txt in each package so coding agents can find the entry points and documentation pages. It points agents to the new “Reviewing Failures with Agents” page, which tells them to open the review image of a failed image snapshot first, and shows what each view costs in tokens.

    Each package is also an agent plugin for Claude Code, Cursor, Codex and Copilot CLI. It ships the review-image-snapshot-failures skill, which tells an agent to read the error message and the review image before it opens a full image.

  • #946 65e4177 Thanks @dub578! - Decode images in toImageData with createImageBitmap and close the bitmap after reading the pixels.

    new Image() + drawImage left a full-size decode in Chromium’s image decode cache for every compared image, so renderer memory grew with each image snapshot comparison.

  • Updated dependencies [6c2e58e, 013d9b6, 65e4177]:

    • vitest-plugin-vis@5.2.0

4.3.2

Patch Changes

4.3.1

Patch Changes

  • #889 b770cfe Thanks @unional! - Fix auto snapshots hanging until the test timeout when subject matches a hidden element.

    The subject selector was resolved with document.querySelector(), which returns the first match even when it is hidden. In Storybook, a selector such as button matched hidden buttons that Storybook adds to the document, so the screenshot waited for that element to become visible until the timeout. Auto snapshots now use the first visible match.

    If the selector matches only hidden elements, the snapshot now fails right away with a “not visible” error instead of waiting until the timeout. If it matches nothing, document.body is still used.

  • #890 affac03 Thanks @unional! - Trim leading and trailing whitespace from test and suite names when building the snapshot path (#847).

    Storybook appends two spaces to the describe title it generates for a CSF Next story that uses story.test(). Those spaces became two dashes in the snapshot folder name, so the snapshots landed under <story>--/.

    Snapshots of story.test() stories now land under <story>/. Move or regenerate the existing baselines from <story>--/ to <story>/. Snapshot paths of plain stories and regular tests do not change.

  • Updated dependencies [b770cfe, affac03]:

    • vitest-plugin-vis@5.1.7

4.3.0

Minor Changes

  • #887 7bc7aee Thanks @unional! - Export cdp, a proxy of cdp() from vitest/browser that is safe to import from stories.

    Importing vitest/browser directly in a story throws in a plain Storybook preview and blanks the story. cdp loads it only during a Vitest browser run, like the existing page and commands proxies, and session calls made before the import settles wait for it. Calling cdp() outside a Vitest browser run throws.

    CDP is available only with the Playwright provider on Chromium.

4.2.9

Patch Changes

  • #885 b674dfe Thanks @unional! - Update type-plus to 8.0.0-beta.12.

    type-plus 8.0.0-beta.12 no longer exports the distributive Pick and Omit from its root. The public types now use ObjectPlus.Pick and ObjectPlus.Omit, which behave the same.

  • Updated dependencies [b674dfe]:

    • vitest-plugin-vis@5.1.6

4.2.8

Patch Changes

  • #870 5c2970c Thanks @unional! - Pin type-plus to 8.0.0-beta.10, exactly.

    Both packages already declared type-plus: ^8.0.0-beta.10 in the last published release (storybook-addon-vis@4.2.7, vitest-plugin-vis@5.1.4), so this is a range tightening, not a version move: type-plus 8’s typescript >= 5.6.0 peer already reaches consumers today, and this change does not alter what a fresh install resolves — it only forecloses later 8.0.0-beta.x prereleases plus 8.0.0 and 8.1.0.

    The version is pinned rather than caret-ranged. ^8.0.0-beta.10 resolves to >=8.0.0-beta.10 <9.0.0-0, which admits every later 8.0.0 prerelease as well as 8.0.0 and 8.1.0 — and 8 is a prerelease line where breaking changes land between betas (beta.10 to beta.11 changed Equal’s signature and removed isType.f). An exact version makes each bump a reviewable PR instead of something a lockfile refresh can do silently. Move back to a caret when 8.0.0 is stable.

    type-plus types leak into each package’s emitted declarations: storybook-addon-vis’s dist/exports/vitest-plugin.d.mts imports Omit from type-plus; vitest-plugin-vis’s dist/shared/commands.types.d.mts and dist/server/testing/stubSuite.d.mts import Pick and RecursivePartial. None of these symbols changed between 7 and 8, so no source change was needed.

  • Updated dependencies [5c2970c]:

    • vitest-plugin-vis@5.1.5

4.2.7

Patch Changes

  • #861 ee4464a Thanks @unional! - Depend on type-plus ^8.0.0-beta.10 — back on the 8.x line, as a range.

    The previous release moved both packages to ^7.6.2. That was the wrong fix. These packages belong on the 8.x line; what was actually broken was that the dependency was an exact pin (8.0.0-beta.8), so it could never resolve forward and consumers were stuck on a build with a real CJS packaging defect: 8.0.0-beta.8 declares "type": "module" but ships a cjs/ build with no {"type":"commonjs"} marker, so require() of these packages failed with ReferenceError: exports is not defined in ES module scope.

    type-plus@8.0.0-beta.10 ships that cjs/package.json marker and fixes it. The dependency is now the range ^8.0.0-beta.10 rather than a pin, so later 8.x betas and stable 8.x flow in on their own instead of freezing at one build.

    The root barrel of 8.0.0-beta.10 is byte-identical to 8.0.0-beta.8’s, so there is no API change between the two. The local Merge alias in vis_server_context.types.ts stays as-is; it is version-independent.

  • Updated dependencies [ee4464a]:

    • vitest-plugin-vis@5.1.4

4.2.6

Patch Changes

  • Updated dependencies [62026f5]:
    • vitest-plugin-vis@5.1.3

4.2.5

Patch Changes

  • #849 f450ead Thanks @unional! - Wait for the vitest browser modules before using them.

    commands and page are backed by a dynamic import that nothing awaited, so a hook reading commands.setupVisSuite before it settled got undefined and failed with commands.setupVisSuite is not a function — inside a genuine vitest browser run. Command reads now return a function that waits for the import, and the addon’s beforeAll awaits the module load before touching page or the current test.

  • 6697a67 Thanks @unional! - Raise dependency floors to pull in security fixes.

    glob, rimraf, pathe, dedent, is-ci, and pixelmatch move up within their existing major, which resolves the advisories reaching the runtime dependency tree through brace-expansion and tmp. No API change.

  • #858 6f65e20 Thanks @unional! - Depend on the stable type-plus line instead of an 8.x prerelease.

    Both packages carried "type-plus": "8.0.0-beta.8" as an exact pin in their runtime dependencies. type-plus@latest is deliberately 7.6.2; the 8.x line is an unfinished major parked in prerelease. The exact pin forced every consumer to install that prerelease, and consumers that also depend on something else pinning a different 8.x beta resolved two copies of type-plus. The pin now reads ^7.6.2.

    The only type this needed that 7.x does not export from its root is Merge, so Merge is now declared locally in vis_server_context.types.ts. Emitted output is otherwise byte-for-byte identical to the build under 8.0.0-beta.8: the sole difference in dist is that one alias moving from an import into the file. No API change.

  • Updated dependencies [5364614, 6697a67, 6f65e20]:

    • vitest-plugin-vis@5.1.2

4.2.4

Patch Changes

  • #836 e135d00 Thanks @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

  • ebdbc5b Thanks @unional! - Fix addonVis(options) type to includes tags: string[].

  • 50d0be7 Thanks @unional! - Skip vis suite setup when not running in test

  • c5d1353 Thanks @unional! - Should not add snapshot tag if auto is not true.

  • f67866f Thanks @unional! - Fix defineStorybookVis returning a file:// URL instead of a filesystem path.

    import.meta.resolve returns a file:// URL, which path.join corrupts when appending preset — collapsing file:/// to file:/. Storybook’s resolver then silently fails to find preset.js, so the addon’s experimental_serverChannel was never registered and snapshot images never loaded. Wrapping the result with fileURLToPath produces a plain filesystem path that resolves correctly.

  • e4bf5b0 Thanks @unional! - Register toMatchImageSnapshot at module load time so it is available in Storybook dev mode.

  • Updated dependencies [581c416]:

    • vitest-plugin-vis@5.1.1

4.2.2

Patch Changes

  • #739 66599bc Thanks @unional! - Make sure the visAnnotation.beforeEach do anything only when it is running in test.

4.2.1

Patch Changes

4.2.0

Minor Changes

  • 4bead0a Thanks @unional! - Export visAnnotations from the main package index and move expect.extend({ toMatchImageSnapshot }) from a module-level side effect to lazy initialization inside visAnnotations.beforeEach().

    Previously, importing storybook-addon-vis or storybook-addon-vis/vitest-setup would immediately call expect.extend as a side effect. Now the extension is deferred until visAnnotations.beforeEach() runs, ensuring it only executes when storybook/test is initialized.

4.1.0

Minor Changes

  • #723 69cde31 Thanks @unional! - Add createMissingBaseline for image matchers so a missing baseline can be written without -u / updateSnapshot: 'all', and support vis.setup({ createMissingBaseline: true }) defaults for auto snapshots (overridable per test). Document Storybook Vitest browser limitations for createMissingBaseline and the updateSnapshot workaround.

  • #723 fc139fd Thanks @unional! - Add opt-in shortenLongSnapshotPaths to vis(): when enabled, if representative absolute snapshot paths under __baselines__ (after snapshotRootDir and snapshotSubpath) would exceed Windows-safe limits (250 characters or a path segment over 255), keep subpath directories and shorten only the final component to {firstToken}-{hash12}{ext} (tersify-style prefix); legacy taskId-key.png names are unchanged. Fix getVisOption to merge __default plugin options with the active Vitest project. Storybook visProjects may set shortenLongSnapshotPaths for the Vis panel (same semantics as Vitest vis()). Export resolveSnapshotSubpathWithinLimits from vitest-plugin-vis/server-utils. vitest-plugin-vis/testing is browser-safe (fixtures only). getVisOption and stubSuite are available from vitest-plugin-vis/testing/node for Node/Vitest project tests.

Patch Changes

4.0.0

Major Changes

  • #711 b4c34dc Thanks @unional! - Remove deprecated setup APIs and align with Vitest 4.

    • BREAKING: createVis is no longer re-exported from vitest-plugin-vis/setup. Import it from vitest-plugin-vis/setup-api instead.
    • BREAKING: Removed deprecated vis.presets, vis.beforeAll, and vis.afterEach helpers from the object returned by createVis. Use vis.setup() (and autoSnapshotMatcher where you need per-theme snapshots) instead.
    • BREAKING: Config preset none is renamed to custom.
    • BREAKING: Removed the vitest-plugin-vis/presets/enable entry point; use the manual or auto preset, or custom with your own vitest.setup.ts.
    • BREAKING: Browser helpers now rely on Vitest 4’s TestRunner.getCurrentTest / getCurrentSuite (via vitest instead of vitest/suite). Requires Vitest 4+ in browser projects.

Patch Changes

  • 397cbe6 Thanks @unional! - Remove usage of deprecated IconButton.

  • Updated dependencies [b4c34dc]:

    • vitest-plugin-vis@5.0.0

3.1.5

Patch Changes

  • Updated dependencies [494a8c7]:
    • vitest-plugin-vis@4.2.2

3.1.4

Patch Changes

  • Updated dependencies [76faffe]:
    • vitest-plugin-vis@4.2.1

3.1.3

Patch Changes

3.1.2

Patch Changes

  • #533 015f203 Thanks @unional! - Move React logic to the panel component. This avoids the invalid hook call error when using the panel with @storybook/addon-docs loaded in the same Storybook instance.

3.1.1

Patch Changes

  • #530 70b24a5 Thanks @unional! - Downgrade Storybook from 10.2.0 alpha to 10.1.10. 10.2.0 seems to still take a while to be released.

3.1.0

Minor Changes

  • #496 bf7fcec Thanks @unional! - Improve support for Storybook CSF Next. The setup is now done in .storybook/preview.ts instead of vitest.setup.ts.

Patch Changes

  • #496 557b809 Thanks @unional! - Handle case when storyData is undefined.

  • Updated dependencies [ea6b3b2]:

    • vitest-plugin-vis@4.1.0

3.0.1

Patch Changes

3.0.0

Major Changes

Minor Changes

Patch Changes

2.1.5

Patch Changes

  • #476 e14b67d Thanks @unional! - Use jsx: react instead of jsx: react-jsx to fix the recentlyCreatedOwnerStacks error when loading the addon panel.

  • Updated dependencies [0ebfe75]:

    • vitest-plugin-vis@3.5.1

2.1.4

Patch Changes

2.1.3

Patch Changes

  • Updated dependencies [147858a]:
    • vitest-plugin-vis@3.5.0

2.1.2

Patch Changes

  • Updated dependencies [fff3b67]:
    • vitest-plugin-vis@3.4.1

2.1.1

Patch Changes

  • Updated dependencies [30026e2]:
    • vitest-plugin-vis@3.4.0

2.1.0

Minor Changes

  • 05b7ae2 Thanks @unional! - Add CJS support for Storybook .storybook/main.ts usage.

2.0.7

Patch Changes

  • cb735b9 Thanks @unional! - Revert importing createVis from vitest-plugin-vis/client-api. createVis imports vitest, which cannot be imported in the client side.
  • Updated dependencies [cb735b9]:
    • vitest-plugin-vis@3.3.2

2.0.6

Patch Changes

  • Updated dependencies [5b25658]:
    • vitest-plugin-vis@3.3.1

2.0.5

Patch Changes

2.0.4

Patch Changes

2.0.3

Patch Changes

  • #308 d6e5979 Thanks @unional! - Update preset.js to ESM. This fix the issue when running in Node 22.12+ where ESM is enabled by default.

2.0.2

Patch Changes

2.0.1

Patch Changes

2.0.0

Major Changes

1.1.0

Minor Changes

Patch Changes

  • Updated dependencies [9ba3e59]:
    • vitest-plugin-vis@3.1.0

1.0.2

Patch Changes

1.0.1

Patch Changes

  • 702f458 Thanks @unional! - Add refresh button to vis panel.

  • Updated dependencies [9a25501]:

    • vitest-plugin-vis@3.0.1

1.0.0

Major Changes

  • #259 a7c2a49 Thanks @unional! - Move storybook-addon-vis/preview into storybook-addon-vis/vitest-setup.

  • #259 d8c2dac Thanks @unional! - Add Storybook Vis panel to show the results of the visual tests.

Minor Changes

Patch Changes

0.19.4

Patch Changes

  • Updated dependencies [0b83a6e]:
    • vitest-plugin-vis@2.4.4

0.19.3

Patch Changes

  • Updated dependencies [57be521]:
    • vitest-plugin-vis@2.4.3

0.19.2

Patch Changes

  • Updated dependencies [349e021]:
    • vitest-plugin-vis@2.4.2

0.19.1

Patch Changes

  • Updated dependencies [e877872]:
    • vitest-plugin-vis@2.4.1

0.19.0

Minor Changes

  • #238 51346e2 Thanks @unional! - Export setAutoSnapshotOptions and SnapshotMeta which are useful under storybook-addon-vis/vitest-setup.

Patch Changes

0.18.8

Patch Changes

  • Updated dependencies [4b665f9]:
    • vitest-plugin-vis@2.3.3

0.18.7

Patch Changes

  • Updated dependencies [2a2b000]:
    • vitest-plugin-vis@2.3.2

0.18.6

Patch Changes

0.18.5

Patch Changes

  • #225 4692f23 Thanks @unional! - Workaround a Storybook 8.4 issue where the preview.beforeEach is called after test instead of before. Because of that, the setAutoSnapshotOptions() called within test is not honored.
  • Updated dependencies [15bbbed, 4692f23]:
    • vitest-plugin-vis@2.3.0

0.18.4

Patch Changes

  • Updated dependencies [13601ef]:
    • vitest-plugin-vis@2.2.0

0.18.3

Patch Changes

  • Updated dependencies [bbbc8e8]:
    • vitest-plugin-vis@2.1.1

0.18.2

Patch Changes

  • Updated dependencies [472acc9]:
    • vitest-plugin-vis@2.1.0

0.18.1

Patch Changes

0.18.0

Minor Changes

  • #204 020121f Thanks @unional! - Change the customizeSnapshotId to accept context object.

    This is a breaking change. Feature-wise, it is the same as before. We will enable better customization by passing viewport to the customizeSnapshotId function in the future.

  • #204 76b09cc Thanks @unional! - Add support to customize snapshotRootDir with a function. Deprecate platform option.

Patch Changes

0.17.11

Patch Changes

0.17.10

Patch Changes

0.17.9

Patch Changes

  • Updated dependencies [be483d4]:
    • vitest-plugin-vis@1.6.5

0.17.8

Patch Changes

  • Updated dependencies [78b117f]:
    • vitest-plugin-vis@1.6.4

0.17.7

Patch Changes

  • 433d0d8 Thanks @unional! - Export even more types to fix the inferred type cannot be named error!

0.17.6

Patch Changes

  • #185 c5296a1 Thanks @unional! - Export more types to fix the inferred type cannot be named error.

  • Updated dependencies [c5296a1]:

    • vitest-plugin-vis@1.6.3

0.17.5

Patch Changes

  • Updated dependencies [49e8fbc]:
    • vitest-plugin-vis@1.6.2

0.17.4

Patch Changes

  • Updated dependencies [537cf83]:
    • vitest-plugin-vis@1.6.1

0.17.3

Patch Changes

  • #171 abd1c47 Thanks @unional! - Support subjectDataTestId in defineAutoSnapshotParam().

  • Updated dependencies [5335011]:

    • vitest-plugin-vis@1.6.0

0.17.2

Patch Changes

  • Updated dependencies [611e0cc]:
    • vitest-plugin-vis@1.5.1

0.17.1

Patch Changes

  • #156 72959a6 Thanks @unional! - Add top level types field to package.json for project not using ESM module resolution.

  • #161 43fc2ce Thanks @unional! - Change default timeout to 30s. The initial timeout of 1s was set by Vitest. It is causing tests to fail with TimeoutError, even when getting Locator like getByRole.

    This timeout will be removed in Vitest 3.

    The underlying provider (playwright) does not have a default timeout.

    Setting to 30s should be a good default for most cases.

    It could still be too short for slow CI or when it is running scripts in parallel. That was the case for storybook-test-runner but could be improved in Vitest browser mode.

    If timeout is still an issue, we can further default it to 60s or even 120s.

  • Updated dependencies [72959a6, d2fdcbe, 43fc2ce, 995140f, a020417, ee4ef14]:

    • vitest-plugin-vis@1.5.0

0.17.0

Minor Changes

Patch Changes

  • Updated dependencies [da95b08]:
    • vitest-plugin-vis@1.4.0

0.16.4

Patch Changes

  • 513d95c Thanks @unional! - Add missing .d.ts files due to tsup set clean to true by default.

  • Updated dependencies [1b22d2d]:

    • vitest-plugin-vis@1.3.2

0.16.3

Patch Changes

  • Updated dependencies [3ebc865]:
    • vitest-plugin-vis@1.3.1

0.16.2

Patch Changes

0.16.1

Patch Changes

0.16.0

Minor Changes

  • #133 badf227 Thanks @unional! - Update to use matchImageSnapshot function from vitest-plugin-vis/client which runs image comparison on the client side.

Patch Changes

0.15.7

Patch Changes

  • Updated dependencies [e242444]:
    • vitest-plugin-vis@1.0.5

0.15.6

Patch Changes

  • Updated dependencies [d695c4f]:
    • vitest-plugin-vis@1.0.4

0.15.5

Patch Changes

  • Updated dependencies [1068941]:
    • vitest-plugin-vis@1.0.3

0.15.4

Patch Changes

  • Updated dependencies [a8fcd75]:
    • vitest-plugin-vis@1.0.2

0.15.3

Patch Changes

  • 7667feb Thanks @unional! - Export ToMatchImageSnapshotOptions type to avoid Inferred type can’t be named error.

0.15.2

Patch Changes

  • #119 3567475 Thanks @unional! - Remove /manager and /preset should not include previewAnnotations.

0.15.1

Patch Changes

  • #115 eec65da Thanks @unional! - Proxy getCurrentTest() from vitest/suite.

    This is part of the work to fix #101.

  • Updated dependencies [ae98ec4]:

    • vitest-plugin-vis@1.0.1

0.15.0

Minor Changes

Patch Changes

  • #113 3143283 Thanks @unional! - Add /preview export for visAnnotations.

  • #113 79d10d5 Thanks @unional! - Remove viteFinal setup in /preset. You need to configure Vitest in vitest.config.ts for Vitest Browser Mode anyway. So getting the config to .storybook/main.ts is actually worst.

  • #114 673b202 Thanks @unional! - Remove extra visAnnotations.beforeAll(). This is handled by vitest-plugin-vis and only need on vitest.beforeAll.

  • #113 78f2776 Thanks @unional! - Consolidate preview annotation in one place.

  • 49279f1 Thanks @unional! - Remove unused dependencies.

0.14.0

Minor Changes

  • #102 1c6830b Thanks @unional! - export trimCommonFolder(). This is made available for customizing snapshot subpath.

  • #102 c447676 Thanks @unional! - Support Locator #2.

  • #102 c39daf0 Thanks @unional! - create baseline snapshot on server.

  • #102 03b1e6b Thanks @unional! - Allow commands to work in webdriverio.

  • #102 fa4dd12 Thanks @unional! - Rewritten to use vitest-plugin-vis, which performs the snapshot on the server side.

    The interface is greatly improved. The page.imageSnapshot() is removed. Now you can perform expect(...).toMatchImageSnapshot() on regular element and locator.

    Please check the read me for the new API.

  • #102 f4bda4c Thanks @unional! - Add setSnapshotMeta().

Patch Changes

  • #102 03b1e6b Thanks @unional! - Change to use ImageData(data, w, h, o) constructor instead of ImageData(w, h, o) as firefox does not support it.

  • #102 cbd1b4c Thanks @unional! - Fix update snapshot for basic afterEach

  • #102 3b09bb1 Thanks @unional! - Use console.error() instead of console.info() when using not supported page method.

  • #102 9534645 Thanks @unional! - Plugin should not set browser.

  • 7e63e9e Thanks @unional! - Fix typo in error message.

  • Updated dependencies [03893ab]:

    • vitest-plugin-vis@1.0.0

0.13.0

Minor Changes

  • #88 0fcada9 Thanks @unional! - Move the __results__ and __diff_output__ directory one level up to reduce nesting.

    Terminal window
    # from
    v __vis__
    v darwin # snapshot generated on macos by CI
    ˃ __diff_output__
    ˃ __result__
    ˃ linux # snapshot generated on linux by CI
    ˃ __diff_output__
    ˃ __result__
    v local # snapshot generated on local machine
    ˃ __diff_output__
    ˃ __result__
    v button.stories.tsx
    snapshot-1.png
    snapshot-2.png
    v button.stories.tsx
    snapshot-1.png
    snapshot-2.png
    # to
    v __vis__
    ˃ __diff_output__ # where the diff images are stored
    v button.stories.tsx
    snapshot-1.png
    snapshot-2.png
    ˃ __result__ # where the resulting snapshot of the current run are stored
    v button.stories.tsx
    snapshot-1.png
    snapshot-2.png
    ˃ darwin # snapshot generated on macos by CI
    ˃ linux # snapshot generated on linux by CI
    v local # snapshot generated on local machine
    v button.stories.tsx
    snapshot-1.png
    snapshot-2.png

0.12.1

Patch Changes

  • a64d076 Thanks @unional! - Use Object.create(null) instead of {} to avoid prototype pollution.

0.12.0

Minor Changes

  • #74 6707f9f Thanks @unional! - Change default snapshot folder back to <project root>/__vis__. They are now stored in folder structure mimic the test/story file.

    This makes it much easier to review the snapshot results.

    Also, it avoids the EISDIR error when running the tests and running the storybook at the same time.

    The snapshotDir option is renamed to snapshotRootDir.

    A customizeSnapshotSubpath is added to allow customizing the snapshot sub path.

Patch Changes

  • #77 d089502 Thanks @unional! - Change failure message to use full path.

    This allows the user to easily access the file in their editor.

0.11.2

Patch Changes

0.11.1

Patch Changes

0.11.0

Minor Changes

  • ac4f759 Thanks @unional! - Change snapshot folder to __vis__ next to the story/test file. This avoids conflict when there are multiple story/test files with the same name in different folder.

    The createVisConfig({ snapshotPath }) is renamed to snapshotDir.

0.10.2

Patch Changes

0.10.1

Patch Changes

0.10.0

Minor Changes

Patch Changes

0.9.1

Patch Changes

  • abd7a7f Thanks @unional! - Move expect.extends to module scope. It technically becomes a load time side effect which is not ideal, but at the same time avoids doing the extends on every test file.

  • 768396a Thanks @unional! - Use exact type for storybookPreviewVis.

0.9.0

Minor Changes

  • 2db5b77 Thanks @unional! - Remove the need of taking ctx as argument for shouldTakeSnapshot and the afterEach handler.

  • #55 85b9975 Thanks @unional! - Support expect(element).

  • #59 90153d3 Thanks @unional! - Simplify setup in vitest.setup.ts with createVisConfig().

  • #60 0eb677b Thanks @unional! - Internalize expect.extends() for storybook within defineVisPreview().

  • 5a7777f Thanks @unional! - Rename visStorybookPreview to storybookPreviewVis

Patch Changes

  • #60 30adcef Thanks @unional! - Fix play() when running in storybook.

  • f92a371 Thanks @unional! - Change shouldTakeSnapshot(ctx) to accept any. Check is done at runtime. This change allows the user to skip the type parameter in afterEach hook.

    // from
    import { StoryContext } from "@storybook/react";
    import { shouldTakeSnapshot } from "storybook-addon-vis/vitest-setup";
    import { afterEach } from "vitest";
    afterEach<{ story?: StoryContext }>(async (ctx) => {
    if (!shouldTakeSnapshot(ctx)) return;
    // ...
    });
    // to
    afterEach(async (ctx) => {
    if (!shouldTakeSnapshot(ctx)) return;
    // ...
    });

0.8.0

Minor Changes

  • 79ccf83 Thanks @unional! - Refactor configureSnapshotBeforeAll() into setupVitestVis().

    // from
    import { configureSnapshotBeforeAll } from "storybook-addon-vis";
    import { beforeAll } from "vitest";
    beforeAll(configureSnapshotBeforeAll);
    // to
    import { setupVitestVis } from "storybook-addon-vis";
    import { beforeAll } from "vitest";
    const vis = setupVitestVis();
    beforeAll(vis.beforeAll);
  • #50 062991d Thanks @unional! - Remove configureSnapshotBeforeEach, no longer needed.

  • #50 180562a Thanks @unional! - The last expect().toMatchImageSnapshot() will be awaited automatically, making it easier to write.

0.7.0

Minor Changes

  • 250611e Thanks @unional! - The parameters.snapshot is now honored by expect(...).toMatchImageSnapshot() automatically. This applies to both automatic and manual snapshot testing.

Patch Changes

  • b90b970 Thanks @unional! - Create a manual vitest-plugin type definition.

0.6.3

Patch Changes

0.6.2

Patch Changes

0.6.1

Patch Changes

  • 18ac025 Thanks @unional! - Enable code splitting to share state between storybook-addon-vis and storybook-addon-vis/vitest-setup.

    We couldn’t reproduce the issue locally, but we believe this change will fix it.

0.6.0

Minor Changes

  • 668c6d9 Thanks @unional! - Add page.hasImageSnapshot().

    Rename type SnapshotCapturer to ImageSnapshotAction.

  • 85e5a7b Thanks @unional! - Add options.timeout and default to 3000

Patch Changes

0.5.0

Minor Changes

  • 4fdecf8 Thanks @unional! - Rename customizeFilename to customizeSnapshotId.

0.4.1

Patch Changes

  • #25 e251f43 Thanks @unional! - Update snapshot failure message so that the message press u to update snapshot will show.

0.4.0

Minor Changes

Patch Changes

0.3.0

Minor Changes

  • d9be0aa Thanks @unional! - Add page.imageSnapshot({ customizeFilename() {...} }).

0.2.0

Minor Changes

  • f55bb95 Thanks @unional! - Change getSnapshotPlatform() to return local when not on CI. This is the best setup I have found so far to make the snapshot test work on both local and CI.

    Set default snapshot path with getSnapshoPlatform function.

0.1.0

Minor Changes

Patch Changes

⚠️ Pushed to main

Authors: 1


v0.0.15 (Tue Oct 29 2024)

⚠️ Pushed to main

  • test: move tests to per platform (@unional)
  • test: add test for image resizer (@unional)
  • chore: remove prop-types (@unional)

Authors: 1


v0.0.14 (Mon Oct 28 2024)

🐛 Bug Fix

Authors: 1


v0.0.13 (Mon Oct 28 2024)

⚠️ Pushed to main

Authors: 1


v0.0.12 (Mon Oct 28 2024)

⚠️ Pushed to main

  • chore: add editorconfig (@unional)
  • feat: add configureSnapshotBeforeAll options (@unional)

Authors: 1


v0.0.11 (Mon Oct 28 2024)

⚠️ Pushed to main

Authors: 1


v0.0.10 (Mon Oct 28 2024)

⚠️ Pushed to main

Authors: 1


v0.0.9 (Mon Oct 28 2024)

⚠️ Pushed to main

Authors: 1


v0.0.8 (Mon Oct 28 2024)

🐛 Bug Fix

Authors: 1


v0.0.7 (Mon Oct 28 2024)

⚠️ Pushed to main

Authors: 1


v0.0.6 (Mon Oct 28 2024)

⚠️ Pushed to main

Authors: 1


v0.0.5 (Mon Oct 28 2024)

⚠️ Pushed to main

  • fix: stub imagesnapshot result and handling in storybook (@unional)
  • feat: invert vitest expect extend (@unional)
  • feat: invert storybook export extend (@unional)
  • chore: remove extra import (@unional)
  • chore: comment out preset (@unional)
  • refactor: move logic file (@unional)
  • feat: invert vitest-setup (@unional)
  • chore: remove building managea, preview, and preset (@unional)
  • test: update filename (@unional)
  • feat: add match options (@unional)
  • feat: take snapshot in lowercase (@unional)
  • feat: basig tag support (@unional)
  • refactor: test image (@unional)
  • fix: extend vitest expect only once (@unional)
  • refactor: move page.extend to context (@unional)
  • refactor: comment out rootDir (@unional)
  • refactor: move (@unional)
  • fix: remove extra exports (@unional)
  • fix: create dest folder when not exist (@unional)
  • chore: rename readme (@unional)

Authors: 1


v0.0.4 (Sat Oct 26 2024)

⚠️ Pushed to main

Authors: 1


v0.0.2 (Fri Oct 25 2024)

⚠️ Pushed to main

Authors: 1


v0.0.1 (Fri Oct 25 2024)

⚠️ Pushed to main

Authors: 1