Skip to content

Update dependencies and enhance testing configuration for Vitest#4

Merged
BurnedChris merged 2 commits intomainfrom
vitest-upgrades
Feb 19, 2026
Merged

Update dependencies and enhance testing configuration for Vitest#4
BurnedChris merged 2 commits intomainfrom
vitest-upgrades

Conversation

@BurnedChris
Copy link
Copy Markdown
Contributor

  • Updated bun.lock and package.json to specify exact versions for dependencies, improving stability and compatibility.
  • Added coverage configuration in vitest.config.ts to enable detailed test coverage reporting.
  • Introduced new test scripts in package.json for running coverage checks.
  • Created new documentation files for Vitest skills and references, enhancing the overall testing framework documentation.

- Updated bun.lock and package.json to specify exact versions for dependencies, improving stability and compatibility.
- Added coverage configuration in vitest.config.ts to enable detailed test coverage reporting.
- Introduced new test scripts in package.json for running coverage checks.
- Created new documentation files for Vitest skills and references, enhancing the overall testing framework documentation.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added test coverage reporting capability with V8 provider and a test:coverage npm script.
  • Documentation

    • Comprehensive Vitest skill and reference documentation added (configuration, CLI, APIs, environments, projects, mocking, concurrency, coverage, type testing, and utilities).
  • Tests

    • Expanded test suite with multiple new tests validating generator, workspace, config loading, invocation resolution, template rendering, and utilities.
  • Chores

    • Added coverage configuration and a V8 coverage adapter dependency.

Walkthrough

A Vitest skill and extensive reference documentation were added under .agents/skills/vitest, accompanied by Vitest coverage configuration, a package script and dependency for V8 coverage, multiple new tests for generator/CLI/template behavior, and a small API addition (resolveInvocation now returns originalArgs).

Changes

Cohort / File(s) Summary
Skill metadata & entry
./.agents/skills/vitest/GENERATION.md, ./.agents/skills/vitest/SKILL.md, ./.claude/skills/vitest, ./.cursor/skills/vitest
Adds Vitest skill metadata, overview, and symbolic references linking the skill into the agents directory.
Core references
./.agents/skills/vitest/references/core-config.md, ./.agents/skills/vitest/references/core-cli.md, ./.agents/skills/vitest/references/core-describe.md, ./.agents/skills/vitest/references/core-expect.md, ./.agents/skills/vitest/references/core-hooks.md, ./.agents/skills/vitest/references/core-test-api.md
New comprehensive docs for Vitest core topics: config, CLI, describe/test/expect APIs, and lifecycle hooks.
Feature references
./.agents/skills/vitest/references/features-*.md (mocking, snapshots, coverage, concurrency, filtering, context)
New docs covering mocking, snapshots, coverage, concurrency, filtering, and test context/fixtures.
Advanced references
./.agents/skills/vitest/references/advanced-*.md (environments, projects, type-testing, advanced-vi.md)
New advanced guides: environments, multi-project setups, TypeScript type testing, and Vi utilities.
Vitest config & package
./vitest.config.ts, ./package.json
Enable V8 coverage provider and reporters in Vitest config; add test:coverage script and @vitest/coverage-v8 devDependency.
Tests — generator & workspace
./test/generator-single.test.ts, ./test/generator-workspace.test.ts, ./test/load-global-config.test.ts
New test suites validating README generator behaviors, workspace processing, and global config loading/error cases.
Tests — CLI & template
./test/resolve-invocation.test.ts, ./test/template.test.ts
resolveInvocation return shape extended to include originalArgs; template tests expanded with helper and multiple rendering cases.
Test utilities
./test/utils.ts
Adds writeJson helper to create directories and write prettified JSON files for tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 With twitching whiskers I compile,

docs and tests in a tidy pile.
Coverage climbs, the pipelines hum,
Vitest knowledge hops and drums,
A little rabbit cheers, "Well done!" 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: updating dependencies and enhancing Vitest testing configuration with new tests and documentation.
Description check ✅ Passed The description is relevant to the changeset, covering dependency updates, coverage configuration, test scripts, and documentation additions, all of which are present in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vitest-upgrades

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/resolve-invocation.test.ts (1)

