Skip to content

Commit 2de6726

Browse files
committed
test(vertexai): handle new vertexai mock responses version
- has a new v7 on the end, so update gitignore - moved responses to subdirectory, add new subdir to dir lookup
1 parent d709f76 commit 2de6726

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,5 +583,5 @@ website/public
583583
*.tsbuildinfo
584584

585585
# vertexai test data
586-
vertexai-sdk-test-data
586+
vertexai-sdk-test-data*
587587
mocks-lookup.ts

packages/vertexai/__tests__/test-utils/convert-mocks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function findMockResponseDir(): string {
3636
throw new Error('Multiple directories starting with "vertexai-sdk-test-data*" found');
3737
}
3838

39-
return join(__dirname, directories[0], 'mock-responses');
39+
return join(__dirname, directories[0], 'mock-responses', 'vertexai');
4040
}
4141

4242
async function main(): Promise<void> {
@@ -45,6 +45,7 @@ async function main(): Promise<void> {
4545
const lookup: Record<string, string> = {};
4646
// eslint-disable-next-line guard-for-in
4747
for (const fileName of list) {
48+
console.log(`attempting to read ${mockResponseDir}/${fileName}`)
4849
const fullText = fs.readFileSync(join(mockResponseDir, fileName), 'utf-8');
4950
lookup[fileName] = fullText;
5051
}

0 commit comments

Comments
 (0)