惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Google Online Security Blog
Google Online Security Blog
T
Threat Research - Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
W
WeLiveSecurity
NISL@THU
NISL@THU
V
Vulnerabilities – Threatpost
V2EX - 技术
V2EX - 技术
Cisco Talos Blog
Cisco Talos Blog
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
量子位
Security Archives - TechRepublic
Security Archives - TechRepublic
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
H
Hacker News: Front Page
D
Docker
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
Kaspersky official blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
小众软件
小众软件
S
Security Affairs
博客园 - 聂微东
AI
AI
Latest news
Latest news
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Engineering at Meta
Engineering at Meta
Cloudbric
Cloudbric
S
Secure Thoughts
Spread Privacy
Spread Privacy
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

Codrops

The Art of Continuous Transformation: How Garden Eight Blends Integrity with Play | Codrops Building Cerebrium: Making Serverless Infrastructure Tangible | Codrops Building Ridgeline: Engineering a Real-Time 3D Experience in Webflow | Codrops Magnetic Commerce: Building the Dash Creative Website | Codrops The Craft Behind Memorable Digital Experiences: Inside Unseen Studio | Codrops ZERO: The Engineering Behind a Defiant Interactive Narrative | Codrops Meet the Speakers of the First Three.js Conference | Codrops The Architecture Behind Trionn: Coordinating GSAP, Three.js, Lenis, and Web Audio | Codrops Where Stories Become Interactive Worlds: How makemepulse Brings Ideas to Life Across Web, XR, and Beyond | Codrops The Sleepers: Creating an Atmospheric WebGL Experience with Lightweight Techniques | Codrops Building an Interactive Wave Propagation Cube Grid with Three.js | Codrops Ten Years Away: Designing an Interactive Comic for Studio375’s Tenth Anniversary | Codrops Building a Scroll-Driven 3D Gallery Using a Blender Camera Path with Three.js and GSAP | Codrops From Years of Client Work to a Next.js + Sanity Starter Kit | Codrops Sculpting a Digital Athlete: Capturing Stefanos Tsitsipas Beyond the Court | Codrops Building Persistent Page Transitions with WebGPU and Vanilla JavaScript | Codrops Inside Bisous: Designing an Editorial Experience for Cinematic CGI | Codrops Engineering the Web Experience Behind Shopify’s Spring ’26 Edition: Everywhere | Codrops Shaping Stories into Experience: The Work of Kevin Lam | Codrops Podium: Building a Website Where Running Becomes Storytelling | Codrops Designing Beyond the Surface: How DashDigital Turns Complexity into Clarity | Codrops Creative Entrepreneurship: Designing the Machine | Codrops Exploring 3D Image Rotations on Scroll | Codrops Always Building, Always Learning: Cyd Stumpel’s Journey Through the Modern Web | Codrops Designing A Better Lou: Reducing Cognitive Load Through Design, Content, and Systems | Codrops Sketching the Impossible: A 3D Portfolio Built Without a Single 3D Model | Codrops Building Horeca: Advanced Motion Design in Webflow Without the Performance Trade-Offs | Codrops Building an Interactive Digital Stamp Collection with Shaders, Postcards, and Playful Inspection | Codrops No Two Paths Alike: Inside San Rita’s Approach to Digital Experiences | Codrops The Making of the New Lesse Studio Website: Clarity, Performance, and Intentionality | Codrops Creating a Thumbnail Flow Animation with GSAP MotionPath | Codrops Forging Her Own Path: Houmahani Kane’s Journey in Creative Development | Codrops Beaucoup and the Pursuit of Memorable Experiences | Codrops The Future of Emotional Technology: Comfort Websites for Growth and Self-Awareness | Codrops The Never Ending Story: Building a Seamless Infinite Scroll Experience with GSAP & Lenis | Codrops Whooshes, Snaps and Shaders: Adrien Vanderpotte and the Feeling of the Interface | Codrops Building a Scroll-Driven 3D Cube Gallery in Webflow with GSAP | Codrops Creating Scroll-Driven SVG Map Animations with GSAP | Codrops Made With Gsap: Building a Fun Gravity-Based Mouse Trail | Codrops 80s Business Tech and Seamless Scene Transitions: Inside Shader.se’s Scroll-Driven WebGPU Pipeline | Codrops Merlin: The Code Boutique Turning Motion Into Digital Magic | Codrops Designing Ourselves: The New Obys Identity and Website | Codrops Exploring the HTML-in-Canvas Proposal | Codrops Le:mma Studio: Building the Feeling Behind the Screen | Codrops From Shader Uniforms to Clip-Path Wipes: How GSAP Drives My Portfolio | Codrops Reverse-Engineering Claude AI’s Mascot Animations with SVG and GSAP | Codrops Akaru: Crafting Precision-Driven Digital Experiences | Codrops Designing Against the Gallery: A Two-Year Journey to a Layered Portfolio Experience | Codrops Between Human and Machine: Sofia Papadopoulou’s Approach to Augmented Creativity | Codrops More Than a Portfolio: Building a Scroll-Driven 3D World with Something to Say | Codrops Rhumb Studio: Small but Mighty, Shaped by Curiosity | Codrops Susurrus: Crafting a Cozy Watercolor World with Three.js and Shaders | Codrops Building 4WIDE: Turning Distortion, Blur, and Motion into a Coherent Experience | Codrops A Playful Clip Menu with GSAP’s easeReverse | Codrops False Earth: From WebGL Limits to a WebGPU-Driven World | Codrops Interactive Storytelling for the Web: Building Immersive Stories with Timelines, 3D, and Layered Scenes | Codrops The Art of Complex Motion: Corentin Bernadou’s World of Shaders and Experimentation | Codrops They Call Me Giulio: The Making of a Cinematic Cyberpunk Portfolio | Codrops Lusion: Where Digital Craft Meets Ambitious Experimentation | Codrops The Exat Microsite: Pushing a Typography Showcase to New Creative Extremes | Codrops A Single DM, a First SOTD, and the Start of Chanh M. Ho’s Creative Journey | Codrops Creating Custom Page Transitions in Astro with Barba.js and GSAP | Codrops R—K ’26: The Thinking and Code Behind a Portfolio Led by Presence | Codrops Building the Maxima Therapy Website: React, GSAP, and Dabbling with AI | Codrops Where Engineering Meets Craft: Edoardo Lunardi’s Obsession with the Details | Codrops Animating 160,000 Cubes in Three.js to Visualize Dithering | Codrops Arnaud Rocca’s Portfolio: From a GSAP-Powered Motion System to Fluid WebGL | Codrops Where Confidence Needs No Decoration: The Malvah.Studio Story | Codrops Motion Highlights #17 | Codrops
Testing What Users Actually See with Vitest and Chromatic | Codrops
By Kyle Gach · 2026-06-24 · via Codrops

