Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 9, 2025
1 parent 4a6d219 commit 0f9f472
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/globalConfig/_deprecated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ vi.mock('@/config/llm', () => ({
}));

// Mock parse models utils
vi.mock('@/utils/parseModels', () => ({
vi.mock('@/utils/_deprecated/parseModels', () => ({
extractEnabledModels: (modelString: string, withDeploymentName?: boolean) => {
// Returns different format if withDeploymentName is true
return withDeploymentName ? [`${modelString}_withDeployment`] : [modelString];
Expand Down
80 changes: 80 additions & 0 deletions src/utils/_deprecated/__snapshots__/parseModels.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`parseModelString > custom deletion, addition, and renaming of models 1`] = `
{
"add": [
{
"displayName": undefined,
"id": "llama",
},
{
"displayName": undefined,
"id": "claude-2",
},
{
"displayName": "gpt-4-32k",
"id": "gpt-4-1106-preview",
},
],
"removeAll": true,
"removed": [
"all",
"gpt-3.5-turbo",
],
}
`;

exports[`parseModelString > duplicate naming model 1`] = `
{
"add": [
{
"displayName": "gpt-4-32k",
"id": "gpt-4-1106-preview",
},
],
"removeAll": false,
"removed": [],
}
`;

exports[`parseModelString > empty string model 1`] = `
{
"add": [
{
"displayName": "gpt-4-turbo",
"id": "gpt-4-1106-preview",
},
{
"displayName": undefined,
"id": "claude-2",
},
],
"removeAll": false,
"removed": [],
}
`;

exports[`parseModelString > only add the model 1`] = `
{
"add": [
{
"displayName": undefined,
"id": "model1",
},
{
"displayName": undefined,
"id": "model2",
},
{
"displayName": undefined,
"id": "model3",
},
{
"displayName": undefined,
"id": "model4",
},
],
"removeAll": false,
"removed": [],
}
`;

0 comments on commit 0f9f472

Please sign in to comment.