You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
- [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 -->
Configure your database connection in your `auth.ts` file. Be sure to set these value secrets in your environment variables. The credentials you use here need `fmodata` permissions enabled, and read/write access to the better-auth tables.
Run the following command to create the necessary tables and fields in your FileMaker file. It will show you a confirmation before any changes are applied, so you can review them.
[Full Access] credentials are required for the schema changes to be applied automatically, but you may want to use a more restricted account for the rest of better-auth usage. If your credentials that you entered earlier in the `auth.ts` file do not have the [Full Access] permissions, you can override them in the CLI.
Here's a minimal example to get you started with `@proofkit/fmodata`:
@@ -20,9 +21,7 @@ Here's a minimal example to get you started with `@proofkit/fmodata`:
20
21
<Step>
21
22
### Install the package
22
23
23
-
```package-install
24
-
@proofkit/fmodata@beta
25
-
```
24
+
<PackageInstallpackages="@proofkit/fmodata" />
26
25
27
26
</Step>
28
27
@@ -67,7 +66,7 @@ Here's a minimal example to get you started with `@proofkit/fmodata`:
67
66
</TabsList>
68
67
<TabsContentvalue="automatic">
69
68
Run this command in your project to launch a browser-based UI for configuring your schema definitions. You will need environment variables set for your FileMaker server and database.
The typegen tool has a built-in web interface for editing your JSON config file and running the typegen scripts. It's helpful for making sure your environment variables are setup correctly and can help autocomplete layout/field/table names into the config file.
6
8
7
9
To launch the UI, run the following command and a browser window will open at `http://localhost:3141`:
0 commit comments