-
Notifications
You must be signed in to change notification settings - Fork 1
test(better-auth): add mock infrastructure for unit tests #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eluce2
merged 5 commits into
main
from
01-12-test_better-auth_add_mock_infrastructure_for_unit_tests
Jan 12, 2026
Merged
test(better-auth): add mock infrastructure for unit tests #104
eluce2
merged 5 commits into
main
from
01-12-test_better-auth_add_mock_infrastructure_for_unit_tests
Jan 12, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@proofkit/better-auth
@proofkit/cli
create-proofkit
@proofkit/fmdapi
@proofkit/fmodata
@proofkit/typegen
@proofkit/webviewer
commit: |
Collaborator
Author
- 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>
4517af6 to
67a2fec
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

test(better-auth): add mock infrastructure for unit tests
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
test(typegen): add mock infrastructure for unit tests (#103)
Summary
tests/fixtures/layout-metadata.ts)tests/utils/mock-fetch.ts)tests/e2e/vitest.config.tsto exclude e2e tests by defaulttest:e2escript for running E2E tests with dopplerTest plan
pnpm --filter @proofkit/typegen lintpassespnpm --filter @proofkit/typegen typecheckpassespnpm --filter @proofkit/typegen testpasses (11 unit tests)🤖 Generated with Claude Code
Note
Establishes isolated unit testing with mocks and separates E2E runs across the repo.
mock-fetchutils; create comprehensive adapter unit tests; move adapter/migrate E2E totests/e2e; addtest:e2escript; updatevitest.config.tsto exclude E2E; small refactor inmigrate.tsfor safer type normalization and explicit FM type mappingtests/e2e; addtest:e2escript; updatevitest.config.tsto exclude E2Etests/e2e; updatetest:e2eto run foldertestscript tovitest run; update vitest config to exclude E2E-like testscripts/ralph-once.shworkflow commandWritten 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