fix: align sveltekit adapter tests with dispatch() catch-all pattern#943
Merged
fix: align sveltekit adapter tests with dispatch() catch-all pattern#943
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The sveltekit adapter implementation uses dispatcher.dispatch() for the catch-all route (meta, data, etc.), but the test mocks were using the old handleMetadata/handleData methods that no longer exist in the code path. Updated the mock to include dispatch and aligned test assertions with the unified catch-all pattern used by all other adapters (hono, etc.). Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/d30145f6-3528-4e58-baf1-5011e72f43c4
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/d30145f6-3528-4e58-baf1-5011e72f43c4
Copilot
AI
changed the title
[WIP] Fix all CI errors
fix: align sveltekit adapter tests with dispatch() catch-all pattern
Mar 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the SvelteKit adapter test suite to match the adapter’s current unified routing approach, where non-auth/graphql/storage/discovery routes are handled via HttpDispatcher.dispatch() (consistent with other adapters).
Changes:
- Updated the SvelteKit adapter test mock to implement
dispatch()(removing obsoletehandleMetadata/handleDatamocks). - Adjusted Metadata/Data/Error handling/toResponse tests to assert the
dispatch(method, path, body, query, context)catch-all contract. - Documented the fix in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/adapters/sveltekit/src/sveltekit.test.ts | Aligns the mocked dispatcher + assertions with the adapter’s catch-all dispatch() behavior. |
| CHANGELOG.md | Records the SvelteKit adapter test alignment/fix under “Fixed”. |
Contributor
|
@copilot ci test 还是报错,我要解决所有问题 |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/b4107236-dbb5-4f8e-8fda-054f241adfe7
Copilot stopped work on behalf of
hotlong due to an error
March 21, 2026 09:07
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
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.
SvelteKit adapter was refactored to use the unified
dispatcher.dispatch()catch-all (like all other adapters), but tests still mocked the oldhandleMetadata/handleDatamethods — causing 7/19 tests to fail with 500s.handleMetadata/handleDatain mock withdispatchAligned with the hono adapter test conventions, which already use this pattern.
Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.