-
Notifications
You must be signed in to change notification settings - Fork 6
test: implement type-checked test fixtures #873
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the mocking system to implement type-checked test fixtures by converting JSON fixtures to TypeScript modules with type imports and satisfies
clauses. This ensures compile-time validation of mock data against OpenAPI-generated types.
- Converted auto-generated fixtures from JSON to TypeScript format with type checking
- Improved fixture folder structure with shorter path names and nested directories
- Updated mock generation logic to create type-safe fixtures with proper imports
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
use-mutation-restart-server.test.ts |
Enhanced test with proper async handling and query client state validation |
mocker.ts |
Core refactor to generate TypeScript fixtures with type checking and improved file organization |
mockTemplate.ts |
New utility to generate TypeScript module templates with conditional type imports |
Various fixture files | Converted from JSON to TypeScript format with type imports and satisfies clauses |
customHandlers/index.ts |
Removed redundant handlers now covered by auto-generated fixtures |
fixtures/README.md |
Updated documentation to reflect TypeScript fixture format |
a little refactor I did yesterday for the auto mocking system. What it includes:
Old folder structure
New folder structure
Type checkable automatic mocks
Example: