npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@snapvisor/vitest

v0.4.0

Published

Vitest SDK for visual testing with Snapvisor.

Downloads

433

Readme

Official Argos Vitest integration

npm version npm dm npm dt

Capture Argos screenshots directly from your Vitest browser tests.

Visit the Vitest SDK documentation for guides, API and more.

Installation

Install the package:

npm install --save-dev @snapvisor/vitest

argosSnapshot runs in any Vitest test — browser or Node — and needs nothing else.

To capture screenshots with argosScreenshot, run your tests in Vitest browser mode with the Playwright provider and install the following peer dependencies:

npm install --save-dev vitest @vitest/browser @vitest/browser-playwright playwright

Usage

Register the plugin in your Vitest config:

// vitest.config.ts
import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import { argosVitestPlugin } from "@snapvisor/vitest/plugin";

export default defineConfig({
  plugins: [
    argosVitestPlugin({
      // Upload the screenshots to Argos at the end of the run.
      uploadToArgos: process.env.CI === "true",
    }),
  ],
  test: {
    browser: {
      enabled: true,
      headless: true,
      provider: playwright(),
      instances: [{ browser: "chromium" }],
    },
  },
});

Then take screenshots from your browser tests:

import { test } from "vitest";
import { render } from "vitest-browser-react";
import { argosScreenshot } from "@snapvisor/vitest";
import { Button } from "./Button";

test("Button", async () => {
  render(<Button>Click me</Button>);
  await argosScreenshot("button");
});

Automatic naming

The name is optional. When omitted, Argos derives one from the current test, mimicking Vitest snapshots. Several unnamed captures in the same test get an incrementing counter so they stay unique:

test("Button", async () => {
  render(<Button>Click me</Button>);
  await argosScreenshot(); // -> "src/Button.test.tsx > Button 1"
  await argosScreenshot(); // -> "src/Button.test.tsx > Button 2"
});

Unlike Vitest — which keeps a per-file .snap, so its keys only need to be unique within a file — Argos names are global across the build. The generated name therefore includes the test file path, so two tests with the same title in different files never collide.

Snapshots

argosSnapshot captures a snapshot of any value — not just a screenshot — and uploads it to Argos to diff across builds, mimicking Vitest snapshots. Unlike argosScreenshot, it does not need a browser and works in both browser and Node tests.

The value comes first; the name is optional. Omit it to auto-name the snapshot from the current test (like screenshots above), or pass options.name to set it explicitly:

import { test } from "vitest";
import { argosSnapshot } from "@snapvisor/vitest";

test("API response", async () => {
  const user = await fetchUser();
  // Objects are serialized with `@vitest/pretty-format`, strings are written
  // verbatim.
  await argosSnapshot(user); // -> "src/user.test.ts > API response 1"
  await argosSnapshot(user, { name: "user" }); // explicit name
});

Use the extension option to control how Argos renders and diffs the snapshot, and tag to attach tags:

await argosSnapshot(JSON.stringify(config, null, 2), {
  name: "config",
  extension: ".json",
  tag: "config",
});

Screenshots and snapshots are both written to the ./snapshots directory by default (configurable via the plugin root option) and uploaded by the reporter when uploadToArgos is enabled.

Links