Skip to content

Commit b994608

Browse files
authored
Tests: Vitest configuration cleanup (#5888)
## Summary Simplify default scripts. Filtering is still available to users, we can revisit tagging or grouping later. This fixes the issue where we had tests that were in the codebase but never run because they weren't under `/src/components` Also deletes the duplicate litegraph tests and their associated vitest config file. ## Changes - **What**: Test cleanup ## Review Focus ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5888-Tests-Vitest-configuration-cleanup-2806d73d36508197b800f68f0b028279) by [Unito](https://www.unito.io)
1 parent 7b1cce1 commit b994608

File tree

84 files changed

+117
-14261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+117
-14261
lines changed

.claude/commands/create-frontend-release.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ echo "Last stable release: $LAST_STABLE"
294294
1. Run complete test suite:
295295
```bash
296296
pnpm test:unit
297-
pnpm test:component
298297
```
299298
2. Run type checking:
300299
```bash

.claude/commands/setup_repo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ echo "Available commands:"
120120
echo " pnpm dev - Start development server"
121121
echo " pnpm build - Build for production"
122122
echo " pnpm test:unit - Run unit tests"
123-
echo " pnpm test:component - Run component tests"
124123
echo " pnpm typecheck - Run TypeScript checks"
125124
echo " pnpm lint - Run ESLint"
126125
echo " pnpm format - Format code with Prettier"

.github/workflows/vitest-tests.yaml

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,43 @@ name: Vitest Tests
22

33
on:
44
push:
5-
branches: [ main, master, dev*, core/*, desktop/* ]
5+
branches: [main, master, dev*, core/*, desktop/*]
66
pull_request:
7-
branches-ignore: [ wip/*, draft/*, temp/* ]
7+
branches-ignore: [wip/*, draft/*, temp/*]
88

99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v5
15-
16-
- name: Install pnpm
17-
uses: pnpm/action-setup@v4
18-
with:
19-
version: 10
20-
21-
- name: Use Node.js
22-
uses: actions/setup-node@v4
23-
with:
24-
node-version: 'lts/*'
25-
cache: 'pnpm'
26-
27-
- name: Cache tool outputs
28-
uses: actions/cache@v4
29-
with:
30-
path: |
31-
.cache
32-
coverage
33-
.vitest-cache
34-
key: vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', 'vitest.config.*', 'tsconfig.json') }}
35-
restore-keys: |
36-
vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
37-
vitest-cache-${{ runner.os }}-
38-
test-tools-cache-${{ runner.os }}-
39-
40-
- name: Install dependencies
41-
run: pnpm install --frozen-lockfile
42-
43-
- name: Run Vitest tests
44-
run: |
45-
pnpm test:component
46-
pnpm test:unit
14+
- uses: actions/checkout@v5
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v4
18+
with:
19+
version: 10
20+
21+
- name: Use Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "lts/*"
25+
cache: "pnpm"
26+
27+
- name: Cache tool outputs
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
.cache
32+
coverage
33+
.vitest-cache
34+
key: vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', 'vitest.config.*', 'tsconfig.json') }}
35+
restore-keys: |
36+
vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
37+
vitest-cache-${{ runner.os }}-
38+
test-tools-cache-${{ runner.os }}-
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Run Vitest tests
44+
run: pnpm test:unit

.storybook/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- `pnpm storybook`: Start Storybook development server
66
- `pnpm build-storybook`: Build static Storybook
7-
- `pnpm test:component`: Run component tests (includes Storybook components)
7+
- `pnpm test:unit`: Run unit tests (includes Storybook components)
88

99
## Development Workflow for Storybook
1010

AGENTS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
- `pnpm dev:electron`: Dev server with Electron API mocks.
1313
- `pnpm build`: Type-check then production build to `dist/`.
1414
- `pnpm preview`: Preview the production build locally.
15-
- `pnpm test:unit`: Run Vitest unit tests (`tests-ui/`).
16-
- `pnpm test:component`: Run component tests (`src/components/`).
15+
- `pnpm test:unit`: Run Vitest unit tests.
1716
- `pnpm test:browser`: Run Playwright E2E tests (`browser_tests/`).
1817
- `pnpm lint` / `pnpm lint:fix`: Lint (ESLint). `pnpm format` / `format:check`: Prettier.
1918
- `pnpm typecheck`: Vue TSC type checking.

CLAUDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ This bootstraps the monorepo with dependencies, builds, tests, and dev server ve
1818
- `pnpm build`: Build for production (via nx)
1919
- `pnpm lint`: Linting (via nx)
2020
- `pnpm format`: Prettier formatting
21-
- `pnpm test:component`: Run component tests with browser environment
2221
- `pnpm test:unit`: Run all unit tests
2322
- `pnpm test:browser`: Run E2E tests via Playwright
2423
- `pnpm test:unit -- tests-ui/tests/example.test.ts`: Run single test file

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,6 @@ Here's how Claude Code can use the Playwright MCP server to inspect the interfac
213213
- `pnpm i` to install all dependencies
214214
- `pnpm test:unit` to execute all unit tests
215215

216-
### Component Tests
217-
218-
Component tests verify Vue components in `src/components/`.
219-
220-
- `pnpm test:component` to execute all component tests
221-
222216
### Playwright Tests
223217

224218
Playwright tests verify the whole app. See [browser_tests/README.md](browser_tests/README.md) for details.
@@ -229,7 +223,6 @@ Before submitting a PR, ensure all tests pass:
229223

230224
```bash
231225
pnpm test:unit
232-
pnpm test:component
233226
pnpm test:browser
234227
pnpm typecheck
235228
pnpm lint

package.json

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,35 @@
88
"description": "Official front-end implementation of ComfyUI",
99
"license": "GPL-3.0-only",
1010
"scripts": {
11-
"dev": "nx serve",
12-
"dev:electron": "nx serve --config vite.electron.config.mts",
13-
"build": "pnpm typecheck && nx build",
11+
"build-storybook": "storybook build",
1412
"build:types": "nx build --config vite.types.config.mts && node scripts/prepare-types.js",
15-
"zipdist": "node scripts/zipdist.js",
16-
"typecheck": "vue-tsc --noEmit",
17-
"format": "prettier --write './**/*.{js,ts,tsx,vue,mts}' --cache --list-different",
13+
"build": "pnpm typecheck && nx build",
14+
"collect-i18n": "pnpm exec playwright test --config=playwright.i18n.config.ts",
15+
"dev:electron": "nx serve --config vite.electron.config.mts",
16+
"dev": "nx serve",
17+
"devtools:pycheck": "python3 -m compileall -q tools/devtools",
18+
"format:check:no-cache": "prettier --check './**/*.{js,ts,tsx,vue,mts}'",
1819
"format:check": "prettier --check './**/*.{js,ts,tsx,vue,mts}' --cache",
1920
"format:no-cache": "prettier --write './**/*.{js,ts,tsx,vue,mts}' --list-different",
20-
"format:check:no-cache": "prettier --check './**/*.{js,ts,tsx,vue,mts}'",
21-
"test:all": "nx run test",
22-
"test:browser": "pnpm exec nx e2e",
23-
"test:component": "nx run test src/components/",
24-
"test:litegraph": "vitest run --config vitest.litegraph.config.ts",
25-
"test:unit": "nx run test tests-ui/tests",
26-
"preinstall": "pnpm dlx only-allow pnpm",
27-
"prepare": "husky || true && git config blame.ignoreRevsFile .git-blame-ignore-revs || true",
28-
"preview": "nx preview",
29-
"lint": "eslint src --cache",
21+
"format": "prettier --write './**/*.{js,ts,tsx,vue,mts}' --cache --list-different",
22+
"json-schema": "tsx scripts/generate-json-schema.ts",
23+
"knip:no-cache": "knip",
24+
"knip": "knip --cache",
25+
"lint:fix:no-cache": "eslint src --fix",
3026
"lint:fix": "eslint src --cache --fix",
31-
"lint:unstaged": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache",
32-
"lint:unstaged:fix": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache --fix",
3327
"lint:no-cache": "eslint src",
34-
"lint:fix:no-cache": "eslint src --fix",
35-
"knip": "knip --cache",
36-
"knip:no-cache": "knip",
28+
"lint:unstaged:fix": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache --fix",
29+
"lint:unstaged": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache",
30+
"lint": "eslint src --cache",
3731
"locale": "lobe-i18n locale",
38-
"collect-i18n": "pnpm exec playwright test --config=playwright.i18n.config.ts",
39-
"json-schema": "tsx scripts/generate-json-schema.ts",
32+
"preinstall": "pnpm dlx only-allow pnpm",
33+
"prepare": "husky || true && git config blame.ignoreRevsFile .git-blame-ignore-revs || true",
34+
"preview": "nx preview",
4035
"storybook": "nx storybook -p 6006",
41-
"build-storybook": "storybook build",
42-
"devtools:pycheck": "python3 -m compileall -q tools/devtools"
36+
"test:browser": "pnpm exec nx e2e",
37+
"test:unit": "nx run test",
38+
"typecheck": "vue-tsc --noEmit",
39+
"zipdist": "node scripts/zipdist.js"
4340
},
4441
"devDependencies": {
4542
"@eslint/js": "catalog:",

src/lib/litegraph/test/ConfigureGraph.test.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/lib/litegraph/test/LGraph.test.ts

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)