Add fast, stable visual testing to your Browser Mode component tests

chromatic visual testing vitest

Vitest browser test results with Chromatic plugin

Editor’s note: Today, our friends at Chromatic are sharing an early look at their new visual testing plugin for Vitest. We’re excited to feature this guest article by Kyle Gach, who walks through how visual testing complements traditional component tests and helps catch UI regressions before they reach production.

Your PR to insert an “add to favorites” button is green. Every automated test passes. CI reports no failures.

Then a user reports that the product card doesn’t look right on their phone.

The test suite verified the component logic, but missed the rendered state the user saw: the breakpoint, the spacing, the wrapping, and the final painted layout.

Your Vitest tests can’t see your UI. Visual tests close that gap.

That’s why we’re opening early access to our new Chromatic plugin for Vitest.

Two product cards. The first one is wider and looks correct. It is labeled with a green checkmark. The second one is narrower and the layout has broken. It is labeled with a red x.

Visual component tests are perfect for UI development

Visual tests are easier to write and maintain than traditional component tests. At the same time, they provide more confidence because they test more.

A traditional component test for a product card might verify that the correct title and price are rendered and the CTA has the correct text and is clickable. Visual tests go beyond that and verify that every detail of the card’s appearance is correct: the fonts in use, colors, spacing, layout, breakpoints, etc. And they cover all of that without a single assertion you have to write and maintain.

By adding visual tests to your Vitest tests, you get the best of both worlds: regular assertions for interactive behavior and non-visual output like accessibility properties plus visual tests for appearance. Users care about both, so we must test both.

