Skip to content

Commit 56cf2de

Browse files
committed
update vertexai names in tests
1 parent 6bf5162 commit 56cf2de

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/vertexai/src/api.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { VertexAI } from './public-types';
2121
import { GenerativeModel } from './models/generative-model';
2222
import { VertexError } from './errors';
2323

24-
const fakeVertex: VertexAI = {
24+
const fakeVertexAI: VertexAI = {
2525
app: {
2626
name: 'DEFAULT',
2727
automaticDataCollectionEnabled: true,
@@ -35,13 +35,13 @@ const fakeVertex: VertexAI = {
3535

3636
describe('Top level API', () => {
3737
it('getGenerativeModel throws if no model is provided', () => {
38-
expect(() => getGenerativeModel(fakeVertex, {} as ModelParams)).to.throw(
38+
expect(() => getGenerativeModel(fakeVertexAI, {} as ModelParams)).to.throw(
3939
VertexError.NO_MODEL
4040
);
4141
});
4242
it('getGenerativeModel throws if no apiKey is provided', () => {
4343
const fakeVertexNoApiKey = {
44-
...fakeVertex,
44+
...fakeVertexAI,
4545
app: { options: { projectId: 'my-project' } }
4646
} as VertexAI;
4747
expect(() =>
@@ -50,15 +50,15 @@ describe('Top level API', () => {
5050
});
5151
it('getGenerativeModel throws if no projectId is provided', () => {
5252
const fakeVertexNoProject = {
53-
...fakeVertex,
53+
...fakeVertexAI,
5454
app: { options: { apiKey: 'my-key' } }
5555
} as VertexAI;
5656
expect(() =>
5757
getGenerativeModel(fakeVertexNoProject, { model: 'my-model' })
5858
).to.throw(VertexError.NO_PROJECT_ID);
5959
});
6060
it('getGenerativeModel gets a GenerativeModel', () => {
61-
const genModel = getGenerativeModel(fakeVertex, { model: 'my-model' });
61+
const genModel = getGenerativeModel(fakeVertexAI, { model: 'my-model' });
6262
expect(genModel).to.be.an.instanceOf(GenerativeModel);
6363
expect(genModel.model).to.equal('publishers/google/models/my-model');
6464
});

packages/vertexai/src/models/generative-model.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { expect } from 'chai';
1818
import { GenerativeModel } from './generative-model';
1919
import { VertexAI } from '../public-types';
2020

21-
const fakeVertex: VertexAI = {
21+
const fakeVertexAI: VertexAI = {
2222
app: {
2323
name: 'DEFAULT',
2424
automaticDataCollectionEnabled: true,
@@ -32,23 +32,23 @@ const fakeVertex: VertexAI = {
3232

3333
describe('GenerativeModel', () => {
3434
it('handles plain model name', () => {
35-
const genModel = new GenerativeModel(fakeVertex, { model: 'my-model' });
35+
const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model' });
3636
expect(genModel.model).to.equal('publishers/google/models/my-model');
3737
});
3838
it('handles models/ prefixed model name', () => {
39-
const genModel = new GenerativeModel(fakeVertex, {
39+
const genModel = new GenerativeModel(fakeVertexAI, {
4040
model: 'models/my-model'
4141
});
4242
expect(genModel.model).to.equal('publishers/google/models/my-model');
4343
});
4444
it('handles full model name', () => {
45-
const genModel = new GenerativeModel(fakeVertex, {
45+
const genModel = new GenerativeModel(fakeVertexAI, {
4646
model: 'publishers/google/models/my-model'
4747
});
4848
expect(genModel.model).to.equal('publishers/google/models/my-model');
4949
});
5050
it('handles prefixed tuned model name', () => {
51-
const genModel = new GenerativeModel(fakeVertex, {
51+
const genModel = new GenerativeModel(fakeVertexAI, {
5252
model: 'tunedModels/my-model'
5353
});
5454
expect(genModel.model).to.equal('tunedModels/my-model');

0 commit comments

Comments
 (0)