Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed May 3, 2024
1 parent 6680a40 commit fac2760
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/vertexai/src/service.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DEFAULT_LOCATION } from './constants';
import { VertexAIService } from './service';
import { expect } from 'chai';

const fakeApp = {
name: 'DEFAULT',
automaticDataCollectionEnabled: true,
options: {
apiKey: 'key',
projectId: 'my-project'
}
};

describe('VertexAIService', () => {
it('uses default location if not specified', () => {
const vertexAI = new VertexAIService(fakeApp);
expect(vertexAI.location).to.equal(DEFAULT_LOCATION);
});
it('uses custom location if specified', () => {
const vertexAI = new VertexAIService(
fakeApp,
/* appCheckProvider */ undefined,
{ location: 'somewhere' }
);
expect(vertexAI.location).to.equal('somewhere');
});
});

0 comments on commit fac2760

Please sign in to comment.