Skip to content

Commit be015a5

Browse files
authored
Run vitest during frontend build (#9022)
* Run vitest during frontend build * Add frontend-test Make target
1 parent 82f3dc9 commit be015a5

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ help:
1414
@echo "update-config-docstring Update the app's config docstring so mkdocs can autogenerate it correctly."
1515
@echo "frontend-install Install the pnpm modules needed for the frontend"
1616
@echo "frontend-build Build the frontend for localhost:9090"
17+
@echo "frontend-test Run the frontend test suite once"
1718
@echo "frontend-dev Run the frontend in developer mode on localhost:5173"
1819
@echo "frontend-typegen Generate types for the frontend from the OpenAPI schema"
1920
@echo "frontend-lint Run frontend checks and fixable lint/format steps"
@@ -57,6 +58,10 @@ frontend-install:
5758
frontend-build:
5859
cd invokeai/frontend/web && pnpm build
5960

61+
# Run the frontend test suite once
62+
frontend-test:
63+
cd invokeai/frontend/web && pnpm run test:run
64+
6065
# Run the frontend in dev mode
6166
frontend-dev:
6267
cd invokeai/frontend/web && pnpm dev

invokeai/frontend/web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"dev": "vite dev",
2323
"dev:host": "vite dev --host",
24-
"build": "pnpm run lint && vite build",
24+
"build": "pnpm run lint && vitest run && vite build",
2525
"typegen": "node scripts/typegen.js",
2626
"preview": "vite preview",
2727
"lint:knip": "knip --tags=-knipignore",
@@ -35,6 +35,7 @@
3535
"storybook": "storybook dev -p 6006",
3636
"build-storybook": "storybook build",
3737
"test": "vitest",
38+
"test:run": "vitest run",
3839
"test:ui": "vitest --coverage --ui",
3940
"test:no-watch": "vitest --no-watch"
4041
},

invokeai/frontend/web/vite.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default defineConfig(({ mode }) => {
3939
host: '0.0.0.0',
4040
},
4141
test: {
42+
reporters: [['default', { summary: false }]],
4243
typecheck: {
4344
enabled: true,
4445
ignoreSourceErrors: true,

0 commit comments

Comments
 (0)