Files
ComfyUI_frontend/tests-ui
Alexander Brown 1b83d6b5a6 Migration: pnpm (#5215)
* migration: npm to pnpm
Step 1, package and lockfile

* migration: npm to pnpm
Step 2: docs / LLM instructions

* migration: npm to pnpm
Step 3: More documentation updates

* migration: npm to pnpm
Step 4: Even more documentation

* migration: npm to pnpm
Step 5: GitHub Actions

* migration: npm to pnpm
Step 6: PNPM installation in actions. This merge is going to be painful.

* migration: npm to pnpm
Unignore and add pnpm lockfile.

* migration: npm to pnpm
package-lock.json -> pnpm-lock.yaml

* migration: explicit @primeuix/styled, move glob to prod deps

* migration: more explicit deps required by the importmap plugin and vite

* fix: missed merge artifact

* fix: Make sure pnpm is available to install wrangler

* migration: pnpm for dev-release.yaml

* migration: new setup action version
Won't work until that is updated and a new release is cut.

* migration: Playwright needs uuid

* migration: Add explicit deps for lobehub

* chore(version-bump.yaml): change cache from npm to pnpm to optimize package management and improve build performance

* migration: install pnpm in version-bump action

---------

Co-authored-by: snomiao <snomiao@gmail.com>
2025-08-27 06:10:15 -07:00
..
2025-08-27 06:10:15 -07:00
2025-08-27 06:10:15 -07:00

ComfyUI Frontend Testing Guide

This guide provides an overview of testing approaches used in the ComfyUI Frontend codebase. These guides are meant to document any particularities or nuances of writing tests in this codebase, rather than being a comprehensive guide to testing in general. By reading these guides first, you may save yourself some time when encountering issues.

Testing Documentation

Documentation for unit tests is organized into three guides:

Testing Structure

The ComfyUI Frontend project uses a mixed approach to unit test organization:

  • Component Tests: Located directly alongside their components with a .spec.ts extension
  • Unit Tests: Located in the tests-ui/tests/ directory
  • Store Tests: Located in the tests-ui/tests/store/ directory
  • Browser Tests: These are located in the browser_tests/ directory. There is a dedicated README in the browser_tests/ directory, so it will not be covered here.

Test Frameworks and Libraries

Our tests use the following frameworks and libraries:

Getting Started

To run the tests locally:

# Run unit tests
pnpm test:unit

# Run unit tests in watch mode
pnpm test:unit:dev

# Run component tests with browser-native environment
pnpm test:component

Refer to the specific guides for more detailed information on each testing type.