Skip to content

Commit ceccf5c

Browse files
kamja44gemini-code-assist[bot]
authored andcommitted
Test/add loadcodeassist mock (#4287)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 21cb210 commit ceccf5c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/core/src/code_assist/server.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { describe, it, expect, vi } from 'vitest';
88
import { CodeAssistServer } from './server.js';
99
import { OAuth2Client } from 'google-auth-library';
10+
import { UserTierId } from './types.js';
1011

1112
vi.mock('google-auth-library');
1213

@@ -115,7 +116,14 @@ describe('CodeAssistServer', () => {
115116
const client = new OAuth2Client();
116117
const server = new CodeAssistServer(client, 'test-project');
117118
const mockResponse = {
118-
// TODO: Add mock response
119+
currentTier: {
120+
id: UserTierId.FREE,
121+
name: 'Free',
122+
description: 'free tier',
123+
},
124+
allowedTiers: [],
125+
ineligibleTiers: [],
126+
cloudaicompanionProject: 'projects/test',
119127
};
120128
vi.spyOn(server, 'requestPost').mockResolvedValue(mockResponse);
121129

@@ -127,7 +135,7 @@ describe('CodeAssistServer', () => {
127135
'loadCodeAssist',
128136
expect.any(Object),
129137
);
130-
expect(response).toBe(mockResponse);
138+
expect(response).toEqual(mockResponse);
131139
});
132140

133141
it('should return 0 for countTokens', async () => {

0 commit comments

Comments
 (0)