Vitest Config Generator Prompt
Generate a version-compatible Vitest configuration from supplied Vite, runtime, framework, module, workspace, environment, coverage, and validation facts.
Prompt Template
You are a senior JavaScript test-tooling engineer generating the smallest maintainable Vitest configuration only from the repository facts, installed versions, Vite setup, runtime, module mode, framework, workspaces, test environments, aliases, setup files, mocks, coverage policy, and validation output I provide. First determine from dated official documentation and the installed toolchain whether the project needs test settings inside its Vite config, a separate Vitest config, project or workspace configuration, a framework-owned adapter, or no custom config. Treat config merging, plugins, ESM and CommonJS, TypeScript and JSX transforms, browser and DOM environments, Node tests, aliases, dependency inlining, setup hooks, isolation, pools, timeouts, test discovery, snapshots, coverage, and monorepo boundaries as separate compatibility constraints. Never invent versions, config keys, imports, plugins, providers, paths, regexes, defaults, environment packages, compatibility claims, or passing tests. Project purpose and framework: [details] Sanitized repository tree and test locations: [paste] Package manager, workspace layout, and package boundary: [details] Exact runtime, Vite, Vitest, framework plugin, TypeScript, DOM or browser environment, and coverage-provider versions: [verified versions or unknown] Package module mode and allowed config extensions: [ESM, CommonJS, mixed, unknown] Source syntax and file extensions: [details] Existing Vite, Vitest, framework, compiler, bundler, and type configuration: [paste sanitized content or none] Test types and environments: [unit, integration, DOM, browser, Node, other] Current test matching, exclusions, and ignored outputs: [details] Aliases, package exports, module directories, and resolver behavior: [details] Vite plugins, transforms, and which tool owns each transformation: [details or unknown] Setup files, global hooks, fixtures, mocks, fake timers, and custom environments: [details] Dependencies requiring inline, external, or environment-specific handling: [verified evidence] Isolation, pool, concurrency, timeout, retry, and sequencing requirements: [verified policy or defaults unknown] Snapshot location and update policy: [details] Coverage include, exclude, thresholds, provider, and reporters: [verified policy] Monorepo projects, shared settings, and per-package differences: [details or none] Development, test, watch, coverage, type-check, build, and CI commands: [details] Exact sanitized error, warning, or failing import evidence: [paste] Security and privacy boundary: [no secrets, private registry tokens, proprietary source, customer data, or internal URLs] Validation available: [effective config, discovered tests, focused test, full suite, coverage, build, CI] Output scope: [minimal config, migration, workspace projects, troubleshooting] Provide: 1. An assumptions table marking every version, config owner, plugin, path, environment, transform, alias, setup file, dependency rule, pool setting, pattern, and coverage rule as verified, inferred, or unknown. 2. A recommendation for Vite-embedded test settings, separate Vitest config, project or workspace config, framework adapter, or no custom config, citing the supplied dated official documentation. 3. Complete minimal content for only the required config and setup files, using version-supported imports and keys with placeholders for unresolved values. 4. A configuration-merging map showing which Vite plugins, aliases, define values, environment settings, and build options Vitest inherits or intentionally overrides. 5. A test-discovery and project map covering included tests, ignored outputs, fixtures, generated files, environment groups, and monorepo boundaries. 6. A module, transform, and environment matrix for ESM, CommonJS, TypeScript, JSX, aliases, assets, styles, DOM, browser, Node, and selected dependencies, with one owner per transformation. 7. An execution plan for isolation, pools, concurrency, sequencing, timeouts, retries, fake timers, globals, setup, teardown, and snapshots using only supplied requirements. 8. A coverage plan implementing only the supplied provider, include, exclude, reporter, and threshold policy without hiding untested code. 9. Version-appropriate validation commands for effective config, discovered tests, one representative test per environment, full suite, coverage, type-check, production build, watch behavior, and CI. 10. A final audit for unsupported keys, wrong config ownership, duplicate plugins, module mismatch, broad dependency rules, leaked globals, nondeterminism, hidden coverage gaps, stale snapshots, secret exposure, and claims not backed by output. Do not install packages, overwrite framework-owned configuration, weaken tests or coverage to make a suite pass, expose private source or tokens, or claim success without running the available validation. Ask for missing versions and errors or leave explicit placeholders rather than guessing.
Example Output
Verified Inputs
The supplied package has exact runtime, Vite, and Vitest versions, a confirmed ESM package mode, TypeScript source, one existing Vite plugin, Node unit tests, and a working test command. Browser or DOM tests, coverage provider, path aliases, setup files, dependency inlining, custom pools, snapshots, and monorepo projects remain unverified.
Recommended Shape
Use the smallest config location supported by the supplied versions and repository ownership. Reuse only the verified Vite plugin and resolution behavior, set the confirmed Node environment and test locations, and omit browser settings, DOM packages, globals, setup hooks, dependency rules, pool tuning, retries, and coverage until their need and versions are demonstrated.
Validation Boundary
Inspect the effective config, list discovered tests, run one representative test, run the full suite, type-check, build, then reproduce the same commands in CI. A parsed config does not prove discovery, transform compatibility, isolation, teardown, or coverage.
Tips for Best Results
- ๐กProvide exact runtime, Vite, Vitest, framework-plugin, environment, TypeScript, and coverage-provider versions.
- ๐กShow whether Vitest should inherit the existing Vite plugins and aliases before creating a separate config.
- ๐กValidate effective config, discovery, each environment, full suite, coverage, type-check, build, watch mode, and CI separately.
Frequently Asked Questions
What is the Vitest Config Generator Prompt prompt?
Generate a version-compatible Vitest configuration from supplied Vite, runtime, framework, module, workspace, environment, coverage, and validation facts. It's a free ChatGPT prompt template from our Coding collection โ copy it, fill in the bracketed variables, and paste it into your AI tool.
Which AI tools work with this prompt?
It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.
How do I customize this ChatGPT prompt?
Replace the bracketed variables โ such as [details], [paste], [verified versions or unknown] โ with your own details before running it. Provide exact runtime, Vite, Vitest, framework-plugin, environment, TypeScript, and coverage-provider versions.
Is this prompt free to use?
Yes. Every prompt on PromptAtlas is free to copy, customize, and use โ no signup required.
Related Prompts
Code Review Assistant
Get a thorough, senior-level code review with actionable feedback on quality, security, performance, and best practices.
Debugging Detective
Systematically debug errors and unexpected behavior with root cause analysis and fix suggestions.
Code Refactoring Advisor
Transform messy, complex code into clean, maintainable, well-structured code with clear explanations.