34-38: 🧹 Nitpick | 🔵 Trivial

Consider adding originalArgs assertion for consistency.

Other test cases assert originalArgs, but this one ("routes init subcommand") and the help tests (lines 40-44, 53-57) don't. For consistency and full coverage of the new property, consider adding the assertion here as well.

Suggested addition
 	it("routes init subcommand", () => {
-		const resolved = resolveInvocation(["init", "--force"]);
+		const args = ["init", "--force"];
+		const resolved = resolveInvocation(args);
 		expect(resolved.mode).toBe("init");
 		expect(resolved.commandArgs).toStrictEqual(["--force"]);
+		expect(resolved.originalArgs).toStrictEqual(args);
 	});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/resolve-invocation.test.ts` around lines 34 - 38, The test "routes init
subcommand" is missing an assertion for the new originalArgs property; update
the test invoking resolveInvocation(["init", "--force"]) to also assert that
resolved.originalArgs strictly equals ["init", "--force"] so it matches other
tests that cover originalArgs (same for any similar help tests if present);
locate the assertion block around resolveInvocation in
test/resolve-invocation.test.ts and add the originalArgs expectation alongside
the existing mode and commandArgs checks.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c888a8c and 5eb761b.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • .agents/skills/vitest/GENERATION.md
  • .agents/skills/vitest/SKILL.md
  • .agents/skills/vitest/references/advanced-environments.md
  • .agents/skills/vitest/references/advanced-projects.md
  • .agents/skills/vitest/references/advanced-type-testing.md
  • .agents/skills/vitest/references/advanced-vi.md
  • .agents/skills/vitest/references/core-cli.md
  • .agents/skills/vitest/references/core-config.md
  • .agents/skills/vitest/references/core-describe.md
  • .agents/skills/vitest/references/core-expect.md
  • .agents/skills/vitest/references/core-hooks.md
  • .agents/skills/vitest/references/core-test-api.md
  • .agents/skills/vitest/references/features-concurrency.md
  • .agents/skills/vitest/references/features-context.md
  • .agents/skills/vitest/references/features-coverage.md
  • .agents/skills/vitest/references/features-filtering.md
  • .agents/skills/vitest/references/features-mocking.md
  • .agents/skills/vitest/references/features-snapshots.md
  • .claude/skills/vitest
  • .cursor/skills/vitest
  • package.json
  • test/generator-single.test.ts
  • test/generator-workspace.test.ts
  • test/load-global-config.test.ts
  • test/resolve-invocation.test.ts
  • test/template.test.ts
  • vitest.config.ts
🧰 Additional context used
🧬 Code graph analysis (5)
test/generator-single.test.ts (1)
src/readme-generator/generator.ts (1)
  • generateReadmeFromConfig (79-111)
test/generator-workspace.test.ts (1)
src/readme-generator/generator.ts (2)
  • generateWorkspaceReadmes (191-228)
  • generateReadmeFromConfig (79-111)
test/resolve-invocation.test.ts (1)
src/cli/resolve-invocation.ts (1)
  • resolveInvocation (34-43)
test/load-global-config.test.ts (1)
src/config/load-config.ts (2)
  • loadReadieConfig (114-129)
  • loadGlobalConfig (148-165)
test/template.test.ts (2)
src/config/types.ts (1)
  • ReadieConfig (24-49)
src/readme-generator/template.ts (1)
  • baseReadmeTemplate (254-288)
🪛 LanguageTool
.agents/skills/vitest/references/core-hooks.md

[grammar] ~102-~102: Ensure spelling is correct
Context: ...lly rolled back after test }); ### aroundAll Wrap entire suite: ts import { aroun...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.21.0)
.agents/skills/vitest/references/features-mocking.md

[warning] 99-99: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (32)
.cursor/skills/vitest (1)

1-1: LGTM!

The relative path reference to the Vitest skills directory is correctly structured.

.claude/skills/vitest (1)

1-1: LGTM!

Consistent reference path matching the .cursor/skills/vitest entry.

.agents/skills/vitest/GENERATION.md (1)

1-5: LGTM!

Generation metadata is well-structured with clear provenance tracking.

.agents/skills/vitest/references/features-snapshots.md (1)

1-207: LGTM!

Comprehensive snapshot testing documentation with accurate code examples covering file snapshots, inline snapshots, custom serializers, and concurrent test patterns.

.agents/skills/vitest/references/features-context.md (1)

1-240: LGTM!

Well-structured documentation covering test context and fixtures with clear examples for setup/teardown patterns, scoping, and fixture composition.

test/generator-workspace.test.ts (4)

35-47: LGTM!

Good test coverage for the error path when workspace root doesn't exist. The assertion correctly validates the error message.


49-82: LGTM!

Thorough test covering package filtering behavior with proper validation of updated, unchanged, skipped, and failed arrays. The pre-generation of beta's README to test the "unchanged" path is a good approach.


84-109: LGTM!

Good resilience test validating that workspace generation continues when one project fails. The assertion on result.failed[0]?.projectDir using optional chaining is defensive.


15-24: No action required. The vi object is available globally because Vitest globals are enabled in vitest.config.ts (globals: true) and declared in tsconfig.json ("types": ["vitest/globals"]). The code works as written without an explicit import.

Likely an incorrect or invalid review comment.

.agents/skills/vitest/references/advanced-type-testing.md (1)

1-242: LGTM!

Comprehensive type testing documentation with accurate examples covering expectTypeOf, assertType, branded types, and mixed runtime/type test patterns.

test/load-global-config.test.ts (1)

12-75: LGTM!

Well-structured test suite covering important edge cases:

  • JSON parse errors include file path for debugging
  • Cascading global config discovery works correctly
  • Graceful null return when no config exists
  • Schema validation errors are descriptive

The try/finally cleanup pattern ensures temp directories are removed even on test failures.

test/resolve-invocation.test.ts (1)

40-57: LGTM on the new -h test case.

Good addition to cover the short help flag routing. The test correctly verifies mode, commandArgs, and originalArgs.

test/template.test.ts (4)

4-8: Good use of a typed helper to reduce test boilerplate.

The createConfig helper provides sensible defaults while allowing test-specific overrides, improving readability and type safety across all test cases.


46-59: Test validates important TOC anchor uniqueness behavior.

This test ensures that duplicate section titles (e.g., "Quick Start" appearing in both quickStart and customSections) get unique anchors (#quick-start and #quick-start-1), preventing broken navigation links.


61-81: Good coverage for banner/title interaction.

These two tests correctly verify the mutually exclusive behavior: when a banner contains an <h1>, the markdown title is suppressed to avoid duplicate headings; otherwise, the title is preserved.


83-99: Dash-prefixed usage items are intentionally accepted and stripped during rendering.

The test correctly verifies that the template accepts usage items with optional leading dashes. Line 26 of src/readme-generator/template.ts explicitly strips the "- " prefix: const cleaned = item.startsWith("- ") ? item.slice(2) : item;. This is designed behavior—the template accepts flexible input and normalizes it to numbered steps while preserving fenced code blocks.

.agents/skills/vitest/references/core-hooks.md (1)

1-241: Comprehensive lifecycle hooks documentation.

The document covers all essential hook patterns including the cleanup return pattern, scoped hooks, around hooks, test-specific hooks (onTestFinished, onTestFailed), and concurrent test considerations. The execution order section and key points provide useful summaries.

.agents/skills/vitest/references/features-filtering.md (1)

1-208: Well-organized test filtering reference.

The documentation covers CLI filtering, changed/related file detection, focus/skip modifiers, tag-based filtering, and watch mode interactions comprehensively. The lint-staged integration example (lines 59-66) is particularly useful for CI workflows.

.agents/skills/vitest/SKILL.md (1)

1-53: Clean skill documentation structure.

The SKILL.md provides a clear entry point with key features, and the topic tables effectively organize references into Core, Features, and Advanced categories. The metadata accurately reflects the source and generation context.

.agents/skills/vitest/references/features-coverage.md (1)

1-202: Thorough coverage documentation.

Excellent coverage of V8 vs Istanbul providers, reporter options, threshold configuration, and ignore comment patterns. The @preserve note (line 139) about keeping comments through esbuild is a valuable detail often overlooked.

test/generator-single.test.ts (2)

23-49: Good test fixture patterns with proper cleanup.

The withProject and withTwoProjects wrappers ensure temp directories are cleaned up even on test failure. This pattern prevents test pollution and disk space issues in CI.


97-122: Good output precedence test covering all three resolution paths.

The test validates the precedence order (CLI > config > default) using separate fixtures, ensuring each path is exercised independently.

.agents/skills/vitest/references/features-concurrency.md (1)

1-250: Solid and comprehensive concurrency reference.

No issues found in this documentation addition.

.agents/skills/vitest/references/advanced-environments.md (1)

1-264: Clear and thorough environment reference.

No issues found in this documentation addition.

.agents/skills/vitest/references/advanced-vi.md (1)

1-251: Well-structured vi utilities reference.

No issues found in this documentation addition.

vitest.config.ts (1)

3-23: Coverage configuration looks consistent and complete.

No issues found in this change.

.agents/skills/vitest/references/core-describe.md (1)

1-193: Solid describe API reference.

No issues found in this documentation addition.

.agents/skills/vitest/references/core-cli.md (1)

1-167: Comprehensive CLI reference.

No issues found in this documentation addition.

package.json (1)

61-67: No changes needed. "@vitest/coverage-v8": "^4.0.18" correctly follows the project's established versioning convention. All 19 dependencies and devDependencies consistently use caret ranges (e.g., ^0.5.2, ^2.29.8, ^11.0.4). This entry is not an outlier.

Likely an incorrect or invalid review comment.

.agents/skills/vitest/references/core-config.md (1)

6-172: LGTM — clear, complete config reference.
Well-structured examples and key points; no issues found.

.agents/skills/vitest/references/core-test-api.md (1)

6-233: LGTM — comprehensive and consistent API usage examples.
No correctness or clarity issues found.

.agents/skills/vitest/references/advanced-projects.md (1)

6-296: LGTM — thorough multi-project guidance and examples.
No issues found.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/skills/vitest/references/core-expect.md:
- Around line 190-198: The example calling
expect(...).toThrowErrorMatchingSnapshot() uses invalid arrow-function syntax:
replace the inline throw expression with a block arrow that contains the throw
statement and semicolon (i.e., change expect(() => throw new Error('fail')) to
expect(() => { throw new Error('fail'); }) so the toThrowErrorMatchingSnapshot
assertion is valid); update the example surrounding expect, toMatchSnapshot,
toMatchInlineSnapshot and toMatchFileSnapshot accordingly to keep the snapshot
examples consistent.

In @.agents/skills/vitest/references/core-hooks.md:
- Around line 86-114: The examples use aroundEach and aroundAll (Vitest hooks
introduced in v4.1.0+), which will break docs for Vitest 3.x — either remove
these examples from this core-hooks section or move them into a new "Vitest
4.1.0+ hooks" subsection and add an explicit version note; specifically, locate
the examples that reference aroundEach and aroundAll and either (a) delete them
from this file and add a short pointer like "See 4.1.0+ hooks" or (b) prepend
the examples with a clear "Requires Vitest 4.1.0+" heading/notice and place them
in a separate 4.1.0+ section so older-version readers won't attempt to use these
APIs.

In @.agents/skills/vitest/references/features-coverage.md:
- Around line 168-177: Update the GitHub Actions snippet that uploads coverage
by replacing the outdated action reference "codecov/codecov-action@v3" with the
latest major release "codecov/codecov-action@v5"; locate the "Upload coverage to
Codecov" step (the block containing uses: codecov/codecov-action@v3 and files:
./coverage/lcov.info) and change the action version to `@v5` so the workflow uses
the current recommended release.

In @.agents/skills/vitest/references/features-mocking.md:
- Around line 97-107: Update the fenced code block under the "Manual Mocks
(**mocks**)" section in features-mocking.md to include a language identifier
(use "text") for the directory tree fence; locate the triple-backtick block
showing the src/ __mocks__/ tree and change the opening fence from ``` to
```text so Markdownlint MD040 is satisfied and the tree is treated as plain
text.

In `@test/generator-single.test.ts`:
- Around line 65-80: Add a third invocation to the generator test to verify
idempotency after a config change: after the two existing calls to
generateReadmeFromConfig (using withProject and fixture.configPath), modify the
fixture's config (e.g., update the config file or fixture contents) and call
generateReadmeFromConfig again, then assert that the thirdResult.updated is
truthy; ensure you reference generateReadmeFromConfig and withProject and use
the same fixture.configPath for the modified call so the test confirms updated:
true when the source changes.

In `@test/load-global-config.test.ts`:
- Around line 7-10: Extract the duplicated helper writeJson from
test/load-global-config.test.ts and test/generator-single.test.ts into a shared
test utils module (e.g., test/utils.ts): create the new module containing the
writeJson implementation, update both tests to import writeJson from that module
instead of defining it inline, and remove the duplicate definitions from the two
test files; ensure you import ensureDir and writeFile (and dirname) in the new
module so existing tests continue to work unchanged.

---

Outside diff comments:
In `@test/resolve-invocation.test.ts`:
- Around line 34-38: The test "routes init subcommand" is missing an assertion
for the new originalArgs property; update the test invoking
resolveInvocation(["init", "--force"]) to also assert that resolved.originalArgs
strictly equals ["init", "--force"] so it matches other tests that cover
originalArgs (same for any similar help tests if present); locate the assertion
block around resolveInvocation in test/resolve-invocation.test.ts and add the
originalArgs expectation alongside the existing mode and commandArgs checks.

---

Duplicate comments:
In `@test/generator-single.test.ts`:
- Around line 7-10: The local helper function writeJson in
generator-single.test.ts is duplicated; extract it into a shared test utility
module (e.g., export an async function writeJson(filePath: string, value:
unknown) from a new test utils file) and replace the local definition in
generator-single.test.ts (and the other test that currently defines it) with an
import of that exported writeJson; keep the same function signature and behavior
(ensureDir(dirname(filePath)); writeFile(..., JSON.stringify(value, null, 2),
"utf8")) so existing calls require no changes.

Comment on lines +7 to +10
const writeJson = async (filePath: string, value: unknown) => {
await ensureDir(dirname(filePath));
await writeFile(filePath, JSON.stringify(value, null, 2), "utf8");
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider extracting shared writeJson helper to reduce duplication.

This helper is duplicated in test/generator-single.test.ts (lines 7-10). Consider extracting it to a shared test utilities module.

Example shared utility
// test/utils.ts
import { ensureDir, writeFile } from "fs-extra";
import { dirname } from "pathe";

export const writeJson = async (filePath: string, value: unknown) => {
  await ensureDir(dirname(filePath));
  await writeFile(filePath, JSON.stringify(value, null, 2), "utf8");
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/load-global-config.test.ts` around lines 7 - 10, Extract the duplicated
helper writeJson from test/load-global-config.test.ts and
test/generator-single.test.ts into a shared test utils module (e.g.,
test/utils.ts): create the new module containing the writeJson implementation,
update both tests to import writeJson from that module instead of defining it
inline, and remove the duplicate definitions from the two test files; ensure you
import ensureDir and writeFile (and dirname) in the new module so existing tests
continue to work unchanged.

