mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-28 04:29:42 +00:00
14 lines
618 B
TypeScript
14 lines
618 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import path from "path"
|
|
import { Global } from "../../src/global"
|
|
import { InstallationChannel } from "../../src/installation/version"
|
|
import { Database } from "../../src/storage"
|
|
|
|
describe("Database.Path", () => {
|
|
test("returns database path for the current channel", () => {
|
|
const expected = ["latest", "beta"].includes(InstallationChannel)
|
|
? path.join(Global.Path.data, "opencode.db")
|
|
: path.join(Global.Path.data, `opencode-${InstallationChannel.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`)
|
|
expect(Database.getChannelPath()).toBe(expected)
|
|
})
|
|
})
|