Skip to content

Commit

Permalink
fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlants committed Dec 30, 2024
1 parent ac46479 commit c03fdd5
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bun/chat/chat.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extractMountTree, withNvimClient } from "../../test/preamble.ts";
import { extractMountTree, withNvimClient } from "../test/preamble.ts";
import * as Chat from "./chat.ts";
import { type ToolRequestId } from "../tools/toolManager.ts";
import { createApp } from "../tea/tea.ts";
Expand Down
2 changes: 1 addition & 1 deletion bun/tea/render.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extractMountTree, withNvimClient } from "../../test/preamble.ts";
import { extractMountTree, withNvimClient } from "../test/preamble.ts";
import { d, mountView, pos } from "./view.ts";
import { describe, expect, it } from "bun:test";
import { NvimBuffer, type Line } from "../nvim/buffer.ts";
Expand Down
3 changes: 1 addition & 2 deletions bun/tea/update.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { d, mountView, pos } from "./view.ts";
import * as assert from "assert";
import { describe, it } from "bun:test";
import { NvimBuffer } from "../nvim/buffer.ts";
import { withNvimClient } from "../../test/preamble.ts";
import { withNvimClient } from "../test/preamble.ts";

describe("tea/update.spec.ts", () => {
it("updates to and from empty string", async () => {
Expand Down
2 changes: 1 addition & 1 deletion bun/tea/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "./util.ts";
import { pos } from "./view.ts";
import { NvimBuffer, type Line } from "../nvim/buffer.ts";
import { withNvimClient } from "../../test/preamble.ts";
import { withNvimClient } from "../test/preamble.ts";
import type { Position0Indexed } from "../nvim/window.ts";

describe("tea/util.spec.ts", () => {
Expand Down
2 changes: 1 addition & 1 deletion bun/tea/view.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extractMountTree, withNvimClient } from "../../test/preamble.ts";
import { extractMountTree, withNvimClient } from "../test/preamble.ts";
import { d, mountView, pos } from "./view.ts";
import * as assert from "assert";
import { describe, it } from "bun:test";
Expand Down
16 changes: 8 additions & 8 deletions bun/test/driver.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type Nvim } from "bunvim";
import type { Magenta } from "../src/magenta";
import type { Line } from "../src/nvim/buffer";
import type { MockClient } from "../src/anthropic-mock";
import { NvimWindow, pos0to1, type Position0Indexed } from "../src/nvim/window";
import { pollUntil } from "../src/utils/async";
import { calculatePosition } from "../src/tea/util";
import type { BindingKey } from "../src/tea/bindings";
import { getAllWindows } from "../src/nvim/nvim";
import type { Magenta } from "../magenta";
import type { Line } from "../nvim/buffer";
import type { MockClient } from "../anthropic-mock";
import { NvimWindow, pos0to1, type Position0Indexed } from "../nvim/window";
import { pollUntil } from "../utils/async";
import { calculatePosition } from "../tea/util";
import type { BindingKey } from "../tea/bindings";
import { getAllWindows } from "../nvim/nvim";

export class NvimDriver {
constructor(
Expand Down
10 changes: 5 additions & 5 deletions bun/test/preamble.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { attach, type Nvim } from "bunvim";
import { unlink } from "node:fs/promises";
import { spawn } from "child_process";
import { type MountedVDOM } from "../src/tea/view.ts";
import { assertUnreachable } from "../src/utils/assertUnreachable.ts";
import { type MountedVDOM } from "../tea/view.ts";
import { assertUnreachable } from "../utils/assertUnreachable.ts";
import path from "path";
import { delay } from "../src/utils/async.ts";
import { Magenta } from "../src/magenta.ts";
import { withMockClient } from "../src/anthropic-mock.ts";
import { delay } from "../utils/async.ts";
import { Magenta } from "../magenta.ts";
import { withMockClient } from "../anthropic-mock.ts";
import { NvimDriver } from "./driver.ts";

const SOCK = `/tmp/magenta-test.sock`;
Expand Down
2 changes: 1 addition & 1 deletion bun/tools/diff.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "bun:test";
import { withDriver } from "../../test/preamble";
import { withDriver } from "../test/preamble";
import type { ToolRequestId } from "./toolManager";
import * as path from "path";

Expand Down
2 changes: 1 addition & 1 deletion bun/tools/getFile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createApp } from "../tea/tea.ts";
import { describe, it } from "bun:test";
import { pos } from "../tea/view.ts";
import { NvimBuffer } from "../nvim/buffer.ts";
import { withNvimClient } from "../../test/preamble.ts";
import { withNvimClient } from "../test/preamble.ts";

describe("tea/getFile.spec.ts", () => {
it("render the getFile tool.", async () => {
Expand Down
2 changes: 1 addition & 1 deletion bun/tools/listBuffers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createApp } from "../tea/tea.ts";
import { describe, it, expect } from "bun:test";
import { pos } from "../tea/view.ts";
import { NvimBuffer } from "../nvim/buffer.ts";
import { withNvimClient } from "../../test/preamble.ts";
import { withNvimClient } from "../test/preamble.ts";

describe("tea/listBuffers.spec.ts", () => {
it("render the getFile tool.", async () => {
Expand Down

0 comments on commit c03fdd5

Please sign in to comment.