- Updated core-expect.md to enhance snapshot assertion examples with consistent formatting.
- Expanded core-hooks.md to clarify around hooks usage for Vitest 4.1.0 and above.
- Modified features-coverage.md to update Codecov action version for better compatibility.
- Adjusted features-mocking.md to correct code block formatting.
- Refactored generator-single.test.ts and load-global-config.test.ts to utilize a new writeJson utility function for improved code reuse.
- Enhanced resolve-invocation.test.ts to include original arguments in assertions for better test clarity.
- Introduced a new utils.ts file to centralize JSON writing functionality.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb761b and 53922de.

📒 Files selected for processing (8)
  • .agents/skills/vitest/references/core-expect.md
  • .agents/skills/vitest/references/core-hooks.md
  • .agents/skills/vitest/references/features-coverage.md
  • .agents/skills/vitest/references/features-mocking.md
  • test/generator-single.test.ts
  • test/load-global-config.test.ts
  • test/resolve-invocation.test.ts
  • test/utils.ts
🧰 Additional context used
🧬 Code graph analysis (3)
test/load-global-config.test.ts (2)
src/config/load-config.ts (2)
  • loadReadieConfig (114-129)
  • loadGlobalConfig (148-165)
test/utils.ts (1)
  • writeJson (4-7)
