Skip to content

behnamazimi/visnap

ViSnap

npm version npm downloads License: MIT TypeScript

A visual regression testing tool organized as a monorepo. ViSnap captures and compares screenshots of UI components to help catch unwanted visual changes before they reach users.

Workspace Structure

This monorepo contains several packages that work together to provide visual regression testing:

Core Packages

  • @visnap/protocol - Shared types and interfaces used across all packages
  • @visnap/core - Main orchestration engine that manages test execution and coordinates between adapters
  • @visnap/cli - Command-line interface for end users
  • @visnap/reporter - Generates HTML and JSON reports from test results

Adapters

  • @visnap/storybook-adapter - Tests individual Storybook components and stories
  • @visnap/url-adapter - Tests any web page or application by URL
  • @visnap/playwright-adapter - Browser automation layer using Playwright
  • @visnap/fs-adapter - Filesystem storage for screenshots and test data

Apps & Examples

  • apps/docs - Documentation site at visnap.dev
  • examples/* - Example projects showing ViSnap integration

Shared Configuration

  • packages/eslint-config - Shared ESLint configuration for all packages

Getting Started

# Install ViSnap CLI
npm install -D @visnap/cli

# Start with init - it sets up everything you need
npx visnap init

# Take baseline screenshots
npx visnap update

# Test for visual changes
npx visnap test

The init command installs @visnap/cli and required adapters locally in your project.

Development

To contribute to this project, see CONTRIBUTING.md for development setup and guidelines.

Documentation

📚 Full Documentation - Complete guides, API reference, and examples