summaryrefslogtreecommitdiff
path: root/tests/index.test.ts
blob: 1c328fac10b992fa577eba0b5a79d9fb2fe5423d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { describe, expect, test } from "bun:test";
import selectModel from "../index";

describe("Model selector smoke tests", () => {
  // test("chatgpt model instantiates correctly and basic send works", async () => {
  //   const api = selectModel({ chatgpt: "" });
  //   expect(api).toBeDefined();
  //   expect(typeof api.send).toBe("function");
  //   expect(typeof api.stream).toBe("function");
  //   expect(typeof api.setModel).toBe("function");
  //   expect(typeof api.tokenizer).toBe("function");
  //   expect(typeof api.maxTokens).toBe("number");
  //   const res = await api.send("hello");
  //   expect(res).toBeTruthy();
  //   expect(typeof (res.ok ?? res.error)).toBe("string");
  // });
  // test("gemini model instantiates correctly and basic send works", async () => {
  //   const api = selectModel({ gemini: "" });
  //   expect(api).toBeDefined();
  //   expect(typeof api.send).toBe("function");
  //   expect(typeof api.stream).toBe("function");
  //   const res = await api.send("hello");
  //   console.log({ res });
  // });
  // test("claude model instantiates correctly and basic send works", async () => {
  //   const api = selectModel({ claude: "" });
  //   expect(api).toBeDefined();
  //   expect(typeof api.send).toBe("function");
  //   expect(typeof api.stream).toBe("function");
  //   const res = await api.send("hello");
  //   expect(res).toBeTruthy();
  //   expect(typeof (res.ok ?? res.error)).toBe("string");
  // });
  // test("deepseek model instantiates correctly and basic send works", async () => {
  //   const api = selectModel({ deepseek: "" });
  //   expect(api).toBeDefined();
  //   expect(typeof api.send).toBe("function");
  //   expect(typeof api.stream).toBe("function");
  //   const res = await api.send("hello");
  //   expect(res).toBeTruthy();
  //   expect(typeof (res.ok ?? res.error)).toBe("string");
  // });
  // test("kimi model instantiates correctly and basic send works", async () => {
  //   const api = selectModel({ kimi: "" });
  //   expect(api).toBeDefined();
  //   expect(typeof api.send).toBe("function");
  //   expect(typeof api.stream).toBe("function");
  //   const res = await api.send("hello");
  //   expect(res).toBeTruthy();
  //   expect(typeof (res.ok ?? res.error)).toBe("string");
  // });
  // test("grok model instantiates correctly and basic send works", async () => {
  //   const api = selectModel({ grok: "" });
  //   expect(api).toBeDefined();
  //   expect(typeof api.send).toBe("function");
  //   expect(typeof api.stream).toBe("function");
  //   const res = await api.send("hello");
  //   expect(res).toBeTruthy();
  //   expect(typeof (res.ok ?? res.error)).toBe("string");
  // });
});