1a734adb4d
Moves effect logging, observability, runtime utilities, flags, installation version info, and process utilities from opencode to core package. This enables better code sharing across packages and establishes core as the single source of truth for foundational utilities. All internal imports updated to use @opencode-ai/core paths for consistency.
15 lines
626 B
TypeScript
15 lines
626 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import path from "path"
|
|
import { Global } from "../../src/global"
|
|
import { InstallationChannel } from "@opencode-ai/core/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)
|
|
})
|
|
})
|