Run vitest during frontend build (#9022)

* Run vitest during frontend build

* Add frontend-test Make target
This commit is contained in:
Jonathan 2026-04-05 19:18:24 -04:00 committed by GitHub
parent 82f3dc9032
commit be015a5434
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,7 @@ help:
@echo "update-config-docstring Update the app's config docstring so mkdocs can autogenerate it correctly."
@echo "frontend-install Install the pnpm modules needed for the frontend"
@echo "frontend-build Build the frontend for localhost:9090"
@echo "frontend-test Run the frontend test suite once"
@echo "frontend-dev Run the frontend in developer mode on localhost:5173"
@echo "frontend-typegen Generate types for the frontend from the OpenAPI schema"
@echo "frontend-lint Run frontend checks and fixable lint/format steps"
@ -57,6 +58,10 @@ frontend-install:
frontend-build:
cd invokeai/frontend/web && pnpm build
# Run the frontend test suite once
frontend-test:
cd invokeai/frontend/web && pnpm run test:run
# Run the frontend in dev mode
frontend-dev:
cd invokeai/frontend/web && pnpm dev

View File

@ -21,7 +21,7 @@
"scripts": {
"dev": "vite dev",
"dev:host": "vite dev --host",
"build": "pnpm run lint && vite build",
"build": "pnpm run lint && vitest run && vite build",
"typegen": "node scripts/typegen.js",
"preview": "vite preview",
"lint:knip": "knip --tags=-knipignore",
@ -35,6 +35,7 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"test": "vitest",
"test:run": "vitest run",
"test:ui": "vitest --coverage --ui",
"test:no-watch": "vitest --no-watch"
},

View File

@ -39,6 +39,7 @@ export default defineConfig(({ mode }) => {
host: '0.0.0.0',
},
test: {
reporters: [['default', { summary: false }]],
typecheck: {
enabled: true,
ignoreSourceErrors: true,