Skip to content

Commit adef2fe

Browse files
committed
Stub chrome in positive test
1 parent 8d9a493 commit adef2fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/vertexai/src/methods/chrome-adapter.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ describe('ChromeAdapter', () => {
175175
).to.be.false;
176176
});
177177
it('returns true if model is readily available', async () => {
178+
const chromeStub = stub(util, 'isChrome').returns(true);
178179
const languageModelProvider = {
179180
availability: () => Promise.resolve(Availability.available)
180181
} as LanguageModel;
@@ -187,6 +188,7 @@ describe('ChromeAdapter', () => {
187188
contents: [{ role: 'user', parts: [{ text: 'hi' }] }]
188189
})
189190
).to.be.true;
191+
chromeStub.restore();
190192
});
191193
it('returns false and triggers download when model is available after download', async () => {
192194
const languageModelProvider = {

0 commit comments

Comments
 (0)