-
Couldn't load subscription status.
- Fork 984
test(ai): Fix node tests #9350
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
test(ai): Fix node tests #9350
Conversation
|
| ) | ||
| new Component( | ||
| AI_TYPE, | ||
| factory ?? factoryNode, |
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.
I'm not sure if I understand this part correctly.
If no factory is provided, we default to the Node factory. Since no callers of getFullApp provide a factory, wouldn't all tests use the Node factory?
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.
The only time getFullApp was used is in AI tests that use getAI(), and I assumed there were some hybrid/browser-specific ones that would need this, but it looks like there weren't. I think there should be (always good to have tests that are as e2e as possible) so I added two in api-browser.test.ts.
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.
Sounds good.
Small nit: I think if we're defaulting to factoryNode, this should be done in the signature
factory?: InstanceFactory<'AI'> = factoryNode
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
packages/ai/src/api-browser.test.ts
Outdated
| @@ -0,0 +1,48 @@ | |||
| /** | |||
| * @license | |||
| * Copyright 2024 Google LLC | |||
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.
2025
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.
Thanks, done.
| ) | ||
| new Component( | ||
| AI_TYPE, | ||
| factory ?? factoryNode, |
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.
Sounds good.
Small nit: I think if we're defaulting to factoryNode, this should be done in the signature
factory?: InstanceFactory<'AI'> = factoryNode
Remove
src/methods/chrome-adapter.tsfrom all paths that would be reached bytest:node.yarn test:nodetested locally