test/resolve-invocation.test.ts (1)
src/cli/resolve-invocation.ts (1)
  • resolveInvocation (34-43)
test/generator-single.test.ts (2)
test/utils.ts (1)
  • writeJson (4-7)
src/readme-generator/generator.ts (1)
  • generateReadmeFromConfig (79-111)
🪛 LanguageTool
.agents/skills/vitest/references/core-hooks.md

[grammar] ~106-~106: Ensure spelling is correct
Context: ...lly rolled back after test }); ### aroundAll Wrap entire suite: ts import { aroun...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (22)
.agents/skills/vitest/references/features-mocking.md (1)

99-107: Previous issue resolved.

The missing language identifier for the fenced code block has been correctly added. The directory tree now uses ````text` as recommended.

.agents/skills/vitest/references/core-hooks.md (5)

1-33: LGTM! Clear documentation of basic lifecycle hooks.

The frontmatter is properly structured, and the basic hooks section provides accurate examples with helpful comments explaining when each hook runs.


34-80: LGTM! Excellent coverage of cleanup patterns and hook scoping.

The cleanup return pattern is clearly demonstrated, the scoped hooks example accurately shows execution order with nested suites, and the timeout configuration is correct.


140-180: LGTM! Test hooks and reusable cleanup pattern are well documented.

The examples correctly show onTestFinished and onTestFailed usage with the test context signature (compatible with Vitest 3.x), and the reusable cleanup pattern demonstrates good testing practices.


182-214: LGTM! Concurrent and extended test hooks are accurately documented.

The concurrent test hooks correctly demonstrate using context-scoped hooks, and the test.extend example properly shows the fixture pattern with type-aware lifecycle hooks.


216-249: LGTM! Hook execution order and key points provide valuable guidance.

The execution order is correctly described with accurate configuration options, and the key points section provides a helpful summary of important behaviors. The source reference to official documentation is a nice touch.

.agents/skills/vitest/references/core-expect.md (1)

6-209: Clear, accurate reference examples throughout.
The examples and guidance read correctly and are consistent with expected Vitest usage.

test/utils.ts (1)

1-7: Nice reusable JSON fixture helper.
Ensures directory creation and consistent JSON output.

.agents/skills/vitest/references/features-coverage.md (1)

6-177: Solid, actionable coverage guidance.
The configuration, scripts, and CI snippet are clear and useful.

test/resolve-invocation.test.ts (1)

3-68: Good coverage of the new originalArgs field.
Assertions now verify the new return shape for all routing paths.

test/generator-single.test.ts (8)

9-18: Fixture setup is clean and configurable.
setupProject creates deterministic inputs with override support.


20-30: Good cleanup discipline for single-project fixtures.
The try/finally removal keeps temp artifacts contained.


32-46: Two-project fixture helper is clear and purpose-built.
Fits the output precedence test well.


48-60: Global-config fixture setup is precise and minimal.
Provides a focused scenario for global-config behavior.


62-85: Nice three-step update/unchanged/updated coverage.
This test exercises the idempotency behavior well.


88-101: Dry-run behavior is asserted correctly.
Confirms update reporting without writing output.


103-128: Output precedence is clearly validated.
Covers CLI override, config output, and default path resolution.


130-145: Good coverage of useGlobalConfig: false.
The content checks make the behavior explicit.

test/load-global-config.test.ts (4)

9-22: Clear parse-error assertion with path context.
Good validation of error messaging.


24-43: Nearest-ancestor resolution is well exercised.
Confirms traversal picks the closest global config.


45-55: Null-return case is covered cleanly.
Ensures graceful behavior when no global config exists.


57-72: Schema validation error is asserted correctly.
The test captures both failure and path context.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/skills/vitest/references/core-hooks.md:
- Around line 82-138: The docs describe Vitest hooks aroundEach and aroundAll
which require Vitest 4.1.0+, but package.json currently pins vitest to ^4.0.18;
either update the dependency constraint to ^4.1.0 (or newer) so the documented
APIs (aroundEach, aroundAll) are actually available, or remove/relocate the
"Vitest 4.1.0+ Around Hooks" section (and any examples referencing
aroundEach/aroundAll) until the project dependency is bumped; update the
package.json vitest version or the docs accordingly and ensure examples
referencing aroundEach and aroundAll match the declared dependency.

Comment on lines +82 to +138
## Vitest 4.1.0+ Around Hooks

Requires Vitest 4.1.0 or newer. If you're on Vitest 3.x, skip this section.

### aroundEach

Wrap tests with setup/teardown context:

```ts
import { aroundEach, test } from "vitest";