Visual testing with Vitest and Chromatic

If you’re testing your components with Vitest’s Browser Mode, the Chromatic plugin can add visual tests with no required changes to your test files.

ℹ️ What’s Browser Mode?

Vitest runs in node. By default, it renders the components in your tests in node, too, using a simulated browser environment, like jsdom or happydom. Because it’s only simulated, you often need to mock various browser and DOM APIs. Or worse, skip testing your components’ use of them.

With Browser Mode, Vitest spins up a real (typically headless) browser and renders your components there. No more mocking browser APIs. You test all the ways your components interface with the real browser.

The tradeoff is fidelity vs. speed. Browser Mode tests are far more realistic and capable, but slightly slower because of the real browser.

Browser Mode is a requirement for visual testing with Vitest.

How does it work?

Getting started is as simple as registering the plugin in your Vitest config:

// vitest.config.ts
import { defineProject } from 'vitest/config';
import { playwright } from '@vitest/browser-playwright';
import { chromaticPlugin } from '@chromatic-com/vitest/plugin'; 

export default defineProject({
  plugins: [chromaticPlugin()], // 👈 Add this; no test file changes required
  test: {
    browser: {
      provider: playwright(),
      enabled: true,
      instances: [{ browser: 'chromium' }],
    },
  },
});

With the plugin in place, performing a test run will collect the rendered result at the end of each test. (You can also collect the rendered output at arbitrary points during a test.)

Then you run Chromatic, which uploads those results to the cloud, takes snapshots in parallel, computes their diffs, automatically finds and reduces flake, and finally reports the result as a PR check.

The last step is review. You approve the diffs that look correct and reject the ones that don’t. Then push the changes to fix the rejected snapshots until you’re able to approve everything and merge your PR.

How is Chromatic different than Vitest’s visual testing?

Vitest offers a built-in visual testing capability, which also requires Browser Mode. It takes screenshots of your test results, and produces diffs to review. The key difference is that it stores those screenshots in your repo, which means you must store them with git and manage updates. You also must provide the environment to capture those screenshots, which is hard to keep stable, because it can vary based on the OS, browser, installed fonts, locale, etc.

Chromatic, by contrast, collects the rendered result of your tests locally, but captures the actual visual snapshots in a stable cloud environment. This provides a number of benefits:

  • Branch-aware baselines track main and feature branches for you, so you don’t have to store them in git.
  • Cloud rendering takes snapshots in a controlled, consistent platform to reduce environmental flake
  • SteadySnap stabilizes snapshots against animation, loading variance, and capture timing.
  • Parallel snapshotting runs your visual tests as fast as possible
  • Chromatic collects the rendered HTML, CSS, and assets behind each screenshot, so you can inspect the DOM and reproduce failures without running tests locally.

Or, to summarize with a table:

ComparisonBuilt-in Vitest visual testingChromatic Vitest plugin
Requires Browser ModeYesYes
StorageIn your repoIn cloud
Browser environmentUnique to every setupStable cloud environment
ReproductionsStatic screenshotStatic screenshot & inspectable live component
Diff reviewTerminal, CI logs, PR checksPr checks, dedicated web app
Best forSolo developers, small librariesTeams with production apps, design systems

Get early access

We are opening early access to the Chromatic plugin for teams already using Vitest Browser Mode or actively moving component tests there. The beta is private, with hands-on onboarding for a limited number of teams and free snapshots while evaluating the product.

Bring a real repo, and we will validate Browser Mode collection, CI behavior, PR review, branch baselines, and debugging against it together. Early-access teams can influence the product before launch, with priority access as the beta expands.

This is a good fit if your team already uses Vitest for component tests, has started adopting Browser Mode, and wants visual regression coverage without building screenshot infrastructure around the built-in API.

Requires Vitest Browser Mode using Playwright. We’ll follow up with onboarding details.

Kyle Gach

DX engineer at Chromatic & Storybook. Working in the overlap between design, engineering, and education. Loves reading, craft cocktails, and bike rides.

Creative Spotlights

Inside the journeys and portfolios of today's most inspiring designers and developers.

Studio Stories

Discover how studios & agencies started, how they work, and what they've built.

Case Studies

Discover the ideas, design, and craft behind today’s most inspiring web experiences.