From 9bb0e4f340da0bea35bc9c634ad0dfa7934ae7b7 Mon Sep 17 00:00:00 2001 From: Ankur Goyal Date: Tue, 5 Sep 2023 22:12:25 -0700 Subject: [PATCH] Working on it --- jest.config.cjs | 17 +++++++++++++++++ jest.config.js | 9 --------- node/llm.test.ts | 8 +++----- 3 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 jest.config.cjs delete mode 100644 jest.config.js diff --git a/jest.config.cjs b/jest.config.cjs new file mode 100644 index 0000000..e2b1582 --- /dev/null +++ b/jest.config.cjs @@ -0,0 +1,17 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + testEnvironment: "node", + transform: { + "\\.yaml$": "jest-text-transformer", + "\\.[jt]sx?$": "ts-jest", + }, + globals: { + "ts-jest": { + useESM: true, + }, + }, + moduleNameMapper: { + "(.+)\\.js": "$1", + }, + extensionsToTreatAsEsm: [".ts"], +}; diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 8eac81a..0000000 --- a/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: "ts-jest", - testEnvironment: "node", - // https://www.npmjs.com/package/jest-transform-yaml - transform: { - "\\.yaml$": "jest-text-transformer", - }, -}; diff --git a/node/llm.test.ts b/node/llm.test.ts index 008007a..66be301 100644 --- a/node/llm.test.ts +++ b/node/llm.test.ts @@ -1,5 +1,3 @@ -import path from "path"; - import { Battle, LLMClassifierFromTemplate, OpenAIClassifier } from "../js/llm"; import { ChatCompletionRequestMessage } from "openai"; import { ChatCache } from "../js/oai"; @@ -59,7 +57,7 @@ Nicolo also dropped this as a reference: http://spec.openapis.org/oas/v3.0.3#ope expect(score.score).toBe(1); expect(score.error).toBeUndefined(); -}, 60000); +}, 600000); test("llm_classifier", async () => { const pageContent = `As suggested by Nicolo, we should standardize the error responses coming from GoTrue, postgres, and realtime (and any other/future APIs) so that it's better DX when writing a client, @@ -106,7 +104,7 @@ Issue Description: {{page_content}} expect(response.score).toBe(0); expect(response.error).toBeUndefined(); } -}, 60000); +}, 600000); test("battle", async () => { for (const useCoT of [true, false]) { @@ -144,4 +142,4 @@ test("battle", async () => { expect(response.score).toBe(0); expect(response.error).toBeUndefined(); } -}, 60000); +}, 600000);