Skip to content

analysis(typescript): discover active Jest/Vitest modifiers and parameterized suites #3500

Closed

Description

@EffortlessSteven

Problem

The TypeScript preview adapter parses test files before relation and oracle analysis, but crates/ripr/src/analysis/language/typescript/tests_extract.rs currently recognizes only:

test("name", callback)
it("name", callback)
test.each(table)("name", callback)
it.each(table)("name", callback)
describe("name", callback)

Common active Jest/Vitest declarations such as test.only(...), it.concurrent(...), test.sequential(...), describe.only(...), and array-form describe.each(table)(...) are therefore absent from TypeScriptTest discovery. A real test using one of those wrappers disappears before owner-relation or oracle classification can run, producing falsely weak or missing preview evidence.

This must not be fixed by accepting every member chain. Disabled or non-ordinary declarations such as test.skip, describe.skip, test.todo, conditional wrappers, and expected-failure wrappers do not establish an ordinary executable related-test path and must remain uncredited. Conversely, active modifier chains must not be rejected merely because a modifier repeats or active execution flags combine: chainable test APIs may accumulate those properties, and extraction does not own runner-specific precedence.

Current authority

  • extract_tests parses a test file and feeds discovered TypeScriptTest values into the workspace-wide related-test index.
  • describe_body_from_statement accepts only a bare describe identifier.
  • test_callee_is_identifier accepts only bare test / it identifiers.
  • test_callee_is_each accepts only bare test.each / it.each array-call forms.
  • related_test_candidates and owner_call_relation consume only tests that survived that extraction boundary.

Required outcome

Recognize a bounded active declaration grammar:

base = test | it | describe
active_modifier = only | concurrent | sequential
active_base = base | active_base.active_modifier
active_each = active_base.each(table)

Use the same grammar for test calls and suite recursion, while retaining the existing callback, assertion, import, mock, and qualified-name extraction. The bounded property vocabulary is the fail-closed boundary; repeated active properties and active-property combinations remain discoverable because extraction does not evaluate their runner-specific precedence.

Acceptance

  • test.only(...), it.concurrent(...), and test.sequential(...) are extracted with their current body and assertion evidence.
  • describe.only(...), describe.concurrent(...), and describe.sequential(...) recurse into nested tests and retain qualified suite names.
  • array-form describe.each(table)(...) recurses into nested tests.
  • active modifier-before-.each forms such as test.only.each(table)(...) and describe.concurrent.each(table)(...) are recognized.
  • active modifiers may combine in either order, repeat, or coexist without extraction inventing runner-precedence semantics.
  • test.skip, describe.skip, test.todo, conditional wrappers, expected-failure wrappers, unknown roots, and unknown modifiers remain absent.
  • an extracted active test still reaches the production related-test relation path; syntax recognition alone does not upgrade relation or oracle strength.
  • existing bare and array-form .each extraction remains unchanged.

Proof

cargo test -p ripr analysis::language::typescript::tests_extract_tests -- --test-threads=1
cargo test -p ripr analysis::language::typescript -- --test-threads=1
cargo xtask check-static-language
cargo xtask check-evidence-promotion-honesty
cargo xtask goldens check
git diff --check

Negative evidence

All-state PR search for describe.each, test.only, Vitest modifiers, and Jest modifiers found only the historical TypeScript decomposition PR #1151 and no implementation of this claim. Exact issue search returned no matching issue.

Non-goals

  • tagged-template .each tables;
  • imported or renamed test API aliases;
  • runtime test execution or proof that a focused/skipped declaration ran;
  • runner-specific precedence among accumulated active flags;
  • changes to relation scoring, oracle strength, actionability, output schemas, support tiers, or default gates;
  • broad Jest/Vitest API coverage.

Claim boundary

Completion prevents active, statically explicit Jest/Vitest declarations from disappearing at the TypeScript extraction boundary. It does not establish runtime execution, coverage, mutation adequacy, runner-precedence semantics, or stronger evidence than the existing relation and oracle producers earn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions