Skip to content

Conversation

@eluce2
Copy link
Collaborator

@eluce2 eluce2 commented Jan 12, 2026

test(better-auth): add mock infrastructure for unit tests

  • Move E2E tests (adapter.test.ts, migrate.test.ts) to tests/e2e/
  • Create mock fetch utilities and OData response fixtures
  • Add unit tests for adapter operations using mocked responses
  • Update vitest.config.ts to exclude E2E tests
  • Add test:e2e script for running E2E tests separately

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

test(typegen): add mock infrastructure for unit tests (#103)

Summary

  • Create layout metadata fixtures (tests/fixtures/layout-metadata.ts)
  • Add mock fetch utility for mocking FM Data API calls (tests/utils/mock-fetch.ts)
  • Move E2E tests requiring live FM server to tests/e2e/
  • Create unit tests that use mocked metadata (11 tests)
  • Update vitest.config.ts to exclude e2e tests by default
  • Add test:e2e script for running E2E tests with doppler

Test plan

  • pnpm --filter @proofkit/typegen lint passes
  • pnpm --filter @proofkit/typegen typecheck passes
  • pnpm --filter @proofkit/typegen test passes (11 unit tests)

🤖 Generated with Claude Code


Note

Establishes isolated unit testing with mocks and separates E2E runs across the repo.

  • Better Auth: Add mock OData responses and mock-fetch utils; create comprehensive adapter unit tests; move adapter/migrate E2E to tests/e2e; add test:e2e script; update vitest.config.ts to exclude E2E; small refactor in migrate.ts for safer type normalization and explicit FM type mapping
  • Typegen: Add layout metadata fixtures and mock fetch utils; create unit tests using mocked metadata; move live E2E to tests/e2e; add test:e2e script; update vitest.config.ts to exclude E2E
  • Fmodata: Relocate E2E tests to tests/e2e; update test:e2e to run folder
  • CLI: Simplify test script to vitest run; update vitest config to exclude E2E-like test
  • Repo scripts: Tweak scripts/ralph-once.sh workflow command

Written by Cursor Bugbot for commit 67a2fec. This will update automatically on new commits. Configure here.

test(fmodata): move E2E tests to tests/e2e folder

Move e2e.test.ts and schema-manager.test.ts to tests/e2e/ so they're excluded from default test runs. Update test:e2e script to run entire e2e folder.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
proofkit-docs Ready Ready Preview Jan 12, 2026 6:59pm

Copy link
Collaborator Author

eluce2 commented Jan 12, 2026

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 12, 2026

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/better-auth@104

@proofkit/cli

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/cli@104

create-proofkit

pnpm add https://pkg.pr.new/proofgeist/proofkit/create-proofkit@104

@proofkit/fmdapi

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/fmdapi@104

@proofkit/fmodata

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/fmodata@104

@proofkit/typegen

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/typegen@104

@proofkit/webviewer

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/webviewer@104

commit: 4517af6

Copy link
Collaborator Author

eluce2 commented Jan 12, 2026

Merge activity

  • Jan 12, 6:56 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 12, 7:00 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 12, 7:00 PM UTC: @eluce2 merged this pull request with Graphite.

@eluce2 eluce2 changed the base branch from 01-12-test_fmdapi_add_mock_infrastructure_for_unit_tests to graphite-base/104 January 12, 2026 18:57
@eluce2 eluce2 changed the base branch from graphite-base/104 to main January 12, 2026 18:59
eluce2 and others added 5 commits January 12, 2026 18:59
- Move E2E tests (adapter.test.ts, migrate.test.ts) to tests/e2e/
- Create mock fetch utilities and OData response fixtures
- Add unit tests for adapter operations using mocked responses
- Update vitest.config.ts to exclude E2E tests
- Add test:e2e script for running E2E tests separately

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
## Summary
- Create layout metadata fixtures (`tests/fixtures/layout-metadata.ts`)
- Add mock fetch utility for mocking FM Data API calls (`tests/utils/mock-fetch.ts`)
- Move E2E tests requiring live FM server to `tests/e2e/`
- Create unit tests that use mocked metadata (11 tests)
- Update `vitest.config.ts` to exclude e2e tests by default
- Add `test:e2e` script for running E2E tests with doppler

## Test plan
- [x] `pnpm --filter @proofkit/typegen lint` passes
- [x] `pnpm --filter @proofkit/typegen typecheck` passes
- [x] `pnpm --filter @proofkit/typegen test` passes (11 unit tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Modernizes testing and docs across packages, separating fast unit tests from live E2E runs and adding reusable CLI/docs components.
> 
> - Testing: Add mock fetch utilities and recorded fixtures for `@proofkit/better-auth` and `@proofkit/fmdapi`; create layout metadata fixtures and unit tests in `@proofkit/typegen`; move live tests to `tests/e2e`; update `vitest.config.ts` to exclude E2E by default; add `test:e2e` scripts and Turbo pipeline
> - CI: Simplify `continuous-release.yml` test job to run unit tests only (remove Doppler/OIDC/E2E); keep build after tests
> - Tooling: Add `scripts/capture-responses.ts` to record FM API responses for mocks; add `vitest.config.ts` per package with E2E exclusion
> - Docs/UI: Introduce `PackageInstall` component and enhance `CliCommand` (new `packageName` prop); update MDX guides to use these components and stable package refs
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3e25bc9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Move e2e.test.ts and schema-manager.test.ts to tests/e2e/ so they're excluded from default test runs. Update test:e2e script to run entire e2e folder.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… logic

- Enhanced `normalizeBetterAuthFieldType` function for clearer type handling.
- Updated `planMigration` function to use a more structured approach for determining field types.
- Adjusted comments for better clarity on type normalization logic.
- cli: remove doppler wrapper, exclude E2E test requiring credentials
- fmodata: remove doppler wrapper (E2E tests already excluded)
- better-auth: fix import paths in e2e test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@eluce2 eluce2 force-pushed the 01-12-test_better-auth_add_mock_infrastructure_for_unit_tests branch from 4517af6 to 67a2fec Compare January 12, 2026 18:59
@eluce2 eluce2 merged commit aadb70b into main Jan 12, 2026
10 checks 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.

2 participants