CLI perf: reduce deps (#22652)

This commit is contained in:
Dax
2026-04-16 02:03:03 -04:00
committed by GitHub
parent 150ab07a83
commit 675a46e23e
84 changed files with 1415 additions and 1011 deletions

View File

@@ -1,14 +1,14 @@
import { describe, expect, test } from "bun:test"
import path from "path"
import { Global } from "../../src/global"
import { Installation } from "../../src/installation"
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(Installation.CHANNEL)
const expected = ["latest", "beta"].includes(InstallationChannel)
? path.join(Global.Path.data, "opencode.db")
: path.join(Global.Path.data, `opencode-${Installation.CHANNEL.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`)
: path.join(Global.Path.data, `opencode-${InstallationChannel.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`)
expect(Database.getChannelPath()).toBe(expected)
})
})