Skip to content

test: add parser-safe validation for mock API modules - #399

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
Divine-mercyx:refactor/mock-api-parser-validation-386
Aug 21, 2026
Merged

test: add parser-safe validation for mock API modules#399
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
Divine-mercyx:refactor/mock-api-parser-validation-386

Conversation

@Divine-mercyx

Copy link
Copy Markdown

Summary

  • Register mock API domains as independently parseable modules with a stable export contract.
  • Add focused node:test checks that parse each domain in isolation, so a syntax error in one domain stays scoped to that file.
  • Keep public MockAccessApi methods and aggregator re-exports stable for existing consumers (lib/api/index.ts, components/nav.tsx).

Type of Change

  • Bug fix
  • New feature
  • Tech-debt / structure
  • CI/CD

Changes Made

  • Added lib/api/mock/domains.ts as the canonical domain/export registry.
  • Added test/mock-api-structure.test.ts using TypeScript syntactic diagnostics with noResolve (parser-safe, no typecheck of imports).
  • Included lib/api/mock/**/*.ts in the existing test tsconfig so domain modules participate in the current test pipeline.
  • No GitHub Actions or CI workflow changes.

Acceptance Criteria

  • Mock API domains have clearly defined module boundaries.
  • A syntax error in one domain is reported against that file only and does not require editing a 2,000+ line monolith.
  • Public mock API exports remain stable for existing consumers.
  • Focused automated verification uses the repository's existing node:test + test/tsconfig.json conventions.
  • No GitHub Actions or CI/CD changes.

Test Coverage

  • npx tsc -p test/tsconfig.json --skipLibCheck
  • node --test test-dist/test/mock-api-structure.test.js

Closes #386

Made with Cursor

Keep domain boundaries explicit and verify each mock module parses in isolation so a syntax error in one domain cannot hide behind a monolithic aggregator.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Lakes41
Lakes41 merged commit 0b18aaf into Adamantine-guild:main Aug 21, 2026
1 check passed
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.

Add parser-safe validation for mock API module structure

2 participants