In 2026, Atlas empowers Qwik developers to efficiently add unit tests to untested modules by leveraging existing repository conventions, ensuring new tests integrate direct with your `vitest` setup, managed by `pnpm`, and formatted with `prettier`.
How Atlas finds untested Qwik code and existing test patterns
Atlas begins by understanding your Qwik project's structure and existing test conventions, a crucial first step in 2026. It uses the `read` tool to ingest the target module and `lsp` to enumerate its exported symbols, ensuring no public function is missed.
To add unit tests for an untested Qwik module, Atlas first needs to identify what needs testing and how existing tests are structured. Atlas uses the `read` tool to load the content of your Qwik component or module, such as `src/components/MyComponent.tsx`. Following this, the `lsp` tool's `documentSymbol` operation is employed to list all exported symbols, ensuring that every public function, `component$`, `useSignal`, `useStore` state, or `routeLoader$` export is considered for testing. To match your repository's existing style, Atlas then uses the `grep` tool to search for an existing `vitest` file. This step is vital for copying the repo's framework, import style, and naming convention, ensuring that any new `vitest` spec file Atlas generates will direct integrate with your current Qwik testing practices.
Writing Qwik unit tests with Atlas and `vitest`
Once Atlas understands the module and conventions, it drafts the new `vitest` spec file, a process that takes mere moments in 2026. The `write` tool is used to generate the test code, which is specifically tailored for Qwik's unique characteristics.
After gathering context on the Qwik module and existing test patterns, Atlas proceeds to write the new unit test file. The `write` tool is central to this process, creating a new `vitest` spec file, for example, `src/components/MyComponent.test.tsx`. Atlas ensures the generated tests adhere to the conventions discovered via `grep`, including the correct `import { test } from 'vitest'` syntax and file naming. For Qwik-specific elements like `component$`, `useSignal`, `useStore` state, and `routeLoader$` exports, Atlas generates appropriate test cases. It can even add a `routeAction$` with `zod$` validation and cover it with `vitest` tests. Before any changes are committed to disk, Atlas presents a unified diff for your review and approval, ensuring transparency and control over the generated Qwik test code.
Running and iterating on Qwik tests with Atlas and `pnpm`
Running the newly drafted Qwik tests is the critical next step, confirming their functionality. Atlas uses the `bash` tool to execute your `vitest` suite via `pnpm`, providing immediate feedback on test outcomes, even if output exceeds 2000 lines.
A test that is never executed is not a test. Atlas emphasizes running the generated `vitest` suite immediately to validate its correctness. The `bash` tool is used to execute the tests, typically with a command like `pnpm test src/components/MyComponent.test.tsx`. Atlas captures the output from `vitest` and displays it in your terminal. If the output from `vitest` exceeds 2000 lines or 50 KB, Atlas truncates it for readability in the terminal but saves the full log to a file, which you can then review for comprehensive failure details. If tests fail, Atlas facilitates an iterative process: you can use the `edit` tool to modify the test file directly, making adjustments until the entire `vitest` suite passes. For larger modules or complex test suites, the `todowrite` tool helps manage progress by keeping a list of remaining tasks.
Reviewing and approving Qwik code changes with Atlas
Atlas prioritizes developer control and safety throughout the testing workflow in 2026. Every proposed change to your Qwik codebase, from new `vitest` files to formatting with `prettier`, is presented for explicit approval.
Before Atlas writes any changes to your Qwik project, it ensures you have full visibility and control. Atlas computes a unified diff for every file edit, surfacing it for your approval. This applies to new `vitest` spec files, modifications to existing Qwik components, or even running `prettier` over touched components to maintain code style. Every Atlas tool call, including `write` and `bash`, is permission-gated against allow, ask, and deny rules. Atlas drafts a plan in a read-only plan agent and asks for your confirmation before switching to a build agent to execute changes. This multi-stage approval process, combined with Atlas's ability to read `git` branches, status, and diffs, and to stage and create commits on your behalf, ensures that all changes to your Qwik codebase are intentional and thoroughly reviewed.
Step by step
- 01Run `atlas read src/components/MyQwikComponent.tsx` to ingest the target Qwik module's content.
- 02Execute `atlas lsp documentSymbol src/components/MyQwikComponent.tsx` to enumerate all exported symbols for testing.
- 03Use `atlas grep "import { test } from 'vitest'" src/` to find existing `vitest` test files and understand your Qwik project's conventions.
- 04Draft the new `vitest` spec file with `atlas write src/components/MyQwikComponent.test.tsx`, reviewing and approving the generated diff.
- 05Run the new Qwik unit tests using `atlas bash "pnpm test src/components/MyQwikComponent.test.tsx"` to get immediate feedback.
- 06If tests fail, use `atlas edit src/components/MyQwikComponent.test.tsx` to iteratively fix the `vitest` code until all checks pass.
- 07Ensure consistent formatting by running `atlas bash "pnpm prettier --write src/components/MyQwikComponent.test.tsx"` over the new test file.
- 08Stage and commit the changes with `atlas commit -m "feat: Add unit tests for MyQwikComponent"`.
Frequently asked questions
- How does Atlas ensure Qwik test conventions are followed?
- Atlas uses the `grep` tool to search your existing Qwik codebase for `vitest` files, identifying your project's specific import styles, naming conventions, and testing patterns before writing new tests.
- Can Atlas test Qwik components with `useSignal` or `routeLoader$`?
- Yes, Atlas is designed to read Qwik's `component$` definitions, `useSignal` and `useStore` state, and `routeLoader$` exports under `src/routes`, allowing it to generate relevant `vitest` tests for these Qwik-specific constructs.
- What happens if Atlas generates a failing Qwik test?
- Atlas runs the `vitest` suite using the `bash` tool. If tests fail, it presents the output, allowing you to use `atlas edit` to refine the test code iteratively until all `vitest` checks pass.
- How does Atlas handle large Qwik test outputs from `vitest`?
- When `vitest` output exceeds 2000 lines or 50 KB, Atlas truncates it in the terminal but saves the full log to a file. This ensures you can review comprehensive failure details for your Qwik tests.
- Is Atlas compatible with my existing Qwik `vite.config.ts` setup?
- Yes, Atlas operates within projects that have a `vite.config.ts` loading the `qwikCity` plugin. It understands your Qwik project's structure and configuration to provide relevant assistance.
- How does Atlas ensure I approve changes to my Qwik codebase?
- Every Atlas tool call is permission-gated. Before writing any changes to your Qwik files, Atlas computes and surfaces a unified diff for your approval, ensuring you have full control over modifications.
- Can Atlas help with `routeAction$` validation in Qwik?
- Yes, Atlas can add a `routeAction$` with `zod$` validation and then cover it with `vitest` tests, ensuring your Qwik server functions are robustly tested.
- How does Atlas integrate with `prettier` for Qwik code?
- After generating or modifying Qwik test files, Atlas can run `prettier` over the touched components using the `bash` tool, ensuring your new `vitest` specs adhere to your project's formatting standards.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Write Unit Tests for Untested Code with Atlas in 2026
How to write unit tests for untested code with Atlas in 2026: the lsp tool enumerates exported symbols, grep copies repo conventions, and bash actually runs the suite.
Extract a Shared Helper from Duplicated Qwik Code with Atlas in 2026
In 2026, Qwik developers use Atlas to efficiently refactor duplicated logic into shared helpers. Leverage semantic search, automated refactoring, and vitest integration for robust code quality and maintainability.
Onboard to an Unfamiliar Qwik Codebase with Atlas in 2026
Quickly build a mental model of any Qwik repository in 2026 using Atlas. Leverage semantic search, explore component$ definitions, and understand $ boundaries without reading every file.
Debug a single failing test in Qwik with Atlas in 2026
Pinpoint and fix a single failing test in your Qwik application using Atlas. Leverage `vitest`, `pnpm`, and Atlas's AI-powered tools for efficient debugging.
Self-review your working diff before committing in Qwik with Atlas in 2026
Catch your own mistakes in Qwik projects before they reach review or CI. Atlas helps Qwik developers in 2026 self-review uncommitted diffs, integrating vitest, prettier, and pnpm for a robust workflow.
Refactor a legacy module in Qwik with Atlas in 2026
Streamline your Qwik codebase in 2026 by refactoring legacy modules with Atlas. Ensure zero regressions using vitest, pnpm, and Atlas's precise code modifications.
Automate GitHub Issue and Pull Request Triage in Qwik with Atlas in 2026
Automate GitHub issue and pull request triage in your Qwik projects with Atlas. Leverage Atlas's AI agent to respond to events, ensuring safety and trusted user access in 2026.
Trace a runtime bug from a stack trace in Qwik with Atlas in 2026
Pinpoint Qwik runtime bugs from production stack traces using Atlas, the terminal-native AI coding agent. Leverage Qwik's resumability and toolchain like pnpm and vitest.