Spaces:
Running
Running
Download tests/sqlite.test.ts from imspsycho/copilot-api: direct link, hf CLI and curl.
- Browser
- Download file 846 Bytes
-
https://huggingface.co/spaces/imspsycho/copilot-api/resolve/main/tests/sqlite.test.ts
- Command line
-
hf download hf://spaces/imspsycho/copilot-api/tests/sqlite.test.ts
-
curl -L -o sqlite.test.ts https://huggingface.co/spaces/imspsycho/copilot-api/resolve/main/tests/sqlite.test.ts
846 Bytes
| import { describe, expect, test } from "bun:test" | |
| import { | |
| isNodeSqliteSupportedVersion, | |
| isSqliteRuntimeSupported, | |
| } from "~/lib/sqlite" | |
| describe("sqlite runtime support", () => { | |
| test("detects the minimum Node.js version for node:sqlite", () => { | |
| expect(isNodeSqliteSupportedVersion("22.12.0")).toBe(false) | |
| expect(isNodeSqliteSupportedVersion("22.13.0")).toBe(true) | |
| expect(isNodeSqliteSupportedVersion("23.0.0")).toBe(true) | |
| }) | |
| test("disables SQLite on older Node.js versions while allowing Bun", () => { | |
| expect( | |
| isSqliteRuntimeSupported({ isBun: false, nodeVersion: "22.12.0" }), | |
| ).toBe(false) | |
| expect( | |
| isSqliteRuntimeSupported({ isBun: false, nodeVersion: "22.13.0" }), | |
| ).toBe(true) | |
| expect( | |
| isSqliteRuntimeSupported({ isBun: true, nodeVersion: "20.0.0" }), | |
| ).toBe(true) | |
| }) | |
| }) | |