Skip to content

Port console checks and CI reporting to Vitest - #80865

Closed
ciampo wants to merge 1 commit into
codex/vitest-03-shared-environmentfrom
codex/vitest-04-console-reporting
Closed

ciampo wants to merge 1 commit into
codex/vitest-03-shared-environmentfrom
codex/vitest-04-console-reporting

Conversation

@ciampo

@ciampo ciampo commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What?

Part of #80855. Stacked on #80864; review only the fourth commit in this PR.

TL;DR — console and reporting parity: Adds private Vitest console matchers with lifecycle enforcement and configures GitHub annotations independently from the WordPress-only Flakiness.io reporter.

Why?

The remaining tests rely on unexpected console calls failing the test and on explicit assertions for intentional logging. CI also needs source-linked GitHub annotations while preserving the existing Flakiness.io project identity.

How?

  • Ports toHaveErrored, toHaveInformed, toHaveLogged, toHaveWarned, and their *With variants using Vitest's public expect.extend and matcher context APIs.
  • Resets and validates console spies around each test and suppresses collapsed console groups so they do not become unexpected log calls.
  • Adds compatibility coverage for all matcher forms, failure messages, assertion tracking, and collapsed groups.
  • Enables the built-in github-actions reporter whenever the run is in GitHub Actions.
  • Keeps @flakiness/vitest limited to official WordPress/gutenberg CI with the existing project and duplicate naming.

The Jest console package remains active for the Jest partition. No baseline test changes runner, and no snapshots changed.

Testing Instructions

  1. Run npm run test:unit:routing; expect 995 Jest baseline files, 1 Vitest baseline file, and 2 added Vitest compatibility files.
  2. Run npm run test:unit:vitest; expect 3 files and 27 tests to pass.
  3. Run all four Vitest CI shards with --passWithNoTests and confirm every populated shard passes.
  4. Inspect a GitHub Actions run and confirm failures would use the built-in annotation reporter while Flakiness.io remains scoped to the official repository.

Locally verified routing, the complete migrated Vitest partition, all four Vitest shards, strict ESLint, formatting, and pre-commit checks. The remaining Jest partition is unchanged and covered by stacked CI.

Testing Instructions for Keyboard

Not applicable; this PR does not change UI behavior.

Screenshots or screencast

Not applicable.

Use of AI Tools

Codex was used to inspect the existing Jest console behavior, verify current Vitest matcher/reporter APIs, implement the compatibility layer, and run the reported checks. The resulting changes and claims were reviewed against the repository configuration.

@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.76 MB

compressed-size-action

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