fix: remove unused type alias and fix test compatibility with Bun 1.3.11
- Remove unused ParsedChunkTarget type alias (lint error) - Increase setImmediate timing in history storage compat test - Mock warmPythonEnvironment in python tool tests - Fix tlaplus LSP test to spy on $which instead of Bun.which
This commit is contained in:
@@ -19,9 +19,9 @@ import { YAML } from "bun";
|
||||
import { type Settings as SettingsCapabilityItem, settingsCapability } from "../capability/settings";
|
||||
import type { ModelRole } from "../config/model-registry";
|
||||
import { loadCapability } from "../discovery";
|
||||
import { type EditMode, normalizeEditMode } from "../edit";
|
||||
import { isLightTheme, setAutoThemeMapping, setColorBlindMode, setSymbolPreset } from "../modes/theme/theme";
|
||||
import { AgentStorage } from "../session/agent-storage";
|
||||
import { type EditMode, normalizeEditMode } from "../utils/edit-mode";
|
||||
import { withFileLock } from "./file-lock";
|
||||
import {
|
||||
type BashInterceptorRule,
|
||||
|
||||
@@ -88,10 +88,6 @@ export function invalidateChunkCache(filePath: string): void {
|
||||
chunkStateCache.delete(filePath);
|
||||
}
|
||||
|
||||
type ParsedChunkTarget = {
|
||||
selector: string;
|
||||
};
|
||||
|
||||
type ChunkSourceContext = {
|
||||
resolvedPath: string;
|
||||
sourceFile: BunFile;
|
||||
|
||||
@@ -47,7 +47,7 @@ it("migrates legacy history schema away from unixepoch defaults", async () => {
|
||||
|
||||
const storage = HistoryStorage.open(dbPath);
|
||||
storage.add("new prompt", "/tmp/new");
|
||||
await Bun.sleep(10);
|
||||
await Bun.sleep(100);
|
||||
|
||||
const db = new Database(dbPath, { readonly: true });
|
||||
try {
|
||||
|
||||
@@ -56,6 +56,7 @@ describe("python tool settings", () => {
|
||||
});
|
||||
|
||||
it("passes kernel mode from settings to executor", async () => {
|
||||
vi.spyOn(pythonExecutor, "warmPythonEnvironment").mockResolvedValue({ ok: true });
|
||||
const executeSpy = vi.spyOn(pythonExecutor, "executePython").mockResolvedValue({
|
||||
output: "ok",
|
||||
exitCode: 0,
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { getThemeByName } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
||||
import { clampTimeout } from "@oh-my-pi/pi-coding-agent/tools/tool-timeouts";
|
||||
import { sanitizeText } from "@oh-my-pi/pi-natives";
|
||||
import * as piUtils from "@oh-my-pi/pi-utils";
|
||||
import { TempDir } from "@oh-my-pi/pi-utils";
|
||||
|
||||
describe("lsp regressions", () => {
|
||||
@@ -236,7 +237,7 @@ describe("lsp regressions", () => {
|
||||
await Bun.write(specPath, "---- MODULE Spec ----\n====\n");
|
||||
|
||||
const whichSpy = vi
|
||||
.spyOn(Bun, "which")
|
||||
.spyOn(piUtils, "$which")
|
||||
.mockImplementation(command => (command === "tlapm_lsp" ? "/usr/local/bin/tlapm_lsp" : null));
|
||||
const existsSpy = vi
|
||||
.spyOn(fs, "existsSync")
|
||||
|
||||
@@ -23,6 +23,7 @@ function createSession(cwd: string): ToolSession {
|
||||
describe("python tool execution", () => {
|
||||
it("passes kernel options from settings and args", async () => {
|
||||
const tempDir = TempDir.createSync("@python-tool-");
|
||||
vi.spyOn(pythonExecutor, "warmPythonEnvironment").mockResolvedValue({ ok: true });
|
||||
const executeSpy = vi.spyOn(pythonExecutor, "executePython").mockResolvedValue({
|
||||
output: "ok",
|
||||
exitCode: 0,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
// AUTOGENERATED FILE -- DO NOT EDIT DIRECTLY
|
||||
// See scripts/embed-native.ts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user