Spaces:
Running
Running
File size: 846 Bytes
98c9143 | 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 | 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)
})
})
|