// Wrap each test in database transaction
aroundEach(async (runTest) => {
await db.beginTransaction();
await runTest(); // Must be called!
await db.rollback();
});

test("insert user", async () => {
await db.insert({ name: "Alice" });
// Automatically rolled back after test
});
```

### aroundAll

Wrap entire suite:

```ts
import { aroundAll } from "vitest";

aroundAll(async (runSuite) => {
console.log("before all tests");
await runSuite(); // Must be called!
console.log("after all tests");
});
```

### Multiple aroundEach Hooks

Nested like onion layers:

```ts
aroundEach(async (runTest) => {
console.log("outer before");
await runTest();
console.log("outer after");
});

aroundEach(async (runTest) => {
console.log("inner before");
await runTest();
console.log("inner after");
});

// Order: outer before → inner before → test → inner after → outer after
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the Vitest version specified in package.json

if [ -f package.json ]; then
    echo "Checking Vitest version in package.json..."
    cat package.json | jq -r '.dependencies.vitest // .devDependencies.vitest // "not found"'
    
    echo -e "\nFull dependencies and devDependencies with vitest:"
    cat package.json | jq '{dependencies: .dependencies.vitest, devDependencies: .devDependencies.vitest}'
else
    echo "package.json not found in root directory"
fi

Repository: consentdotio/readie

