Skip to content

test: exercise async-data diagnostics and trim duplicate checks - #309

Merged
vite-hub[bot] merged 1 commit into
mainfrom
test/smart-test-audit
Nov 1, 2026
Merged

vite-hub[bot] merged 1 commit into
mainfrom
test/smart-test-audit

Conversation

@onmax

@onmax onmax commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Several assertions stopped before exercising Doctor: the OXC "parses scripts" test only queried a dependency capability, and an async-data probe only checked whether create() returned a visitor. This change removes the capability probe, consolidates repeated CLI/docs proof, and makes the existing six async-data smoke cases check actual diagnostics for ordinary and Unicode-escaped calls.

  • tests/core/script-parse.test.ts: remove parses scripts with raw transfer where the runtime supports it. It never called Doctor and required host support even though Doctor supports a JSON fallback. The four remaining tests own AST fields, node stability, transfer parity, and parse errors through Doctor's parser.
  • tests/vite/cli.test.ts: consolidate two repeated catalog invocations into the Vite-fixture catalog test. It now checks the specific Vite Rule's public package version, successful exit, and exclusion of Nuxt metadata, using the existing stdout helper.
  • docs/rules/strict-only-rules.test.ts: merge the three exact command examples into the per-framework table that checks every Strict Preset member. Keep all exact example commands and assert each example remains in the Strict Preset so its assertion cannot silently stop running.
  • tests/rule-packs/nuxt/nuxt-modern-rules-1.test.ts: reuse the six existing positive fixtures in test.each, asserting the exact diagnostic Rule and both file names. Remove 12 visitor-presence assertions; none dispatched a visitor, and the shared input could not trigger five of the six Rules. Retain the negative fast-path checks, which guard the performance regression from perf(nuxt,vue): skip files that cannot match in hot async-data and listener Rules #213, and existing alias/line-continuation cases.

Mutation control: temporarily returning null from getAsyncDataCall() left the original probe green, 1 passed. The repaired six cases all failed at the missing-diagnostic assertion under the same mutation. Production was restored byte for byte before normal validation.

Baseline is 593f9aed8787e75d0148e637cb409774dd4281ea on main. These measurements cover the four affected files:

Measure Before After
Passing tests 232 228
Sum of Vitest durations 26.35 s 11.99 s
Test LOC 3,805 3,771

Timings include startup and transforms, exclude the heavy queue, and are single runs on shared Slimbook with colder caches before. Repository-wide test LOC is 60,681 → 60,647. Production LOC remains 66,987; test support/fixture LOC remains 543. No production seams, fixtures, or dependencies became unused.

Final pnpm ready passed: 8,369 tests in 208 files, Vitest duration 89.11 s, plus formatting, build, lint, and type checking. Validated on Node 24.21.0 and pnpm 11.20.0.

Commands run:

HEAVY_WAIT=0 heavy pnpm install --frozen-lockfile

# Run once before and once after, for each file listed below.
HEAVY_WAIT=0 heavy --light pnpm test --run "$test_file" --maxWorkers=1 \
  --reporter=verbose --reporter=json --outputFile.json="$report"
# tests/core/script-parse.test.ts
# tests/vite/cli.test.ts
# docs/rules/strict-only-rules.test.ts
# tests/rule-packs/nuxt/nuxt-modern-rules-1.test.ts

# Deliberate mutation controls, restored afterward.
HEAVY_WAIT=0 heavy --light pnpm test --run tests/rule-packs/nuxt/nuxt-modern-rules-1.test.ts \
  --maxWorkers=1 --reporter=verbose \
  --testNamePattern='async data rules skip files that cannot call async data'
HEAVY_WAIT=0 heavy --light pnpm test --run tests/rule-packs/nuxt/nuxt-modern-rules-1.test.ts \
  --maxWorkers=1 --reporter=verbose \
  --testNamePattern='reports literal and escaped async-data calls'

HEAVY_WAIT=0 heavy --light pnpm exec vp fmt docs/rules/strict-only-rules.test.ts \
  tests/core/script-parse.test.ts tests/rule-packs/nuxt/nuxt-modern-rules-1.test.ts tests/vite/cli.test.ts
HEAVY_WAIT=0 heavy --light pnpm exec vp lint docs/rules/strict-only-rules.test.ts \
  tests/core/script-parse.test.ts tests/rule-packs/nuxt/nuxt-modern-rules-1.test.ts tests/vite/cli.test.ts
HEAVY_WAIT=0 heavy pnpm ready --run --maxWorkers=1 --no-file-parallelism \
  --reporter=verbose --reporter=json --outputFile.json=artifacts/test-audit/full-after.json
git diff --check

pnpm ready formats, builds, lints with typeAware and typeCheck enabled in vite.config.ts, and runs the full suite. OpenClaw-specific deadcode/check-changed commands do not exist in this repository.

Kept the Nuxt fixture integration tests: setup() is correctly registered at describe scope. Also retained the security override checks, parser/platform contracts, typed public APIs, Vue runtime examples, and parse-count/scaling guards. Their distinct contracts or historical regressions did not justify deletion.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T10:22:28.233891Z a278093 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vite-hub

vite-hub Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Waiting 2026-11-01T10:27:28.227Z 11m 6s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Waiting for GitHub merge request ba409aad-771d-4c3d-9bc4-a5ea14d03123.

View session

Ready: expected HEAD verified, all supplied checks passed, and no actionable review findings remain. Focused pnpm tests passed all 228 tests across the four changed files; focused vp lint and git diff --check passed. Validation used --config.verify-deps-before-run=false to avoid pnpm’s automatic-reinstall error. The worktree is clean; no repair commit was needed.

Session

Waiting for review checks before the next pass.

Session

Waiting for review checks before the next pass.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes across the four test suites, including whether the consolidated assertions preserve the independent parser, catalog, documentation, and Nuxt async-data contracts.

  • Async-data diagnostics — replaces visitor-presence probes with end-to-end Diagnostic assertions for six Rules, covering both literal and Unicode-escaped composable calls.
  • Vite catalog coverage — consolidates duplicate CLI invocations while retaining exit status, Vite Rule presence, public package version, and Nuxt metadata exclusion.
  • Strict command coverage — combines exact command examples with complete Strict Preset membership checks for TypeScript, Vite, and Vue.
  • Parser capability probe — removes a host-level raw-transfer assertion while retaining Doctor-level AST, stability, parity, and parse-error coverage.

Focused verification passed: 228 tests across all four changed files.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm dlx https://pkg.pr.new/vite-doctor@309

commit: a278093

@vite-hub
vite-hub Bot merged commit eecf4df into main Nov 1, 2026
20 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 1, 2026
@onmax
onmax deleted the test/smart-test-audit branch November 1, 2026 11:04
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