Skip to content

test(graph): expand TS/JS extraction regression fixtures#100

Merged
Yashasvi2229 merged 2 commits into
mex-memory:code-graph-previewfrom
abhinav-phi:test/graph-language-fixtures
Jul 15, 2026
Merged

test(graph): expand TS/JS extraction regression fixtures#100
Yashasvi2229 merged 2 commits into
mex-memory:code-graph-previewfrom
abhinav-phi:test/graph-language-fixtures

Conversation

@abhinav-phi

Copy link
Copy Markdown

What

Expand graph extraction regression coverage for the existing supported languages by adding focused fixtures and semantic regression tests.

Added fixtures:

  • src/graph/__tests__/fixtures/typescript-edge-cases.ts
  • src/graph/__tests__/fixtures/javascript-edge-cases.js
  • src/graph/__tests__/fixtures/tsx-component.tsx
  • src/graph/__tests__/fixtures/jsx-component.jsx

Added regression test:

  • src/graph/__tests__/extraction-regression.test.ts

The new tests validate:

  • Language detection
  • Representative node shapes
  • Qualified names
  • Containment relationships
  • Imports
  • Calls
  • Safe degradation for malformed/ambiguous syntax

No production graph extraction logic was modified.


Why

Closes #97

This improves regression coverage for the four languages already supported by the code graph preview (TypeScript, JavaScript, TSX, and JSX) while keeping the graph contracts unchanged.


Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • CI/Tooling

How to test

  1. Install dependencies.
npm ci
  1. Run type checking.
npm run typecheck
  1. Run the focused regression test.
npx vitest src/graph/__tests__/extraction-regression.test.ts --run

Expected result:

  • All 14 regression tests pass successfully.
  1. Build the project.
npm run build

Checklist

  • Relevant regression tests pass locally (npx vitest src/graph/__tests__/extraction-regression.test.ts --run)
  • No breaking changes
  • Tested locally with a real project

Code-graph preview

  • This PR targets code-graph-preview, not main
  • The linked issue states Target branch: code-graph-preview
  • The change follows the frozen LanguageExtractor / FrameworkResolver interfaces
  • A focused fixture and semantic assertions for the expected node/edge shape are included
  • Any new grammar WASM, extension mapping, extractor, or resolver is registered
  • No graph identity, reconciliation, schema, or drift-semantics changes are included

@abhinav-phi abhinav-phi changed the base branch from main to code-graph-preview July 14, 2026 23:41

@Yashasvi2229 Yashasvi2229 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @abhinav-phi, looks good. Merging into code-graph-preview 👍

@Yashasvi2229 Yashasvi2229 merged commit ba83d03 into mex-memory:code-graph-preview Jul 15, 2026
2 checks passed
@theDakshJaitly

Copy link
Copy Markdown
Collaborator

Thank you for the contribution @abhinav-phi
we recently made a discord server for the repo, feel free to join: discord link

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.

test(graph): expand TS/JS extraction regression fixtures

3 participants