Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cartridge-gg avatar

Run Tests

  • 30 installs
  • 80 repo stars
  • Updated July 29, 2026
  • cartridge-gg/controller

Run the Cartridge Controller test suites (unit, storybook visual regression, e2e, build) to validate changes.

About

Provides a reference for running the Cartridge Controller monorepo test suites, including unit, visual regression, e2e, and build checks. A developer uses it to validate changes or run tests before committing.

  • Reference for unit, storybook visual, e2e, and build test commands
  • Lists durations and purpose for each pnpm test command

Run Tests by the numbers

  • 30 all-time installs (skills.sh)
  • Ranked #1,349 of 2,155 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Jul 30, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cartridge-gg/controller --skill run-tests

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs30
repo stars80
Last updatedJuly 29, 2026
Repositorycartridge-gg/controller

What it does

Run the Cartridge Controller test suites (unit, storybook visual regression, e2e, build) to validate changes.

Files

SKILL.mdMarkdownGitHub ↗

Run Tests

Quick Reference

CommandPurposeDuration
pnpm lint:checkLint + format check~30s
pnpm testUnit tests~1-2min
pnpm test:ciUnit tests with coverage~2-3min
pnpm test:storybookVisual regression tests~5-10min
pnpm buildFull build (includes type check)~2-3min
pnpm e2eEnd-to-end tests~5-10min

Test Types

1. Linting and Formatting

Fastest check - always run before committing:

pnpm lint:check

This runs:

  • ESLint for code quality
  • Prettier for formatting

To auto-fix issues:

pnpm format  # Fix formatting + lint

2. Unit Tests

Tests the keychain package:

# Standard run
pnpm test

# With coverage report
pnpm test:ci

# Run specific test file
pnpm keychain test -- --testPathPattern="connection"

Test files are located in:

  • packages/keychain/src/**/*.test.ts
  • packages/controller/src/__tests__/

3. Storybook Visual Regression Tests

Tests UI components for visual changes:

# Run visual tests (compares against baseline)
pnpm test:storybook

# Update baseline snapshots after intentional changes
pnpm test:storybook:update

Snapshots are stored in:

  • packages/keychain/__image_snapshots__/

4. Build (Type Checking)

TypeScript compilation catches type errors:

pnpm build

This also validates that all packages compile correctly.

5. End-to-End Tests

Full integration tests with Playwright:

# Run headless
pnpm e2e

# Run with UI for debugging
pnpm e2e:ui

E2E tests are in:

  • examples/next/tests/

CI Equivalence

To mirror what CI runs, execute in order:

# 1. Quality checks (quality.yml)
pnpm lint:check

# 2. Build and test (test.yml)
pnpm build
pnpm test:ci

# 3. Visual regression (test.yml - storybook job)
pnpm test:storybook

Interpreting Results

Test Failures

# Re-run failed test with more details
pnpm keychain test -- --verbose --testNamePattern="failing test name"

Snapshot Failures

If Storybook tests fail with visual differences: 1. Review the diff images in packages/keychain/__image_snapshots__/__diff_output__/ 2. If changes are intentional: pnpm test:storybook:update 3. If changes are unintentional: fix the component

Type Errors

# Check specific package
pnpm controller build:deps
pnpm keychain build

Package-Specific Testing

# Controller SDK tests
pnpm controller test

# Keychain tests
pnpm keychain test

# Run test in watch mode for development
pnpm keychain test -- --watch

Common Issues

"Cannot find module" errors

pnpm clean && pnpm i && pnpm build:deps

Storybook tests timeout

Ensure the Storybook server is not already running on port 6006.

E2E tests fail to start

Ensure dev servers are running:

pnpm dev  # In one terminal
pnpm e2e  # In another

Pre-Commit Verification

The git pre-commit hook automatically runs:

pnpm run format --ui stream
pnpm run lint:check --ui stream

This ensures basic quality before every commit.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.