lint: add Biome (lint only) and fix its findings
This commit is contained in:
1 parent
d5b6406cae
commit
441d9d6ed3
14 files changed
+125
-22
No files matched your search
+12
-2
@@ -78,7 +78,12 @@ describe("commands tui3 dispatches", () => {
|
||||
test("a new thread launches with a payload the server accepts", async () => {
|
||||
const session = new T3Session();
|
||||
let payload: unknown;
|
||||
const rpc = { "orchestration.launchThread": (input: unknown) => ((payload = input), Effect.succeed({ threadId: ThreadId.make("new-1") })) };
|
||||
const rpc = {
|
||||
"orchestration.launchThread": (input: unknown) => {
|
||||
payload = input;
|
||||
return Effect.succeed({ threadId: ThreadId.make("new-1") });
|
||||
},
|
||||
};
|
||||
(session as unknown as { connection: unknown }).connection = { rpc };
|
||||
const id = await session.launchThread({
|
||||
projectId: ProjectId.make("p1"),
|
||||
@@ -104,7 +109,12 @@ describe("commands tui3 dispatches", () => {
|
||||
|
||||
const launching = new T3Session();
|
||||
let payload: unknown;
|
||||
const rpc = { "orchestration.launchThread": (input: unknown) => ((payload = input), Effect.succeed({ threadId: ThreadId.make("new-2") })) };
|
||||
const rpc = {
|
||||
"orchestration.launchThread": (input: unknown) => {
|
||||
payload = input;
|
||||
return Effect.succeed({ threadId: ThreadId.make("new-2") });
|
||||
},
|
||||
};
|
||||
(launching as unknown as { connection: unknown }).connection = { rpc };
|
||||
await launching.launchThread({
|
||||
projectId: ProjectId.make("p1"),
|
||||
|
||||
+4
-1
@@ -5,7 +5,10 @@ import { splitPatch, wholeFilePatch } from "../src/model/diffs.ts";
|
||||
const changed = "diff --git a/a.ts b/a.ts\n--- a/a.ts\n+++ b/a.ts\n@@ -2 +2 @@\n-old\n+new\n";
|
||||
|
||||
test("diff files retain old paths and change types for contents requests", () => {
|
||||
const files = splitPatch(changed + "diff --git a/old.ts b/new.ts\nsimilarity index 100%\nrename from old.ts\nrename to new.ts\n" + "diff --git a/gone.ts b/gone.ts\ndeleted file mode 100644\n--- a/gone.ts\n+++ /dev/null\n@@ -1 +0,0 @@\n-gone\n" + "diff --git a/add.ts b/add.ts\nnew file mode 100644\n--- /dev/null\n+++ b/add.ts\n@@ -0,0 +1 @@\n+added\n");
|
||||
const renamed = "diff --git a/old.ts b/new.ts\nsimilarity index 100%\nrename from old.ts\nrename to new.ts\n";
|
||||
const deleted = "diff --git a/gone.ts b/gone.ts\ndeleted file mode 100644\n--- a/gone.ts\n+++ /dev/null\n@@ -1 +0,0 @@\n-gone\n";
|
||||
const added = "diff --git a/add.ts b/add.ts\nnew file mode 100644\n--- /dev/null\n+++ b/add.ts\n@@ -0,0 +1 @@\n+added\n";
|
||||
const files = splitPatch(`${changed}${renamed}${deleted}${added}`);
|
||||
expect(files.map(({ path, oldPath, changeType }) => ({ path, oldPath, changeType }))).toEqual([
|
||||
{ path: "a.ts", oldPath: "a.ts", changeType: "change" }, { path: "new.ts", oldPath: "old.ts", changeType: "rename-pure" },
|
||||
{ path: "gone.ts", oldPath: "gone.ts", changeType: "deleted" }, { path: "add.ts", oldPath: "add.ts", changeType: "new" },
|
||||
|
||||
@@ -261,7 +261,10 @@ describe("pull request commands and payloads", () => {
|
||||
const payloads = new Map<string, unknown>();
|
||||
const capture =
|
||||
(method: string, result: unknown) =>
|
||||
(input: unknown) => (payloads.set(method, input), Effect.succeed(result));
|
||||
(input: unknown) => {
|
||||
payloads.set(method, input);
|
||||
return Effect.succeed(result);
|
||||
};
|
||||
const rpc = {
|
||||
"pullRequests.list": capture("list", listResult([])),
|
||||
"pullRequests.detail": capture("detail", detail()),
|
||||
|
||||
@@ -77,7 +77,9 @@ describe("workspace RPC payloads (no live mutations)", () => {
|
||||
await session.cancelWorktreeSetup(threadId);
|
||||
expect(sent.map((call) => call.method)).toEqual(["vcs.switchRef", "vcs.createRef", "vcs.pull", "vcs.createWorktree", "vcs.removeWorktree", "shell.openInEditor", "worktreeSetup.cancel"]);
|
||||
const schemas = [VcsSwitchRefInput, VcsCreateRefInput, VcsPullInput, VcsCreateWorktreeInput, VcsRemoveWorktreeInput, LaunchEditorInput, WorktreeSetupCancelInput];
|
||||
schemas.forEach((schema, index) => expect(Schema.is(schema)(sent[index]!.input)).toBe(true));
|
||||
schemas.forEach((schema, index) => {
|
||||
expect(Schema.is(schema)(sent[index]!.input)).toBe(true);
|
||||
});
|
||||
expect(sent[1]!.input).toMatchObject({ switchRef: true });
|
||||
expect(sent[3]!.input).toEqual({ cwd: "/repo", refName: "main", newRefName: "new-work", path: null });
|
||||
expect(sent[4]!.input).not.toHaveProperty("force");
|
||||
|
||||
Reference in new issue
Block a user