Skip to content

Parse frontend mock.module calls in test planner#6

Merged
zebbern merged 1 commit into
mainfrom
codex/refine-frontend-test-planner
Jun 20, 2026
Merged

Parse frontend mock.module calls in test planner#6
zebbern merged 1 commit into
mainfrom
codex/refine-frontend-test-planner

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace raw-text mock.module detection with a TypeScript AST call-expression check
  • keep direct mock.module test files isolated while ignoring comments and string literals
  • add a regression test for quoted/commented mock.module text

Verification

  • bun --cwd=frontend test src/test/run-tests-plan.test.ts
  • bun --cwd=frontend run test
  • bun run typecheck
  • bun run lint
  • bun run test
  • git push pre-push hook reran typecheck and tests successfully

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 15:18

Copilot AI 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.

Pull request overview

Updates the frontend test planner’s “mock.module usage” detection to use a TypeScript AST traversal instead of raw text matching, so that only real mock.module(...) call expressions cause tests to be isolated (and quoted/commented text no longer triggers isolation).

Changes:

  • Replace regex-based mock.module( detection with a TypeScript AST CallExpression check for mock.module(...).
  • Add a regression test ensuring mock.module inside string literals and comments is ignored.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
frontend/src/test/run-tests-plan.ts Switches usesMockModule() to parse the file with TypeScript and detect actual mock.module(...) calls via AST traversal.
frontend/src/test/run-tests-plan.test.ts Adds a regression test covering commented/quoted mock.module text to prevent false-positive isolation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zebbern zebbern merged commit 442a33a into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/refine-frontend-test-planner branch June 20, 2026 15:22
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.

2 participants