Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
fix: resolve CI test failures across 6 packages#1077
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9df9d77da8db47088209ab98cac2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -868,7 +868,16 @@ describe('AIServicePlugin', () => { | ||||||||||||||||
| }); | ||||||||||||||||
| it('should fallback to MemoryLLMAdapter when provider SDK is not installed', async () => { | ||||||||||||||||
| const plugin = new AIServicePlugin(); | ||||||||||||||||
| // Mock all provider SDKs to simulate them not being installed. | ||||||||||||||||
| // In the workspace @ai-sdk/openai may be resolvable as a transitive | ||||||||||||||||
| // dependency, so we must explicitly make the dynamic import fail. | ||||||||||||||||
| vi.doMock('@ai-sdk/openai', () => { throw new Error('Cannot find module \'@ai-sdk/openai\''); }); | ||||||||||||||||
| vi.doMock('@ai-sdk/anthropic', () => { throw new Error('Cannot find module \'@ai-sdk/anthropic\''); }); | ||||||||||||||||
| vi.doMock('@ai-sdk/google', () => { throw new Error('Cannot find module \'@ai-sdk/google\''); }); | ||||||||||||||||
| // Re-import the plugin module so it picks up the mocked imports | ||||||||||||||||
| const { AIServicePlugin: FreshPlugin } = await import('../plugin.js'); | ||||||||||||||||
| const plugin = new FreshPlugin(); | ||||||||||||||||
Comment on lines
+878
to
+880
CopilotAI | ||||||||||||||||
| // Re-import the plugin module so it picks up the mocked imports | |
| const{AIServicePlugin: FreshPlugin}=awaitimport('../plugin.js'); | |
| constplugin=newFreshPlugin(); | |
| // The provider SDKs are dynamically imported during plugin initialization, | |
| // so mocking those modules is sufficient; the plugin module itself does | |
| // not need to be re-imported here. | |
| constplugin=newAIServicePlugin(); |
CopilotAIApr 7, 2026
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.
PluginContext.getService()is specified to throw when a service is missing (and the real kernel implementations do). This mock currently returnsundefinedfor unknown services (including'data'), which can mask incorrect service lookups and makes the test context diverge from production behavior. Consider having the mock throw by default and explicitly return only the services this test intends to provide (e.g.manifest), and if AuthPlugin is meant to support “no data engine” mode, simulate that by throwing for'data'(and update the implementation accordingly).