-
Notifications
You must be signed in to change notification settings - Fork 492
chore: merge vitest config into vite.config.mts #8132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ae16759
f8e8906
44d3263
e8e96cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,8 @@ import IconsResolver from 'unplugin-icons/resolver' | |
| import Icons from 'unplugin-icons/vite' | ||
| import Components from 'unplugin-vue-components/vite' | ||
| import typegpuPlugin from 'unplugin-typegpu/vite' | ||
| import { defineConfig } from 'vite' | ||
| import type { ProxyOptions, UserConfig } from 'vite' | ||
| import { defineConfig } from 'vitest/config' | ||
| import type { ProxyOptions } from 'vite' | ||
| import { createHtmlPlugin } from 'vite-plugin-html' | ||
| import vueDevTools from 'vite-plugin-vue-devtools' | ||
|
|
||
|
|
@@ -511,5 +511,27 @@ export default defineConfig({ | |
| optimizeDeps: { | ||
| exclude: ['@comfyorg/comfyui-electron-types'], | ||
| entries: ['index.html'] | ||
| }, | ||
|
|
||
| test: { | ||
| globals: true, | ||
| environment: 'happy-dom', | ||
| setupFiles: ['./vitest.setup.ts'], | ||
| retry: process.env.CI ? 2 : 0, | ||
| include: [ | ||
| 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', | ||
| 'packages/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}' | ||
| ], | ||
| coverage: { | ||
| reporter: ['text', 'json', 'html'] | ||
| }, | ||
| exclude: [ | ||
| '**/node_modules/**', | ||
| '**/dist/**', | ||
| '**/cypress/**', | ||
| '**/.{idea,git,cache,output,temp}/**', | ||
| '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*' | ||
| ], | ||
| silent: 'passed-only' | ||
|
Comment on lines
+516
to
+535
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if tests-ui directory exists
if [ -d tests-ui ]; then
echo "=== tests-ui directory exists ==="
# Find test files in tests-ui
fd -a -e ts -e tsx -e js -e jsx -e mts -e cts -e mjs -e cjs '(\.test|\.spec)\.' tests-ui | head -20
else
echo "tests-ui directory does not exist"
fi
# Check current vite.config.mts include patterns
echo -e "\n=== Vite config include patterns ==="
sed -n '516,535p' vite.config.mtsRepository: Comfy-Org/ComfyUI_frontend Length of output: 905 Add Tests in Add tests-ui to include include: [
'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
- 'packages/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'
+ 'packages/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
+ 'tests-ui/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'
],🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does tests-ui exist?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The directory contains at least two test files that won't be picked up by the current Vitest configuration since the 🧠 Learnings used
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, and @AustinMroz !
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a lint-staged check to start. |
||
| } | ||
| }) satisfies UserConfig as UserConfig | ||
| }) | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 196
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 196
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 196
🌐 Web query:
lint-staged glob pattern function return value behavior💡 Result:
Short answer: lint-staged lets you use functions in JS configs; those functions receive the (staged) filenames and must return either
Important details
Examples (conceptual)
(filenames) =>
eslint --fix ${filenames.join(' ')}// receives all staged files'*.js': (files) => files.length ? [
eslint --fix ${files.join(' ')}] : [] // receives only matched filesSources
Scope the tests-ui lint-staged block to new files only.
The rule currently blocks any staged change under
tests-ui/(including deletions and renames), preventing migrations without--no-verify. Restrict the block to new file additions only.💡 Proposed fix (block only added files)
🤖 Prompt for AI Agents