Length of output: 224


Update Vitest dependency to 4.1.0+ or remove the documented hooks.

The project's package.json specifies Vitest ^4.0.18, which does not include the aroundEach and aroundAll hooks documented in lines 82-138. These features require Vitest 4.1.0 or newer. The version warning (line 84) helps users understand the requirement, but it doesn't resolve the mismatch between documented APIs and the project's declared dependency. Either update the Vitest version constraint to ^4.1.0 or relocate this section until the project upgrades.

🧰 Tools
🪛 LanguageTool

[grammar] ~106-~106: Ensure spelling is correct
Context: ...lly rolled back after test }); ### aroundAll Wrap entire suite: ts import { aroun...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/vitest/references/core-hooks.md around lines 82 - 138, The
docs describe Vitest hooks aroundEach and aroundAll which require Vitest 4.1.0+,
but package.json currently pins vitest to ^4.0.18; either update the dependency
constraint to ^4.1.0 (or newer) so the documented APIs (aroundEach, aroundAll)
are actually available, or remove/relocate the "Vitest 4.1.0+ Around Hooks"
section (and any examples referencing aroundEach/aroundAll) until the project
dependency is bumped; update the package.json vitest version or the docs
accordingly and ensure examples referencing aroundEach and aroundAll match the
declared dependency.

@BurnedChris BurnedChris merged commit 26eccdd into main Feb 19, 2026
2 checks passed
@BurnedChris BurnedChris deleted the vitest-upgrades branch February 19, 2026 23:08
@coderabbitai coderabbitai bot mentioned this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant