Skip to content

Commit

Permalink
update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
code-october committed Nov 30, 2024
1 parent 54f6feb commit cc5e16b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/model-available.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe("isModelNotavailableInServer", () => {
const result = isModelNotavailableInServer(customModels, modelName, providerNames);
expect(result).toBe(true);
});

test("should respect DISABLE_GPT4 setting", () => {
process.env.DISABLE_GPT4 = "1";
const result = isModelNotavailableInServer("", "gpt-4", "OpenAI");
Expand All @@ -27,6 +28,11 @@ describe("isModelNotavailableInServer", () => {
expect(result).toBe(true);
});

test("should be case insensitive for model names", () => {
const result = isModelNotavailableInServer("-all,GPT-4", "gpt-4", "OpenAI");
expect(result).toBe(true);
});

test("support passing multiple providers, model unavailable on one of the providers will return true", () => {
const customModels = "-all,gpt-4@Google";
const modelName = "gpt-4";
Expand Down

0 comments on commit cc5e16b

Please sign in to comment.